Skip to content

Commit e68e1df

Browse files
committed
more sphinx (mostly concepts)
1 parent 2b57f51 commit e68e1df

File tree

12 files changed

+157
-64
lines changed

12 files changed

+157
-64
lines changed

sphinx/Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

sphinx/live.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
sphinx-autobuild source build

sphinx/make.bat

Lines changed: 0 additions & 35 deletions
This file was deleted.

sphinx/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
sphinx-autobuild
12
sphinx_design
3+
sphinx-copybutton
4+
sphinx-inline-tabs
25
furo

sphinx/source/_static/ecs.svg

Lines changed: 39 additions & 0 deletions
Loading

sphinx/source/concepts/clusters.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

sphinx/source/concepts/ecs.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1-
ECS
2-
===
1+
Entities (ECS)
2+
==============
3+
4+
.. epigraph::
5+
6+
.. image:: /_static/ecs.svg
7+
:alt: ECS Diagram from Wikipedia
8+
:height: 100pt
9+
:align: right
10+
11+
"Entity–component–system (ECS) is a software architectural pattern mostly used in video game development for the representation of game world objects. An ECS comprises entities composed from components of data, with systems which operate on the components.
12+
13+
ECS follows the principle of composition over inheritance, meaning that every entity is defined not by a type hierarchy, but by the components that are associated with it. Systems act globally over all entities which have the required components. "
14+
15+
— `Wikipedia - Entity Component System <https://en.wikipedia.org/wiki/Entity_component_system>`_

sphinx/source/concepts/index.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ General Concepts
33
Glossary and explanation of concepts used throughout this documentation and in the game.
44

55
.. toctree::
6-
tiles
7-
clusters
6+
map
87
prototypes
98
ecs

sphinx/source/concepts/map.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Map
2+
===
3+
Map is uniquely identified by its GUID.
4+
It will differ even for each version of the same map.
5+
6+
Tiles
7+
-----
8+
The map uses discrete tiles representation (similar to chess), as opposed to continuous space.
9+
10+
Tiles are indexed `0 .. N-1`.
11+
12+
Data available for each tile:
13+
14+
- Position - 3D coordinates
15+
- Up - 3D vector - direction opposite of local gravity
16+
- Neighbors - array of indices of neighboring tiles
17+
- Cluster - index of the cluster this tile belongs to
18+
- Terrain - index of the terrain at this tile
19+
20+
Clusters
21+
--------
22+
Clusters are aggregations of tiles into smaller connected groups.
23+
It is intended primarily for performance optimizations.
24+
All tiles in one cluster have the same terrain.
25+
26+
Clusters are indexed `0 .. M-1`.
27+
28+
Data available for each cluster:
29+
30+
- Neighbors - array of indices of neighboring clusters
31+
- Tile - index of the center-most tile in this cluster
32+
33+
Overview
34+
--------
35+
Automatically updated ids of entities present on each tile.
36+
This is used for performance optimization.
37+
38+
Entities with larger radius will be present in all tiles that they cover, not just the center.
39+
40+
Additionally, bit-flags are available for each tile, with different bits denoting different types of entities present on the tile.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,55 @@
11
Prototypes
22
==========
3+
Prototypes are data definitions used for everything in the game.
4+
They are loaded with the map, and are immutable.
5+
6+
Each prototype is identified by its id, which is a hash of its name (the full path in the source files).
7+
8+
Resource Prototype
9+
------------------
10+
Defines properties of a resource - aka a crate/pallet/barrel that would exist in the world.
11+
12+
Recipe Prototype
13+
----------------
14+
Defines a transformation of resources, units, and upgrades.
15+
It contains amounts and ids of inputs and outputs.
16+
Also defines the duration of the recipe.
17+
Recipes are processed in buildings/units.
18+
19+
Some recipes have a *place-over* requirement, which is an id of a unit, that the building must be placed on, in order for the recipe to be available.
20+
21+
Construction Prototype
22+
----------------------
23+
Constructions are similar to recipes, but are manually placed into the world by the player.
24+
It contains amounts of input resources, and has exactly one output unit/building.
25+
26+
Unit Prototype
27+
--------------
28+
Both buildings and units are treated as units in the game.
29+
Some neutral objects, such as trees, rocks, ore deposits, etc. are all also units.
30+
31+
The prototype contains combat related properties, movement (speeds), building radius, a list of available recipes, and a list of applicable upgrades.
32+
Additionally, there are several boolean properties, which modify behavior or requirements of the unit/building.
33+
34+
Upgrade Prototype
35+
-----------------
36+
Upgrades improve combat or economy of specified units/buildings of the same player.
37+
The upgrade itself defines the improvements that it will apply, and units have a list of upgrades that may be applied to them.
38+
39+
The upgrades are temporary, and will disappear after specified duration.
40+
Multiple same upgrades stack together, up to a specified limit.
41+
42+
Race Prototype
43+
--------------
44+
Each player selects one race that they play as.
45+
The race defines their starting resources and units, and a list of available constructions.
46+
47+
Note that neither resources, recipes, units, or upgrades are inherently associated with any particular race.
48+
There are no restrictions on units that the player may control, if they get hold of them.
49+
50+
Tags
51+
----
52+
All prototypes may have associated some tags with them.
53+
Tags are short strings (mapped to unique ids), that are provided by the game/map/mods to help programs understand the nuances of that particular prototype.
54+
Tags are *not* used by the game, except by the built-in AI/bot, which uses tags to alter behavior of some units.
55+
Tags may be used by both Bots and Scripts.

0 commit comments

Comments
 (0)