little ai demo (steering behaviours)

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
antarctica2007
Kobold
Posts: 27
Joined: Sun Feb 11, 2007 11:18 pm
Location: Sunny Scotland

little ai demo (steering behaviours)

Post by antarctica2007 »

Hello there, ive been reading the forum for a while now but this is my first actual post.

This is first reasonable-ish version of a little demo i have been working on, it shows off some of the
steering behaviours as given in the book "Programming Game AI by Example" by Mat Buckland.

i guess there isnt a whole lot to see, but the Flock behaviour looks nice when moving.

Image

I know there are better things out there like Opensteer (and Ogresteer),
but i thought i would have a go anyway as a learning exercise as i try to get to grips with Ogre

http://homepages.nildram.co.uk/~ant2k3/ ... mo_exe.zip

thanks for looking!

[edit] changed topic name to be a little less vague
Last edited by antarctica2007 on Sat Feb 17, 2007 5:35 am, edited 1 time in total.
User avatar
CaseyB
OGRE Contributor
OGRE Contributor
Posts: 1335
Joined: Sun Nov 20, 2005 2:42 pm
Location: Columbus, Ohio
x 3
Contact:

Post by CaseyB »

Very nice! Well done!
Image
Image
User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Post by SpannerMan »

Hi antarctica2007, this looks great, but I cant run it because your missing 'OgreGuiRenderer.dll' (and some other dependencies).
User avatar
IFASS
Gnome
Posts: 387
Joined: Tue Jan 04, 2005 12:07 pm
Location: Netherlands

Post by IFASS »

strange.. works fine for me :)
Nice work!
Image
Ayudo
Halfling
Posts: 88
Joined: Fri Mar 18, 2005 12:25 am
Location: munich, germany
Contact:

Post by Ayudo »

Works here, too - Spannerman maybe you run the exe directly out of the zip?

Very nice work!
Last edited by Ayudo on Wed Feb 14, 2007 10:59 am, edited 1 time in total.
<~Creatine~>
Kobold
Posts: 35
Joined: Sat Sep 23, 2006 12:18 pm

Re: little ai demo

Post by <~Creatine~> »

Nice work, this is great!
Where can I see these AI tutorials?

(-Edited-)
http://www.ai-junkie.com/books/toc_pgaibe.html :oops:
User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Post by SpannerMan »

Oops, my bad, must have unzipped incorrectly. Tried again and works fine.

Nice work, I really like this sort of stuff :)

antarctica2007, do you plan on extending this more? For example, detecting collisions (on a basic level), obstacle avoidance etc. That would be great!
antarctica2007
Kobold
Posts: 27
Joined: Sun Feb 11, 2007 11:18 pm
Location: Sunny Scotland

Post by antarctica2007 »

thanks everyone for your kind words :)

yes im going to keep working on it, the next thing i need to implement is indeed the dynamic obstacle avoidance and wall/terrain avoidance behaviours which i need to convert from the books gdi implementation to Ogre- having had a look at them, it might not be too difficult (i hope)

at present there is some very basic collision detection - its just turned off, ive built this demo out of Walabers excellent OgreNewt demos so hopefully the next step for collision stuff is to use "proper" physics, but i think this would be quite a big task so its at "in the future" priority :)
User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Post by SpannerMan »

Cool :)

Are you planning on releasing the source for this? To be honest I have long been looking at alternatives to OpenSteer, because even though its a good library and does the job, it is not very active in development and the code is messy, and ... well its got lots of strange template mixin type classes that I imagine are quite unnecessary.

One alternative I have been keeping my eye on is OpenSkyNet (a Sourceforge project) but that does not yet have Steering support. And finally Jacmoe has in the past expressed interest in taking OgreSteer and extending/improving it but unfortunately nothing has come of that yet, in fact I havent seem him around these forums for ages.
antarctica2007
Kobold
Posts: 27
Joined: Sun Feb 11, 2007 11:18 pm
Location: Sunny Scotland

Post by antarctica2007 »

yes i will be releasing the source as soon as its a bit more robust and and had a design overhaul as its a bit of a mess just now,

