
I'm a professional developer but no professional game developer. Developing games is more like a hobby.
So now my question.
What's the best way to handle gameobjects and their corresponding sceneobjects? Sounds a bit general? I'll give an example.
I'm developing a small 4x space game. Basically a 3D realtime version of Master of Orion or StarDrive for example.
I've got a Galaxy object which holds a list of stars, each star holds a list of planets and each planet holds a list of moons. After trying some things I saw (for example) that I've hold every position twice (in my custom object and in the sceneobject).
And then I began to thought that I need to link my gameobjects to my scenenodes, to save some memory. No one needs a irr::core::vector3df twice.
The result was such a map std::map<irr::scene::ISceneNode*, IGameObject*>.
But then I asked me: "Do I need my custom object graph?". Because I've the same structure in my scenegraph?!
Which is a better solution?
1) Create a gameobject and a custom gameobject graph where each gameobject is linked in some way to a scenenode?
OR
2) Create one custom scenenode for every gameobject?
That's why I ask here. How do you solve this issue?
Any advice?