Irontaco Posted February 20, 2013 Share Posted February 20, 2013 Brook's is simply getting ready for winter.Now let me stuff this meat into my mouth like a squirrel and go burrow in a hole somewhere away from the Walruses. Link to comment Share on other sites More sharing options...
Palpetinus Posted February 20, 2013 Share Posted February 20, 2013 Very true!Close, but since the game world is build on a grid, we can actually skip the raytrace and just step along the grid checking each one to see if it is either impassable (eg. water) or contains walls. If so, we do a proper pathfind. (Objects that are not walls are completely ignored for pathfinding purposes at the moment)However, as already mentioned:[*]We only pathfind over short distances, if it's more than about a screen away, we don't bother as it becomes more likely to be too expensive.[*]Even if it's a short distance, and even if it look to you as though there is an obvious path, it's still possible for A* to take quite a few steps to find the path... so this is also limited. Basically we let the A* pathfinding run for a while, and if it hasn't found a path by then, we cancel the operation because we have to get on with running the rest of the game.Two likely additions will address these later are hierarchical pathfinding, which will make it much more practical over long distances; and queuing up the pathfind to occur over several frames, instead of requiring it to complete either all or nothing in a single step, which would allow even very long paths to be computed (hopefully) without grinding your game to a halt.We just need to budget the time to do those things *furrows brow**goes back to making an igloo*That's nice and all, but can't mobs just give up whatever they try to do after a while? Link to comment Share on other sites More sharing options...
Diezen Posted February 20, 2013 Share Posted February 20, 2013 Winter is coming + Walruses + Igloos......I like where this is going.I can only imagine snow walls... And possibly Igloos functioning like tents except instead of restoring hunger/sanity it'll restore warmth. Link to comment Share on other sites More sharing options...
Excess Posted February 20, 2013 Share Posted February 20, 2013 That's nice and all, but can't mobs just give up whatever they try to do after a while?Thing is, pigmen are afraid of the dark. They wouldn't just stand there until the night comes.Perhaps an alternative could be that after a couple of seconds of running in the same spot, they would switch to a 10 seconds state of running on a random side-wise direction, and then give the go straight home approach another try.They would probably still hit walls, but they would appear to try and circumvent the obstacle. It may not fix the problem, but it wouldn't hurt so much our suspension of disbelief. Link to comment Share on other sites More sharing options...
Palpetinus Posted February 20, 2013 Share Posted February 20, 2013 Thing is, pigmen are afraid of the dark. They wouldn't just stand there until the night comes.Perhaps an alternative could be that after a couple of seconds of running in the same spot, they would switch to a 10 seconds state of running on a random side-wise direction, and then give the go straight home approach another try.They would probably still hit walls, but they would appear to try and circumvent the obstacle. It may not fix the problem, but it wouldn't hurt so much our suspension of disbelief.Well, actually, it COULD fix their situation...So... it's something Link to comment Share on other sites More sharing options...
Silvi Posted February 21, 2013 Share Posted February 21, 2013 Thing is, pigmen are afraid of the dark. They wouldn't just stand there until the night comes.Perhaps an alternative could be that after a couple of seconds of running in the same spot, they would switch to a 10 seconds state of running on a random side-wise direction, and then give the go straight home approach another try.They would probably still hit walls, but they would appear to try and circumvent the obstacle. It may not fix the problem, but it wouldn't hurt so much our suspension of disbelief.alternatively:count distance between pig and housecheck if pig is in sight of playerif pig is not in sight of player, despawnif in sight, run vaguely around (with pathfinding), circumvent any walls and despawn.If pig too far away from house, just run in panic in circles. Hilarity ensues. Link to comment Share on other sites More sharing options...
Judas Physicist Posted February 21, 2013 Share Posted February 21, 2013 Or keep track of the path the pigs took and make them follow it revese to get home, make an algorithm to smooth the path so they don't go in circles ? Link to comment Share on other sites More sharing options...
sirmentlegen Posted February 21, 2013 Share Posted February 21, 2013 I using the testing tools made a huge maze from hay walls the pigs could get past some of the walls they got stuck on most of them. Link to comment Share on other sites More sharing options...
Developer Brook Posted February 22, 2013 Developer Share Posted February 22, 2013 (edited) That's nice and all, but can't mobs just give up whatever they try to do after a while?Possibly! But if you'll step behind this curtain with me for a moment, I'll talk a bit about how I might approach deciding which path to take as it were, when implementing a solution.On one hand, pathfinding is a well defined problem with known solutions, it's mostly a matter of finding the time to implement them. It's still technically challenging, but for the most part there are obvious problem parameters, and it's clear when the outcome is correct or not.On the other hand however "give up whatever they try to do after a while" is much less well defined and doesn't have a concrete solution. For example, How long is "a while", and under what circumstances? What does it mean to "give up"? Perhaps most importantly (and least intuitively) is that determining "what they are trying to do" at any given point in the game may not be as straightforward as it seems. There are a lot of smoke and mirrors involved in game development, and what appears to be a simple task like "go home" or "attack that bird" might actually be a collection of different triggers and behaviours, some happening in sequence, and others happening in parallel, many of which are used for multiple things and mixed together to give you the result you see in game. It could be an engineering feat in itself just to pinpoint and categorize what the current goal of the character is, in order to determine what it was that you wanted to give up.We can certainly improve things in this area, and hopefully we'll get a chance to soon. We're always looking at ways to smooth out the edges of the AI behaviour to make the limitations less obvious.But thankfully, if all goes according to plan, I'll be able to spend the next update working on improving the pathfinding so that it is not so inept over long distances, and also doesn't grind your computer to a halt. While I'm at it, I'll also be looking for ways of deceiving you behind the scenes to make the creatures in the game seem smarter than they really are!alternatively:count distance between pig and housecheck if pig is in sight of playerif pig is not in sight of player, despawnif in sight, run vaguely around (with pathfinding), circumvent any walls and despawn.If pig too far away from house, just run in panic in circles. Hilarity ensues.The spiders already use a similar approach to this (as will walrusser). Unfortunately it's not generalized to all creatures (yet?), but it's likely that we will be doing something very similar to this with the pigs too.Now if you'll kindly look into this light... Edited February 22, 2013 by Brook Link to comment Share on other sites More sharing options...
Silvi Posted February 22, 2013 Share Posted February 22, 2013 The spiders already use a similar approach to this (as will walrusser). Unfortunately it's not generalized to all creatures (yet?), but it's likely that we will be doing something very similar to this with the pigs too.Now if you'll kindly look into this light...[ATTACH=CONFIG]3702[/ATTACH]I gazed into the code without lookin into the - uuu pretty collors.Edit: so THATS why sometimes I hear spiders but they disappear with dawn. Interesting... Link to comment Share on other sites More sharing options...
Palpetinus Posted February 22, 2013 Share Posted February 22, 2013 Now if you'll kindly look into this light...[ATTACH=CONFIG]3702[/ATTACH]Wait what? Who are you people? What am i doing here?!Possibly! But if you'll step behind this curtain with me for a moment, I'll talk a bit about how I might approach deciding which path to take as it were, when implementing a solution.On one hand, pathfinding is a well defined problem with known solutions, it's mostly a matter of finding the time to implement them. It's still technically challenging, but for the most part there are obvious problem parameters, and it's clear when the outcome is correct or not.On the other hand however "give up whatever they try to do after a while" is much less well defined and doesn't have a concrete solution. For example, How long is "a while", and under what circumstances? What does it mean to "give up"? Perhaps most importantly (and least intuitively) is that determining "what they are trying to do" at any given point in the game may not be as straightforward as it seems. There is a lot of smoke an mirrors involved in game development, and what appears to be a simple task like "go home" or "attack that bird" might actually be a collection of different triggers and behaviours, some happening in sequence, and others happening in parallel, many of which are used for multiple things and mixed together to give you the result you see in game. It could be an engineering feat in itself just to pinpoint and categorize what the current goal of the character is in order to determine what it was that you wanted to give up.We can certainly improve things in this area, and hopefully we'll get a chance to soon. We're always looking at ways to smooth out the edges of the AI behaviour to make the limitations less obvious.But thankfully, if all goes according to plan, I'll be able to spend the next update working on improving the pathfinding so that it is not so inept over long distances, and also doesn't grind your computer to a halt. While I'm at it, I'll also be looking for ways of deceiving you behind the scenes to make the creatures in the game seem smarter than they really are!Regarding pigs, they could, when not finding a path, check if the obstacle is a wall after some seconds and attack it.It's always so diappointing to see caged pigs. I mean, they are (kinda) intellegent creatures, and they get blocked by some simple straw in their way. Link to comment Share on other sites More sharing options...
fear_town Posted February 22, 2013 Share Posted February 22, 2013 I have no idea what you guys are talking about.. Last thing I remember was driving home.. Now my cars all wonky and up a tree.. Now all I want to know.. Who was driving my car? And who do I bill? Link to comment Share on other sites More sharing options...
Karma Hound Posted February 22, 2013 Share Posted February 22, 2013 I have no idea what you guys are talking about.. Last thing I remember was driving home.. Now my cars all wonky and up a tree.. Now all I want to know.. Who was driving my car? And who do I bill?Obviously the tree for trying to steal your car. Link to comment Share on other sites More sharing options...
Palpetinus Posted February 22, 2013 Share Posted February 22, 2013 Obviously the tree for trying to steal your car.Those damn treeguards..PS: I love how we could locate you by your location and Triangulation (yes, i know it's earth.) Link to comment Share on other sites More sharing options...
Karma Hound Posted February 22, 2013 Share Posted February 22, 2013 Those damn treeguards..PS: I love how we could locate you by your location and Triangulation (yes, i know it's earth.)What makes you so sure I don't live on mars or something? Other then the fact that it would kill me... Link to comment Share on other sites More sharing options...
Palpetinus Posted February 22, 2013 Share Posted February 22, 2013 What makes you so sure I don't live on mars or something? Other then the fact that it would kill me...The fact that earth is the only planet inhabitable by humans in our solar system. (Which is the same as if i just said "the fact that it would kill you" :DBut i was wrong anyways, i forgot that the world exists in 3d. I would need a third location. Link to comment Share on other sites More sharing options...
Karma Hound Posted February 22, 2013 Share Posted February 22, 2013 The fact that earth is the only planet inhabitable by humans in our solar system. (Which is the same as if i just said "the fact that it would kill you" So you're saying you have no proof? I think my work is done here... Link to comment Share on other sites More sharing options...
sirmentlegen Posted February 22, 2013 Share Posted February 22, 2013 Problem: alot of people here are not human. Link to comment Share on other sites More sharing options...
Palpetinus Posted February 22, 2013 Share Posted February 22, 2013 So you're saying you have no proof? I think my work is done here...Yes, i have no proof. I ninja-edited. Read again.- - - Updated - - -Problem: alot of people here are not human.Like, robots like you? Link to comment Share on other sites More sharing options...
Karma Hound Posted February 22, 2013 Share Posted February 22, 2013 Yes, i have no proof. I ninja-edited. Read again.- - - Updated - - -Like, robots like you?Well then, I guess I was wrong? Its not fully proof so I'm correct, I think... I'll just call it a write. Link to comment Share on other sites More sharing options...
Palpetinus Posted February 22, 2013 Share Posted February 22, 2013 Well then, I guess I was wrong? Its not fully proof so I'm correct, I think... I'll just call it a write.Yes, technically you are correct.But the voices in my head say you are a liar and i should kill you. Link to comment Share on other sites More sharing options...
sirmentlegen Posted February 22, 2013 Share Posted February 22, 2013 Like, robots like you?You are also a Popsicle.- - - Updated - - -Yes, technically you are correct.But the voices in my head say you are a liar and i should kill you.Oh ill kill you both, happy? Link to comment Share on other sites More sharing options...
Karma Hound Posted February 22, 2013 Share Posted February 22, 2013 I am afraid those voices are the ones lying and should hence forth be killed. But since they are in your head the only way to kill them is to kill yourself. Link to comment Share on other sites More sharing options...
Palpetinus Posted February 22, 2013 Share Posted February 22, 2013 You are also a Popsicle.- - - Updated - - -Oh ill kill you both, happy?Only if i get bacon first.I am afraid those voices are the ones lying and should hence forth be killed. But since they are in your head the only way to kill them is to kill yourself.Well, i can't kill anybody, since i am just a Popsicle. Link to comment Share on other sites More sharing options...
Karma Hound Posted February 22, 2013 Share Posted February 22, 2013 Oh ill kill you both, happy?Well I'm not sure I'd be feeling happy about anything right about then... Maybe start by killing him first, and if I like it then you can finish it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now