Thrive Game Development

Development of the evolution game Thrive.
 
HomeHome  PortalPortal  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  
Welcome new and returning members!
If you're new, read around a bit before you post: the odds are we've already covered your suggestion.
If you want to join the development team, sign up and tell us why.
ADMIN is pleased to note that this marquee has finally been updated.
ADMIN reminds you that the Devblog is REQUIRED reading.
Currently: The Microbe Stage GUI is under heavy development
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Quick Links
Website
/r/thrive
GitHub
FAQs
Wiki
New Posts
Search
 
 

Display results as :
 
Rechercher Advanced Search
Statistics
We have 1675 registered users
The newest registered user is dejo123

Our users have posted a total of 30851 messages in 1411 subjects
Who is online?
In total there are 3 users online :: 0 Registered, 0 Hidden and 3 Guests

None

Most users ever online was 443 on Sun Mar 17, 2013 5:41 pm
Latest topics
» THIS FORUM IS NOW OBSOLETE
by NickTheNick Sat Sep 26, 2015 10:26 pm

» To all the people who come here looking for thrive.
by NickTheNick Sat Sep 26, 2015 10:22 pm

» Build Error Code::Blocks / CMake
by crovea Tue Jul 28, 2015 5:28 pm

» Hello! I can translate in japanese
by tjwhale Thu Jul 02, 2015 7:23 pm

» On Leave (Offline thread)
by NickTheNick Wed Jul 01, 2015 12:20 am

» Devblog #14: A Brave New Forum
by NickTheNick Mon Jun 29, 2015 4:49 am

» Application for Programmer
by crovea Fri Jun 26, 2015 11:14 am

» Re-Reapplication
by The Creator Thu Jun 25, 2015 10:57 pm

» Application (programming)
by crovea Tue Jun 23, 2015 8:00 am

» Achieving Sapience
by MitochondriaBox Sun Jun 21, 2015 7:03 pm

» Microbe Stage GDD
by tjwhale Sat Jun 20, 2015 3:44 pm

» Application for Programmer/ Theorist
by tjwhale Wed Jun 17, 2015 9:56 am

» Application for a 3D Modeler.
by Kaiju4u Wed Jun 10, 2015 11:16 am

» Translator to Serbian here
by Simeartherist Sun Jun 07, 2015 6:36 am

» Presentation
by Othithu Tue Jun 02, 2015 10:38 am

» Application of Sorts
by crovea Sun May 31, 2015 5:06 pm

» want to contribute
by Renzope Sun May 31, 2015 12:58 pm

» Music List Thread (Post New Themes Here)
by Oliveriver Thu May 28, 2015 1:06 pm

» Application: English-Spanish translator
by Renzope Tue May 26, 2015 1:53 pm

» Want to be promoter or project manager
by TheBudderBros Sun May 24, 2015 9:00 pm


Share | 
 

 AI Roam Procedure

View previous topic View next topic Go down 
AuthorMessage
~sciocont
Overall Team Lead


Posts : 3406
Reputation : 138
Join date : 2010-07-06

PostSubject: 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.

_________________
Remember our goals: simplicity, science, and playability. Keep them in mind always.
[OE]|[FAQ]|[Wiki]|[My Blog]
Back to top Go down
View user profile
Djohaal
Learner


Posts : 144
Reputation : 1
Join date : 2010-12-03

PostSubject: 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?
Back to top Go down
View user profile
~sciocont
Overall Team Lead


Posts : 3406
Reputation : 138
Join date : 2010-07-06

PostSubject: 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.

_________________
Remember our goals: simplicity, science, and playability. Keep them in mind always.
[OE]|[FAQ]|[Wiki]|[My Blog]
Back to top Go down
View user profile
Tenebrarum
Society Team Lead


Posts : 1179
Reputation : 32
Join date : 2010-10-01
Age : 23
Location : ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn

PostSubject: 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.
Back to top Go down
View user profile
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...)

PostSubject: 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*?
Back to top Go down
View user profile
~sciocont
Overall Team Lead


Posts : 3406
Reputation : 138
Join date : 2010-07-06

PostSubject: 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.

_________________
Remember our goals: simplicity, science, and playability. Keep them in mind always.
[OE]|[FAQ]|[Wiki]|[My Blog]
Back to top Go down
View user profile
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...)

PostSubject: Re: AI Roam Procedure   Sun Dec 19, 2010 1:48 pm

So navmesh you say?
Back to top Go down
View user profile
~sciocont
Overall Team Lead


