Procedural AI

Started by
4 comments, last by GameMasterXL 18 years, 3 months ago
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?
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.
Progress is born from the opportunity to make mistakes.

My prize winning Connect 4 AI looks one move ahead, can you beat it? @nickstadb
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
a.k.a javabeats at yahoo.ca
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.
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.
a.k.a javabeats at yahoo.ca
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?

This topic is closed to new replies.

Advertisement