Wartbed:Design/Map format
From Dark Omen Wiki
Types of maps
Principally there are four classes of maps used in tactical war games:
- No terrain, perhaps models (f.i. space games)
- Terrain from height map, no Y-crossings (Myth)
- Terrain from height map and models, no Y-crossings (WH:DO*)
- Terrain from height map and models, Y-crossings (ST:TA)
- Terrain from model(s) only, possible Y-crossings
- * Dark Omen's visible map is a pure model, which however only has a decorative purpose. Internally height maps are used for all game calculations.
WARTBED will support height maps and models for terrain, but to accommodate all types of maps will not use this for game calculations. Instead a node matrix (a set of mutually linked nodes) will represent the arena internally. This serves both height map and pathfinding purposes. Each node will have attributes that affects events and movements in that node.
Internal WARTED Data Structures
A map, or arena or theatre of war, consists of a battleground, which simply is a set of geometry and visuals, and an abstract collection of interconnected spatial nodes that describes where it is possible to go and how to get there. The map management classes are responsible for rendering ONLY, and performs no game logic, which is all strictly kept on the server side.
namespace theatre { //struct Renderable {}; defined somewhere else struct MapEntity {}; struct Terrain : MapEntity {}; struct Prop : MapEntity {}; struct Transparency : MapEntity {}; struct Animation : MapEntity {}; struct Effect : MapEntity {}; typedef pathfinding::NodeMatrix Topology; struct Battleground { vector<MapEntity> all_entities; // Main storage vector<Terrain> terrain; // subset; 1st render group vector<Prop> props; // subset; 2nd render group vector<Animation> animations; // subset; 3rd render group vector<Effect> effects; // subset; 4th render group vector<Transp> transparencies; // subset; 5th render group //skybox, sun, moons, clouds, decorations? }; } class TheatreOfWar { theatre::Topology topology; theatre::Battleground battleground; void renderTroops( ListOfTroops troops ); // or something to this effect };
The TheatreOfWar
class in used by the server-side Battle
class and the client-side Game
classes.
Movement, Pathfinding and Demands on Unit Data
Transcluded from Wartbed:Unit data/Movement capabilities
WARTBED Units movements are defined in a set of abilities, declared per-unit in their script file definitions:
| All units default to the negative on all abilities (i.e. can't move at all). Movement capabilities must explicitly be turned on. Units inherit the capabilities of their superclass (a wood elf inherits the same movement capabilities as the base elf it specialises), and if it shouldn't have an ability, it must be turned off explicitly (set to the negative). |
This design has the effect that different weights can influence the pathfinding calculations, f.i. the weight of difficult terrain will be greatly reduced for an unit with the landwalker movement capability. This is an elegant way of allowing crossing Y-paths and enable distinct differences in movement without requiring specialised pathfinding solutions.