| AI Roam Procedure | |
|
|
Author | Message |
---|
~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: AI Roam Procedure Sun Dec 12, 2010 3:47 pm | |
| It was discovered earlier this year that many animals such as sharks and tuna follow a certain mathematical process when roaming around looking for food. This process is called a Levy Flight. I propose that we use levy Flights for all AI "random roam" procedures, since it's realistic and the math is already there. | |
|
| |
Djohaal Learner
Posts : 144 Reputation : 1 Join date : 2010-12-03
| Subject: Re: AI Roam Procedure Sun Dec 12, 2010 3:55 pm | |
| Sure, why not. The simpler the function the better to manage it. Now we need a model for herbivores. Anyone wanna watch cows grazing and do a mathematical function of it? | |
|
| |
~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: AI Roam Procedure Sun Dec 12, 2010 6:53 pm | |
| - Djohaal wrote:
- Sure, why not. The simpler the function the better to manage it. Now we need a model for herbivores. Anyone wanna watch cows grazing and do a mathematical function of it?
A cow would just move from plant to plant. However, if it can't find good food, it should use the same auto-roam as a carnivore. | |
|
| |
Tenebrarum Society Team Lead
Posts : 1179 Reputation : 32 Join date : 2010-10-01 Age : 31 Location : ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
| Subject: Re: AI Roam Procedure Sat Dec 18, 2010 9:29 pm | |
| Sorry, forgot to post on the when I first saw it.
Good work. This will probably need tweaking to fit our system, but IRL equations are always loverly.
So, now I'm wondering: is there a similer equation for pathfinding? It's always been an absolute belgium to program in games and failing to get it just right can really break the immersion. I think we may need multiple pathfinding equations though, to represent different levels of intelligence. | |
|
| |
Commander Keen Industrial Team Lead
Posts : 1123 Reputation : 36 Join date : 2010-07-23 Location : Czech Republic (not that anyone would know where it is...)
| Subject: Re: AI Roam Procedure Sun Dec 19, 2010 6:50 am | |
| Implementing multiple pathfinding algorithms is pointless, using one and limiting it for dumb creatures would be enough. Now, what algorithm will be used? The old fashioned A*? | |
|
| |
~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: AI Roam Procedure Sun Dec 19, 2010 10:30 am | |
| I think for pathfinding we can set up a goal and a starting point, then set up vertices in between. The intelligence/senses of the creature that will help it find the most efficient path would determine h ow many vertices and where they are. This vertice method can be easily adjusted on the fly for moving targets. | |
|
| |
Commander Keen Industrial Team Lead
Posts : 1123 Reputation : 36 Join date : 2010-07-23 Location : Czech Republic (not that anyone would know where it is...)
| Subject: Re: AI Roam Procedure Sun Dec 19, 2010 1:48 pm | |
| | |
|
| |
~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: AI Roam Procedure Sun Dec 19, 2010 2:07 pm | |
| - Commander Keen wrote:
- So navmesh you say?
I don't know the technical term, but sure. | |
|
| |
Bashinerox Programming Team lead
Posts : 238 Reputation : 8 Join date : 2010-07-07 Age : 35 Location : Australia
| Subject: Re: AI Roam Procedure Mon Dec 20, 2010 2:41 am | |
| - ~sciocont wrote:
- I think for pathfinding we can set up a goal and a starting point, then set up vertices in between. The intelligence/senses of the creature that will help it find the most efficient path would determine h ow many vertices and where they are. This
A* If you don't want creatures to know the correct path all the time, you use an inadmissable heuristic on purpose.
Last edited by Bashinerox on Tue Dec 21, 2010 7:43 am; edited 1 time in total | |
|
| |
Tenebrarum Society Team Lead
Posts : 1179 Reputation : 32 Join date : 2010-10-01 Age : 31 Location : ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
| Subject: Re: AI Roam Procedure Mon Dec 20, 2010 5:37 pm | |
| - Bashinerox wrote:
- If you don't want creatures to know the correct path all the time, you use an inadmissable heuristic on purpose.
Sound's like a good plan, though we'll need to get good pathfinding up in the first place. Nothing would be more frustrating than having your creature with perfect sense in it's natural environment running into walls. We also need to make sure that creatures give up, as in, not persistantly try to walk through a cliff face when you tell him to. We must make sure that even those with the worst pathfinding don't dash the immersion of the experience. | |
|
| |
~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: AI Roam Procedure Mon Dec 20, 2010 6:45 pm | |
| This brings up an interesting point- how are our creatures really going to be represented through movement? In most games, everything with legs is really just like a box with the animation of walking. How will our procedural gaits be, comparatively? | |
|
| |
Bashinerox Programming Team lead
Posts : 238 Reputation : 8 Join date : 2010-07-07 Age : 35 Location : Australia
| Subject: Re: AI Roam Procedure Tue Dec 21, 2010 7:45 am | |
| A* is a pathfinding algorithm | |
|
| |
~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: AI Roam Procedure Tue Dec 21, 2010 11:08 am | |
| - Bashinerox wrote:
- A* is a pathfinding algorithm
So you're saying we should use it for basic pathfinding? It seems pretty straightforward, but can we extrapolate it into 3 dimensions for swimming/flying? We would just need to use a 3d tesselation (probably a cube) instead of a 2D one, right? Basics of A* Edit: Just got a great idea while reading that page. Could we, instead of using straight moves between nodes, connect those nodes with a spline curve? | |
|
| |
Tenebrarum Society Team Lead
Posts : 1179 Reputation : 32 Join date : 2010-10-01 Age : 31 Location : ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
| Subject: Re: AI Roam Procedure Tue Dec 21, 2010 4:54 pm | |
| - ~sciocont wrote:
- Edit: Just got a great idea while reading that page. Could we, instead of using straight moves between nodes, connect those nodes with a spline curve?
Oh God please. I'm so terribly sick of units in games getting awkward graphical glitches because there movement is straight line based, instead of the more natural curve. | |
|
| |
~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: AI Roam Procedure Tue Dec 21, 2010 5:01 pm | |
| - Tenebrarum wrote:
- ~sciocont wrote:
- Edit: Just got a great idea while reading that page. Could we, instead of using straight moves between nodes, connect those nodes with a spline curve?
Oh God please. I'm so terribly sick of units in games getting awkward graphical glitches because there movement is straight line based, instead of the more natural curve. The question is if the spline will be too complex, which it shouldn't be. Also, if you have a curve, it may be drawn through obstacles that the straight line missed. | |
|
| |
Darkov Newcomer
Posts : 58 Reputation : 1 Join date : 2010-09-23
| Subject: Re: AI Roam Procedure Sun Jan 02, 2011 11:13 am | |
| Nice find! I made a small program to see exactly how will this work and from what i observed, this represents the roaming patterns of some animals over a very large amount of days(over 5,700 days - wiki), which, in my opinion, will be hard to use for that matter. Then i tested another "algorithm" i created for animal roaming, that works based on the facing of the animal. The animal will always go forward(at its facing), but its facing will change. Facing = direction. That way it has a smoother direction change and it looks more realistic to me. This can be used as in real time roaming. This is the Levy flight simulation: https://2img.net/r/ihimizer/img707/6769/screenshot100nk.png And this is my algorithm simulation: https://2img.net/r/ihimizer/img339/9689/screenshot101y.png This is the program, so you can test it too: http://www.mediafire.com/?9k1d68eoq63h9nt SPACE - restarts current simulation LEFT ARROW - start a new Levy flight simulation RIGHT ARROW - start my algorithm | |
|
| |
~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: AI Roam Procedure Sun Jan 02, 2011 12:06 pm | |
| Nice work! Also, congrats on 42 posts. The levy flight looks good, and the second algorithm looks excellent. Could you run the second one for a little longer to see if it generates more levy-like bundles? | |
|
| |
Commander Keen Industrial Team Lead
Posts : 1123 Reputation : 36 Join date : 2010-07-23 Location : Czech Republic (not that anyone would know where it is...)
| Subject: Re: AI Roam Procedure Sun Jan 02, 2011 2:21 pm | |
| While your algorithm looks great on paper like this, but I fear ingame it might look weird for animals not moving in fully 3d environment (ie land animals). It could be great for aerial and water animals, though.
Land animals would often stop, scanning the environment, and then go in a random direction. While this looks weird on map trails like yours, it would give a lot more sense ingame. | |
|
| |
~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: AI Roam Procedure Sun Jan 02, 2011 4:43 pm | |
| - Commander Keen wrote:
- While your algorithm looks great on paper like this, but I fear ingame it might look weird for animals not moving in fully 3d environment (ie land animals). It could be great for aerial and water animals, though.
Land animals would often stop, scanning the environment, and then go in a random direction. While this looks weird on map trails like yours, it would give a lot more sense ingame. he can simply add in "stops" in the algorithm. Just put one in at random intervals of points. | |
|
| |
Darkov Newcomer
Posts : 58 Reputation : 1 Join date : 2010-09-23
| Subject: Re: AI Roam Procedure Sun Jan 02, 2011 7:59 pm | |
| Ok here is my algorithm ran for a longer period of time: https://2img.net/r/ihimizer/img193/5160/screenshot102kj.png I also added the random stop to my algorithm, to see it in action, download the new version of the program: http://www.mediafire.com/?qjreha63516fe0q And press the DOWN ARROW key to start the new simulation. The other hot keys still do the same things. And now the program wont start to lag and eventually crash if you run it for too long. | |
|
| |
~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: AI Roam Procedure Sun Jan 02, 2011 9:43 pm | |
| seems to be working great
| |
|
| |
Commander Keen Industrial Team Lead
Posts : 1123 Reputation : 36 Join date : 2010-07-23 Location : Czech Republic (not that anyone would know where it is...)
| Subject: Re: AI Roam Procedure Mon Jan 03, 2011 5:58 pm | |
| Is there any way to zoom in? | |
|
| |
Darkov Newcomer
Posts : 58 Reputation : 1 Join date : 2010-09-23
| Subject: Re: AI Roam Procedure Tue Jan 04, 2011 6:09 am | |
| there is a way in this version now: http://www.mediafire.com/?k5ch22e212589to
Press CTRL to zoom in and zoom out. When you zoom in use the AWSD keys on your keyboard to move the camera. You can't zoom in the Levy Flight simulation, because its already zoomed. | |
|
| |
Commander Keen Industrial Team Lead
Posts : 1123 Reputation : 36 Join date : 2010-07-23 Location : Czech Republic (not that anyone would know where it is...)
| Subject: Re: AI Roam Procedure Tue Jan 04, 2011 7:37 pm | |
| Would it be possible to change the Levy flight to this?
http://en.wikipedia.org/wiki/File:LevyFlight.svg
From the Wikipedia page it seems like it's only changing a few variables. | |
|
| |
Darkov Newcomer
Posts : 58 Reputation : 1 Join date : 2010-09-23
| Subject: Re: AI Roam Procedure Tue Jan 04, 2011 8:16 pm | |
| In my simulation, the variables are randomized each step, in the wiki, they are always the same. its just a matter of randomness. | |
|
| |
Sponsored content
| Subject: Re: AI Roam Procedure | |
| |
|
| |
| AI Roam Procedure | |
|