ArrowganceStudios / Vinctus-Arce

Vinctus-Arce is a RPG-Survival game placed in a fantasy world, and more precisely in a deep dungeon
MIT License
1 stars 3 forks source link

Game State implementation, example design. #12

Open Daroslaw opened 9 years ago

Daroslaw commented 9 years ago

That's certainly something we ought to discuss. Current design concept:

  1. Our game scene is composed of Layers stored in a vector in State_Game:
    • base class Layer
    • MapLayer
    • StaticObjectLayer
    • MobileObjectLayer
    • VFXLayer (TBI in distant future)
  2. Each Layer contains data related to itself
    • MapLayer - map (walls, decoration, path meshes)
    • StaticObjectLayer - items and everything lying still on the floor but interactive
    • MobileObjectLayer - NPCs, player, projectiles
    • VFX - particle effects etc.
  3. Key variables/methods in Layers are protected, so they can easily communicate between each other.
  4. All Layers have one static XY coordinates that affect coordinates of objects stored inside them.
  5. Viewport will be made that uses those static coordinates.

If you have any suggestions, put them here.

Key problems related to this design that need solutions:

  1. How the Graphics will be handled and rendered as requested from Layers?
  2. How viewport should work in detail? (needs research)
Sand3r- commented 9 years ago

Personally I think that layers they should be having that depth 'z' parameter, and graphic engine should just handle the order of rendering with regard to it. Also - the GraphicEngine has been prepared in such a way that it stores a pointers to GameObjects, so it can keep track of objects coordinates independently. What it means is that we'll only be in need of requesting new animations when in need (and these requests can be send during the update phase of the layer).

I haven't been thinking of viewport yet, but I'll look into it.