Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Scout/Search AI [DBP]

Author
Message
lower logic
18
Years of Service
User Offline
Joined: 15th Jun 2006
Location:
Posted: 29th Oct 2006 02:16 Edited at: 29th Oct 2006 02:23
This snippet shows how to make AI agents search a map in a hide&seek-like or RTS scouting-like behavior. While this example just shows it working on tiles, the algorithm could easily be applied to FPS games to make the AI characters search the level, looking for the player in a smart way. I plan to use something like this for the scouting AI in a RTS I'm making.


White tiles are the areas of the map the AI can see or has recently seen. It's sort of like the AI's memory. Tiles slowly fade to black, making the AI want to re-search previous places on the map after a while.




Edit, another idea: If you combine this with A*, it could be used if you want a pet/animal AI character to find his way out of a maze, but want him to have to search around the maze and look for a way out. It would look like he's trying the dead ends and remembering where he's already searched.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Oct 2006 02:37
That's really quite interesting. Does any bot go to the dark bits or only the bot that had last gone over it?

lower logic
18
Years of Service
User Offline
Joined: 15th Jun 2006
Location:
Posted: 29th Oct 2006 02:46
Usually it's pretty random, any bot can search anywhere, but they all update the same grid so they appear to work together to search the map.

After letting it run for a while, a sort of swarm ai emerged (even though that's a differnt snippet). They formed like one big clump and the way they searched the map fell into a strict Z-shaped-like pattern that I did not program, which is both cool and unexpected.
Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 31st Oct 2006 20:58
Impressive work Lower Logic.

I may use this as well for my RTS. I can already see that you'll use it as part of an 'Explore' command for units in your RTS.

Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 31st Oct 2006 20:59
Impressive work Lower Logic.

I may use this as well for my RTS. I can already see that you'll use it as part of an 'Explore' command for units in your RTS (or something similar.

Login to post a reply

Server time is: 2024-11-22 23:44:29
Your offset time is: 2024-11-22 23:44:29