Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


My Take on Monster AI (Part 3 of 5)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 phi6   Members   -  Reputation: 267

Like
3Likes
Like

Posted 23 May 2013 - 09:43 AM

Interactive demos for all parts are at the usual place:
 
http://tinykeep.com/ai
 
 
Part 3: Hungry Skeletons
 
YouTube Video:
 

 
Today I'm going to talk about some behaviours that are specific to the Skeleton monster. The idea is that while Skeletons are not chasing or pursuing the player, they are always hungry and will seek out corpses to consume. Eating helps the Skeleton regain lost health, and also if left long enough, consumed corpses turn into more undead Skeletons! We build upon all of the behaviours discussed in the previous articles to do this.
 
The procedure is as follows:
 
1. The Skeleton is in non-alert mode (character is not in line of sight, and there are no detected breadcrumbs) and so it proceeds to patrolling the waypoints using simple A* pathfinding as before. If while in patrol mode the Skeleton detects a corpse it will set the corpse as its destination and proceed to run directly to it using the Seek Steering Behaviour.
 
2. If a player is detected, the Skeleton will switch out of this mode and chase the player instead in full alert mode. Skeletons ALWAYS prioritise the player over eating corpses.
 
3. When the Skeleton reaches the corpse, it will begin eating it. The eaten variable for this corpse increments every frame. While eating, the Skeleton's field of view is reduced to 45 degrees instead of 90, this is to give the impression that the Skeletons are busy eating to notice much else. Also, it is still in non-alert mode and will not smell any breadcrumbs. This opens up gameplay opportunities such as sneaking around a group of Skeletons who are busy munching!
 
4. When the eaten variable exceeds a certain amount (ie. 200) the corpse is completely consumed. At this point some corpses (such as Orc corpses) turn into more Skeletons! This has the effect of a large cluster of corpses quickly propagating into multiple Skeletons, so the player has to make sure this doesn't happen!
 
5. At that's it, nice and simple behaviour made possible by combining and tweaking the previous behaviours in a certain way. This is the beauty of behaviour trees, it is quick and easy to create new meta-behaviours by combining the building blocks of the previous ones.
 
Read more about the benefits of Behaviour Trees at AiGameDev:
 
http://aigamedev.com/open/article/bt-overview/
 
 
The Next Few Days
 
As some of you may already know - my game TinyKeep is on Kickstarter and there are currently only 7 days left of funding to go! If you enjoy reading these kinds of technical articles, please consider pledging so I can continue active development of the game. Currently I have accrued almost half the amount I need, but as Kickstarter is all or nothing I need to make the full £22k or I lose all my pledges so far. If I get funded, I plan to keep on releasing articles on all aspects of the game's development, including AI but also game mechanics, procedural generation, multiplayer networking, 3D graphics & animation, performance optimization, workflow - and everything in between! So please help if you can!
 
Have a look at our project for more information:
 
TinyKeep - A 3D Multiplayer Dungeon Crawler for Windows/Mac
http://www.kickstarter.com/projects/phidinh/tinykeep


TinyKeep - A 3D Multiplayer Dungeon Crawler with focus on intelligent monster AI

Currently Kickstarting: http://www.kickstarter.com/projects/phidinh/tinykeep

 

http://tinykeep.com


Sponsor:

#2 Ludus   Members   -  Reputation: 970

Like
0Likes
Like

Posted 23 May 2013 - 03:46 PM

Really great work so far.

 

Perhaps you should add a "sound" aspect to this system. Every action (such as taking a step or attacking) should emit a sound that can be heard by enemies, who will then become aware of the player's position even if they can't see the player. The sounds of actions could vary in the distance they travel - quiet actions such as slowly walking would emit very little sound, while the sounds while fighting in combat would travel quite far. Just a thought on how to make the enemies more intelligent while introducing more stealth mechanics.



#3 phi6   Members   -  Reputation: 267

Like
0Likes
Like

Posted 25 May 2013 - 11:35 AM

That sounds like a really good idea, thanks!


TinyKeep - A 3D Multiplayer Dungeon Crawler with focus on intelligent monster AI

Currently Kickstarting: http://www.kickstarter.com/projects/phidinh/tinykeep

 

http://tinykeep.com





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS