hiya
I recently was having the same problem... how should things
interact with each other... I still havent got a perfect solution but I now know though a lot more about it...
What im doing in my engine is making virtualy every system derived from a pure virtual class, this alows me to add new
features when ever I want and easily change, or even remove other systems... for example, I have a basic inout class that uses GetAsyncKeyState() and such, and then a direct input class
that uses DikDown()... all I have to do to change witch one I want to use is to point the virtual class at either wich one.
This goes for entitys as well and any other system in the game.
Something I was having trouble with, was "how do you load certain
functionality for the AI and such and know what objects are in the game?"... my solution: Lua! (www.lua.org)
AI, physics, rendering, etc all are and should be seperate form each other, but there still conected by thru the octree system
and the scene manager. My collision system works (or will work) by testing whats around the entitys ina certain radius (collision test1) and then after you get a list of the objects that your close by, then you do a more advanced collision test (ie, BB test) or such, all you need to handle collision responce, is to be able to get the objects velocity, "bouncyness", etc and possable what type of object it is: (ie. a explosion, a NPC)
etc...
Also, what I have is a global octree that holds all other octrres, both static and dynamic, and when an explosion or such occurs, it uses this global octree to get every to get a list of every object in a certain radius, gets the distance to each object and then "applys damage" accordingly.
The most important thing though is (to me anyways), if you really want a powerfull engine that alows for many games to be made using it and be very flexable, you'll want to use a scitping engine! it is almost a must for modern day games. and
it helps so much! I would strongly recommend you read the lua
article (if you havent already), a great read, and really helps you get started.
Ok, now as for AI, what Im planning is to have some basic classes for different object types (flying, driving, walking,
triggered objects, etc) and then extending upon this in the script, like maybe pseudo script
:
if(playerposition is within trigger area)
opendoor(1.2); //1.2, speed it opens at
else
do nothing...
ok, now this is very basic stuff, but implementing this functionality in the engine may be another story.
fewww, im getting tired
well, I hope this helps, and if it confusses you just forget about what you have read
these are meerly my own ideas that
Im going with.
GoodLuck
"your all going to die down here" - Resident Evil
[edited by - yodaman on May 5, 2003 3:40:06 PM]
www.jinx.com www.thebroken.org www.suprnova.org www.mozilla.org