Posts : 3406
Reputation : 138
Join date : 2010-07-06

PostSubject: 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.

_________________
Remember our goals: simplicity, science, and playability. Keep them in mind always.
[OE]|[FAQ]|[Wiki]|[My Blog]
Back to top Go down
View user profile
Bashinerox
Programming Team lead


Posts : 238
Reputation : 8
Join date : 2010-07-07
Age : 27
Location : Australia

PostSubject: 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
Back to top Go down
View user profile
Tenebrarum
Society Team Lead


Posts : 1179
Reputation : 32
Join date : 2010-10-01
Age : 23
Location : ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn

PostSubject: 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.
Back to top Go down
View user profile
~sciocont
Overall Team Lead


Posts : 3406
Reputation : 138
Join date : 2010-07-06

PostSubject: 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?

_________________
Remember our goals: simplicity, science, and playability. Keep them in mind always.
[OE]|[FAQ]|[Wiki]|[My Blog]
Back to top Go down
View user profile
Bashinerox
Programming Team lead


Posts : 238
Reputation : 8
Join date : 2010-07-07
Age : 27
Location : Australia

PostSubject: Re: AI Roam Procedure   Tue Dec 21, 2010 7:45 am

A* is a pathfinding algorithm
Back to top Go down
View user profile
~sciocont
Overall Team Lead


Posts : 3406
Reputation : 138
Join date : 2010-07-06

PostSubject: 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?

_________________
Remember our goals: simplicity, science, and playability. Keep them in mind always.
[OE]|[FAQ]|[Wiki]|[My Blog]
Back to top Go down
View user profile
Tenebrarum
Society Team Lead


Posts : 1179
Reputation : 32
Join date : 2010-10-01
Age : 23
Location : ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn

PostSubject: 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.
Back to top Go down
View user profile
~sciocont
Overall Team Lead


Posts : 3406
Reputation : 138
Join date : 2010-07-06

PostSubject: 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.

_________________
Remember our goals: simplicity, science, and playability. Keep them in mind always.
[OE]|[FAQ]|[Wiki]|[My Blog]
Back to top Go down
View user profile
Darkov
Newcomer


Posts : 58
Reputation : 1
Join date : 2010-09-23

PostSubject: 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:
http://img707.imageshack.us/img707/6769/screenshot100nk.png
And this is my algorithm simulation:
http://img339.imageshack.us/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
Back to top Go down
View user profile
~sciocont
Overall Team Lead


Posts : 3406
Reputation : 138
Join date : 2010-07-06

PostSubject: 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?

_________________
Remember our goals: simplicity, science, and playability. Keep them in mind always.
[OE]|[FAQ]|[Wiki]|[My Blog]
Back to top Go down
View user profile
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...)

PostSubject: 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.
Back to top Go down
View user profile
~sciocont
Overall Team Lead


Posts : 3406
Reputation : 138
Join date : 2010-07-06

PostSubject: 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.

_________________
Remember our goals: simplicity, science, and playability. Keep them in mind always.
[OE]|[FAQ]|[Wiki]|[My Blog]
Back to top Go down
View user profile
Darkov
Newcomer


Posts : 58
Reputation : 1
Join date : 2010-09-23

PostSubject: Re: AI Roam Procedure   Sun Jan 02, 2011 7:59 pm

Ok here is my algorithm ran for a longer period of time:
http://img193.imageshack.us/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.
Back to top Go down
View user profile
~sciocont
Overall Team Lead


Posts : 3406
Reputation : 138
Join date : 2010-07-06

PostSubject: Re: AI Roam Procedure   Sun Jan 02, 2011 9:43 pm

seems to be working great

_________________
Remember our goals: simplicity, science, and playability. Keep them in mind always.
[OE]|[FAQ]|[Wiki]|[My Blog]
Back to top Go down
View user profile
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...)

PostSubject: Re: AI Roam Procedure   Mon Jan 03, 2011 5:58 pm

Is there any way to zoom in?
Back to top Go down
View user profile
Darkov
Newcomer


Posts : 58
Reputation : 1
Join date : 2010-09-23

PostSubject: 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.
Back to top Go down
View user profile
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...)

PostSubject: 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.
Back to top Go down
View user profile
Darkov
Newcomer


Posts : 58
Reputation : 1
Join date : 2010-09-23

PostSubject: 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.
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: AI Roam Procedure   Today at 6:05 pm

Back to top Go down
 
AI Roam Procedure
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Thrive Game Development :: Development :: Programming :: Technical Discussion-
Jump to: