Archived

This topic is now archived and is closed to further replies.

no one

Game AI vs Engine core...

Recommended Posts

Hiya I went over my designs last night and realized that I had a few issues between what should be handled thru game ai and what should be made as a derived object class. This is mainly because I want to use lua for scripting ai and such. This problem then brings up the issue of phyisc and rendering engine calls in the game ai. Say I made a class call CVehicle which is derived from CEntity which is a engine core class. This class could have things in it to work with the physics engine to simulate a vehicle, but then I would need to make a seperate AI class which handles vehicle behavior and such. I think I could simply cancel the engine class CVehicle out and use the game AI class only instead. I still wonder if though I should handle the physics and rendering calls thru the AI vehicle functions? Thanks a lot for any feedback.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It all depends on the interaction required between the distinct parts. You could have 3 distinct classes there

AI Driver
Physics for Car model
Renderer for model of car.

In a sample situation AI will update the physics and the physics will update the car model (with position and so on).

If you have a heavyweight physics engine then you will need a distinct physics handler (or entire subsystem). But if you have a very simple (eg 2d ) physics it could easily be added to the AI or the render side.

Separating the distinct elements is the best way to go in my opinion.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
call me dumb but id do this:
have a base class for all AI, a base class for all physics, etc for models etc etc.then have the engine base class contain base class arrays so you can then derive what you need to for specific cases, and hold them in the seperate arrays.
so youd have:
AI->driver AI ->space ship
AI->monster AI
Physics->walking
Physics->vehicle->car
Models->player
Models->world geometry->grass
and an engine class to wrap them all into one thing.
maybe im dumb though.

Share this post


Link to post
Share on other sites
Cool thanks alot.
I think, what I will do is to have the engine handle the object
base class and a few derived base classes such as CMesh CStaticMesh, CLight etc. These classes then can be used along
with the ai base class to derive game object classes off of.
This will probably be pretty tricky to get right, but it seems
like the best way I could do it.

Thanks alot.

Share this post


Link to post
Share on other sites