eventually i would like try and make it into some form of useful library to use in other projects, but first i need to sort out some stuff with world/local transformations, its not working right just now which affects several of the behaviours
antarctica2007
Kobold
Posts: 27
Joined: Sun Feb 11, 2007 11:18 pm
Location: Sunny Scotland

Post by antarctica2007 »

minor update:

fixed Wander Behaviour (presently constrained to a circle - sphere to come) & added offset pursuit (doesnt seem quite right yet though?)

Image
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

SpannerMan wrote:One alternative I have been keeping my eye on is OpenSkyNet (a Sourceforge project) but that does not yet have Steering support. And finally Jacmoe has in the past expressed interest in taking OgreSteer and extending/improving it but unfortunately nothing has come of that yet, in fact I havent seem him around these forums for ages.
The rumors of my death have been greatly exaggerated. :)

Moved from crappy flat in the city to a gourgeous house in the contry side! Plugged in my workstation yesterday, and have a lot to catch up on.. I am still keen on making OgreSteer happen. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Kentamanos
Minaton
Posts: 980
Joined: Sat Aug 07, 2004 12:08 am
Location: Dallas, TX

Post by Kentamanos »

jacmoe wrote:The rumors of my death have been greatly exaggerated. :)

Moved from crappy flat in the city to a gourgeous house in the contry side! Plugged in my workstation yesterday, and have a lot to catch up on.. I am still keen on making OgreSteer happen. :wink:
Welcome back jacmoe :).
antarctica2007
Kobold
Posts: 27
Joined: Sun Feb 11, 2007 11:18 pm
Location: Sunny Scotland

Post by antarctica2007 »

minor update:

added obstacle avoidance behaviour - still seems a little flakey though


Jacmoe - i would very much like to see updated versions of OgreSteer, please chain yourself to the workstation untill its ready :D
handcircus
Halfling
Posts: 43
Joined: Wed Apr 05, 2006 8:00 pm
x 2

Post by handcircus »

jacmoe wrote:I am still keen on making OgreSteer happen. :wink:
Probably not of interest as its .net only but I just ported OpenSteer to C# and Mogre - I'll try and post it up somewhere soon. All that mix-in stuff was a bit weird - made me feel a bit dizzy.

This looks fun. that Buckland book is ace! Nice work :)
HandCircus Game Studio - http://www.handcircus.com - Creators of Rolando and Rolando 2
Gf11speed
Goblin
Posts: 242
Joined: Sat Mar 20, 2004 7:53 am
Location: Orlando, FL
x 1
Contact:

Post by Gf11speed »

Very nice! Any plan to release the code?
Coming soon...
User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Post by SpannerMan »

handcircus wrote:All that mix-in stuff was a bit weird - made me feel a bit dizzy.
Im feeling it!

Man, I hope Jacmoe and antarctica2007 get together. That would (almost) be like one of my top geek wet dreams.
Nudel
Halfling
Posts: 79
Joined: Thu Mar 23, 2006 4:14 pm
Location: Vienna

Post by Nudel »

The flock demo is realy nice. Looks like a swarm of fishes. :D
User avatar
cybereality
Hobgoblin
Posts: 563
Joined: Wed Jul 12, 2006 5:40 pm
x 12

Post by cybereality »

Nice demo man. I was working on a flock simulation too (not in ogre though), its pretty cool stuff. I was getting some pretty interesting animation patterns with a 3 creature food chain, rather than just standard predator and prey. I had three different classes of animals, carnivore, herbivore and omnivore. So there was species that was weak and would always run from fights, another that was really aggressive (since they needed to kill other animals to survive) and then a third that could fight, but could randomly opt-out if it wasn't really hungry or in danger. It seemed to make the simulation a lot more interesting then just a game of cat and mice. Also, the weak ones would multiply (procreate) faster so they'd be in bigger numbers and could fight a predator if they were in a flock. Just some food for thought.

// cybereality
agn0stic3000
Gnoblar
Posts: 8
Joined: Fri May 13, 2005 1:44 am
Contact:

Post by agn0stic3000 »

Very cool demo, antarctica2007. It gives me (the OpenSkyNet dude) inspiration to put steering higher on my todo list.

I would be happy to assist in developing a library from this demo source or in assisting w/ OgreSteer.
User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Post by SpannerMan »

agn0stic3000 wrote:Very cool demo, antarctica2007. It gives me (the OpenSkyNet dude) inspiration to put steering higher on my todo list.

