• Advertisement
Sign in to follow this  

Procedural AI

This topic is 4436 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am new at AI but can you have procedural AI so like each AI bot acts different to each other like one could be more visious and one might not but one might be a killer and kill his own or one could be more snidy. This could be done by procedures at run-time changing how each AI bot reacts, could this be done?

Share this post


Link to post
Share on other sites
Advertisement
Definitely possible. Implementation will be different depending on what language you're using but if you're using C/C++ then it could be done through function pointers or polymorphism.

Function pointers: Have several functions, one for each type of AI and have them all use the same footprint (e.g. return the same type, accept the same number and types of parameters in the same order). Then use a function pointer for each AI object and make it point to the required function.

Polymorphism: Have an interface class to be the base for AI classes and then implement several classes, one for each type of AI. Then give each AI object a pointer to the base class and simply assign it to point at an object of the desired AI type.

Share this post


Link to post
Share on other sites
Tactically speaking, you have other solutions that might give you good results, however they require much more work from you - Genetic Algorithms that you can use to train your population of enemies, and Full State Machines to determine different types of behaviours. The previous is harder but ensures a *smarter* AI, and the latter is the one I recommend to begin with. Search the articles for resources on both techniques.

Son Of Cain

Share this post


Link to post
Share on other sites
Thanks for the info just thought that procedural programming could uniquely change each AIs behaviour so each AI bot is never the same like in alot of games they seem to be.

Share this post


Link to post
Share on other sites
In my previous post, rather than *smarter*, a Genetic Algorithm can help you achieve a more *natural* AI. In other words, you can specify several types of behaviours for different situations by training the entity's characteristics against them.

Share this post


Link to post
Share on other sites
Nice never realy dealt with AI but i am wanting to get started on it. But even though the AI is natural would that AI act the same for every bot? if so then wouldn't procedures vary that so each one has different bahaviours?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement