Original Post
I''m designing and programming a simple 2D top-down view RPG/hybrid game (not tile-based).
I haven''t found any good resources on what kind of class structures to use so I came up with this (see the image below). If anyone could give me their opinion and / or point me to some good tutorials or source code, I would really appreciate it.
The diagram isn''t final, just a sketch really.
WorldObject -- all world objects are subclasses of this.
Zone -- physical and logical zones (water body, village).
Terrain -- grass, snow, water etc. can be defined by zones.
Scenery -- objects that don''t do anything by themselves. rocks, trees etc.
Actors -- objects that can move, have AI, communicate with other objects. NPCs, vehicles, player etc.
All the above classes will of course have many-many subclasses.
Camera -- the camera is a world object because it is positioned inside the world. It will tell the Renderer what to render. Also it may tell any LOD systems what is far from view and what is near.
Simulation -- not really a class, but the diagram is supposed to show that the simulation aspects of the game (movement, collisions, AI) is kept separate from the objects.
WorldObject -- all world objects are subclasses of this.
Zone -- physical and logical zones (water body, village).
Terrain -- grass, snow, water etc. can be defined by zones.
Scenery -- objects that don''t do anything by themselves. rocks, trees etc.
Actors -- objects that can move, have AI, communicate with other objects. NPCs, vehicles, player etc.
All the above classes will of course have many-many subclasses.
Camera -- the camera is a world object because it is positioned inside the world. It will tell the Renderer what to render. Also it may tell any LOD systems what is far from view and what is near.
Simulation -- not really a class, but the diagram is supposed to show that the simulation aspects of the game (movement, collisions, AI) is kept separate from the objects.