3D Action Game architecture
Posted: Mon Oct 18, 2010 1:08 pm
I'm working on a 3D adventure game, I have some code already written, but I'm planning on refactoring it in a little while. How should I have everything structured? Right now I have it like this:
A main game manager class contains all subsystems:
Irrlicht, physics manager, input receiver, actor/entity system, event manager,
and sound system.
The physics manager encapsulates creation of rigid bodies, soft bodies, and collision shapes.
The sound systems encapsulates sounds, and whatever other classes I make for it.
The input receiver sends the game event for the key event ("key up" is sent as "player move forward"). It uses the event manager to do this, which is just a simple event system.
And finally the actor manager, contains game actors/entities and updates them each frame. The actors/entities themselves encapsulate their own scene nodes, and sometimes have pointers to a rigid body. They also have a character controller, which is a seperate object that can be attached or detached to, for example: switch from player control to AI.
Does anyone have any suggestions for a better architecture? Or does this sound good enough?
A main game manager class contains all subsystems:
Irrlicht, physics manager, input receiver, actor/entity system, event manager,
and sound system.
The physics manager encapsulates creation of rigid bodies, soft bodies, and collision shapes.
The sound systems encapsulates sounds, and whatever other classes I make for it.
The input receiver sends the game event for the key event ("key up" is sent as "player move forward"). It uses the event manager to do this, which is just a simple event system.
And finally the actor manager, contains game actors/entities and updates them each frame. The actors/entities themselves encapsulate their own scene nodes, and sometimes have pointers to a rigid body. They also have a character controller, which is a seperate object that can be attached or detached to, for example: switch from player control to AI.
Does anyone have any suggestions for a better architecture? Or does this sound good enough?