Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Hack 'n Slash AI


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
3 replies to this topic

#1 BrandonHeat   Members   -  Reputation: 115

Like
0Likes
Like

Posted 02 September 2013 - 09:40 AM

Hi All,

 

I'm am writing ( or trying to, at least ) a simple 2D hack 'n slash RPG in C++ / SDL. Something like Diablo ( or Flare ).

 

I've got most of the stuff down, but I'm quite perplexed about how the AI should behave. It seems that the monsters don't automatically attack you as soon as they spot you, or you would never be able to get the first hit in. They also don't seem to be attacking continuously like you are, and sometimes leave you an opening for a free attack.

 

I can't seem to figure out their patterns, and the random things they do sometimes. Could someone refer me to a related tutorial or explain to me how AI works in a hack 'n slash game. An example pseudocode function will be really helpful as well.

 

Thanks in advance.



Sponsor:

#2 Norman Barrows   Crossbones+   -  Reputation: 2205

Like
0Likes
Like

Posted 02 September 2013 - 06:31 PM


It seems that the monsters don't automatically attack you as soon as they spot you, or you would never be able to get the first hit in. They also don't seem to be attacking continuously like you are, and sometimes leave you an opening for a free attack.
 
I can't seem to figure out their patterns, and the random things they do sometimes. Could someone refer me to a related tutorial or explain to me how AI works in a hack 'n slash game.

 

sounds like they have dummied down the AI or sacrificced realism for game balance purposes

 

if you want to study AI techniques, there's  good overview article here on gamedev. if you're looking for suggestions for an AI type to use, i suggest a hierarchical approach, a decision tree where each node is an "expert system" to choose the sub-node. each "expert system" node can be implemented as state machine, rule based or whatever works best. and of course some has to have written a book by now.


Norm Barrows

Rockland Software Productions

"Building PC games since 1988"

 

rocklandsoftware.net

 


#3 IADaveMark   Moderators   -  Reputation: 2513

Like
0Likes
Like

Posted 03 September 2013 - 12:51 PM


I've got most of the stuff down, but I'm quite perplexed about how the AI should behave. It seems that the monsters don't automatically attack you as soon as they spot you, or you would never be able to get the first hit in. They also don't seem to be attacking continuously like you are, and sometimes leave you an opening for a free attack.

 

Those are all design decisions that have little to do with the actual architecture and programming of AI.

 


Could someone refer me to a related tutorial or explain to me how AI works in a hack 'n slash game. An example pseudocode function will be really helpful as well.

 

There is no "how AI works in a hack 'n slash game" that can be explained. Everyone likely does it different. Best bet is to learn more about how AI is constructed first. Then the applications of it will be clearer.

 

For an overview, there is a sticky post at the top of this forum that has a link to an article I wrote on the different types of AI architecture, what they mean, how they are used, and the pros and cons. That will help.


Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC

Professional consultant on game AI, mathematical modeling, simulation modeling
Co-advisor of the GDC AI Summit
Co-founder of the AI Game Programmers Guild
Author of the book, Behavioral Mathematics for Game AI

Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

#4 BrandonHeat   Members   -  Reputation: 115

Like
0Likes
Like

Posted 04 September 2013 - 03:18 AM

Thanks for your answers. I will read through the posts you've suggested.






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