I would be happy to assist in developing a library from this demo source or in assisting w/ OgreSteer.
Woohoo!! :D

EDIT:

I dont know if any of you would be interested in it, but there is a young project on SourceForge called OpenABS. Its incomplete, DirectX only and written in C#, but hey, it might be worth a look for some inspiration. For example, it allows 'groups' of boids (steering entities) to be enabled/disabled. Having groups of boids makes life easier, like only allowing certain groups to be affected by certain obstacles, or certain groups to interact/avoid each other.
antarctica2007
Kobold
Posts: 27
Joined: Sun Feb 11, 2007 11:18 pm
Location: Sunny Scotland

Post by antarctica2007 »

not been doing much work this week so no new update yet ;/

im afraid that im not really very good at programming yet to be of use in
any collaborative things yet- but im trying my hardest to get better!

Cyberreality- thats good ideas, i had been planning to do something similar for when i get around to starting my masters, either a preditor /prey simulations based on african savanna type thing or humans vs zombies :)

current demos are a bit dull as they are just single behaviours- things get more interesting when you combine them- hopefully ill get of my arse and do some work this week and finish converting the last 2 behaviours (wall avoidance & hide) then i can do some better demos as well as go back and fix some of the dodgier behaviours and clean up my code to a level where its at least a bit less embarrasing and release the source:)

i should mention that the full source & binaries for the book can be found here:
http://www.wordware.com/files/ai

im unsure of the legal/licensing status of the books code, i read it somewhere and cant seem to find it again and im getting mail returned undelivered when i try to email the author
antarctica2007
Kobold
Posts: 27
Joined: Sun Feb 11, 2007 11:18 pm
Location: Sunny Scotland

Post by antarctica2007 »

another minor update:

added the "hide" behaviour, the selected vehicle will attempt to put an obstacle between itself and a target vehicle

im uncertain how the 2d wall avoidance behaviour should be translated to 3d -in 2d a wall is just a line segement, and in 3d its a trangle really

so do you think it should be able to avoid any arbitary 3d mesh / terrain object by doing ray/triangle intersection tests?
User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Post by SpannerMan »

antarctica2007 wrote:another minor update:

added the "hide" behaviour, the selected vehicle will attempt to put an obstacle between itself and a target vehicle
Cool!
antarctica2007 wrote:im uncertain how the 2d wall avoidance behaviour should be translated to 3d -in 2d a wall is just a line segement, and in 3d its a trangle really

so do you think it should be able to avoid any arbitary 3d mesh / terrain object by doing ray/triangle intersection tests?
Not sure, but I think OpenSteer has a few basic geometric shapes used as its obstacles such as plane, box, rectangle, sphere etc. I don’t know what it does concerning terrain though. (Actually there is a more advanced Steering demo of a vehicle driving round a maze, called MapPoint or something, which uses more advanced collision avoidance calculations)

I would seriously consider not using anything too hardcore when detecting/avoiding collisions with obstacles, the reason being that there are many physics libraries out there that already do this in a performant manner - I would say simple shapes deriving from an objects bounding box or sphere would suffice.
Personally I would prefer a Steering library to A) warn me of potential collisions against simple shapes and B) let me know when a collision has occurred against a simple shape.
Based on this feedback I would use a physics lib to determine the exact collision details, based on the more detailed mesh data as opposed to a simple Bounding Sphere or Box. It means that the Steering code remains fast and leaves finer grain calculations up to the users physics library of choice.

Anyway that’s just my thoughts. I guess I prefer Steering to be more AI than physics, but I guess the boundaries have to become blurred at some point.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

antarctica2007 wrote:Jacmoe - i would very much like to see updated versions of OgreSteer, please chain yourself to the workstation untill its ready :D
agn0stic3000 wrote:I would be happy to assist in developing a library from this demo source or in assisting w/ OgreSteer.
I wouldn't mind one bit if you assisted with OgreSteer! :D

I would be happy to add you as developers, should you be interested.

But first we need to get the basics of the overall design down.

I invite you to architecture and feature brainstorming at the OgreSteer Forum.

I've held off the development of OgreSteer for too long - now it's time to get the cork out. :P
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Post Reply