Best way to organize entities in a game?

后端 未结 5 1959
暗喜
暗喜 2021-01-30 15:24

Let\'s say I\'m creating an OpenGL game in C++ that will have many objects created (enemies, player characters, items, etc.). I\'m wondering the best way to organize these since

5条回答
  •  囚心锁ツ
    2021-01-30 15:34

    Is there a better way? How to commercial games like HL2 handle this? I imagine there must be some module etc that keeps track of all the objects.

    Commercial 3D games use a variation on the Scene Graph. An object hierarchy like the one Adam describes is placed in what is usually a tree structure. To render or manipulate objects, you simply walk the tree.

    Several books discuss this, and the best I've found are 3D Game Engine Design and Architecture, both by David Eberly.

提交回复
热议问题