Hi guys, this is a quite interesting thread.
I wanted to recommend one type of code structure, that is used in one of my current research-project:
This is a structure that has been some time in development and alot of tuning has been done.
Please note that not all the code might benefit from this structure but I hope this can be used as a guideline.
The project this is used in is basically a 3D (Panda3D) Simulation Framework for Social Human Behaviors.
We define all entities in the environment as class derived from Entity. The Entity class holds the essential attributes needed for all the objects in the world, like position, texture, model and more.
Then a very shallow tree is created to group together objects that share some attributes.
E.g. in our project we have:
Entity
|
|----Agent
| |---------Avatar
| |---------NPC
|
|----Prop
For the core of the game, e.g. the connection to the FIFE engine and setup code related to that I suggest a core package:
E.g. in our project the core is:
MainEngine # Which is responsible for all basic operation on the Framework used and has an arcitecture that allows plugging in subSystem into it to handle other operation (editor-interface, physics, perception-system and more).
Regarding having one class per module, I agree to that most of the time, but if used too much it will result in annoying and unreadable import statements.
Just some thought.
