Advertisement

What's the Structure of General AI Engine?

Started by July 15, 2009 04:26 AM
10 comments, last by HostileExpanse 15 years, 4 months ago
Hi all, I want to know what's the general structure (or class) of an AI Engine. It'll be nice if the illustration be on PAC-MAN game Thanks in advance :)
A decent-looking chapter of a book is the first link on this page: http://lmgtfy.com/
Advertisement
I have that book, and it is indeed a great introduction to all areas of AI. It's a big old book, coming in at nearly 1000 pages, but it's well-written, easy-to-follow, and it covers just about all the subjects you'd possibly hope for, while still managing to go into detail and offer example code.
I would argue that there is no such thing as an "AI Engine" but rather just very specific code embedded in the class of the agent. Now that's over-simplifying a bit, but the point is that there isn't an "AI Engine" like there is a "rendering engine" or "physics engine" that all other world objects make calls against.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
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!"

Thanks all for reply.
@InnocuousFox: I got your point you mean that there's no actual AI Engine but rather AI Code in embedded with the AI agents classes
Quote: Original post by ZiKaS
Thanks all for reply.
@InnocuousFox: I got your point you mean that there's no actual AI Engine but rather AI Code in embedded with the AI agents classes

That is correct. At that point, simply building one bit of code at a time is the preferred method. For example, the inclusion an "IF" statement is building your AI. Certainly there are design patterns that you would want to follow.

A Finite State Machine (FSM) is the best place to start when learning how to design and code AI. For that, you may want to look at Steve Rabin's "Finite State Machine Class" in AI Game Programming Wisdom. It was really simple to drop into your code and use. There is a 2nd article near that where he extends it with messaging between objects so that a bullet could inform a body that "I just hit you", etc.

Other good books are Brian Schwab's "AI Game Engine Programming" and Mat Buckland's "Programming Game AI by Example". Mat's especially is a favorite and is very well-rounded.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
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!"

Advertisement
Reusable things might be: FSM, pathfinding navigation graph data structures and algorithms and Steering behaviours.
Steering behaviours depend however on locomotion model.
I am trying to keep them separate from locomotion models, and I guess I have achieved a very-small-humble result in a demo I am making slowly-slowly during my spare time (if somebody is interested I will post sources, a feedback would be a lot appreciated).
Maybe behaviour trees could be quite reusable but I cannot tell you the proper data structure that are reusable and those that are not.
About steering behaviour I used normalised left, up and forward local vector to decouple the agent from the graphic engine.
It consumes a little bit more CPU but keeps them separate.
So I guess that it is emerging a set of data structures and procedures rather than a real time engine. Once packed together you would put those in a real time update function.
One thing to be engineered could be a multi-gameloop reasoning, that is something that allow an AI process to run through many game loops in order to keep CPU available for physics or rendering.

Just sparse thought... some times meaningless :-P
Thanks InnocuousFox for your reply
@Thunder0ne
What's ur AI code about (FPS, RTS Games, Role Playing..)
It's welcomed if you posted it it will help so much :)

Thanks..
wow that is an amazing link, first ever i've seen - where in the world did you run across it??
the link being http://lmgtfy.com/

This topic is closed to new replies.

Advertisement