zetadin / LogistiX

A browser game about supplying an active front.
Other
0 stars 0 forks source link

Unify game rules into a single json #5

Closed zetadin closed 3 weeks ago

zetadin commented 1 month ago

Types of units, terrains, facilities, etc. all have their own tables now. That is a lot of database requests each new connection.

Merge all such info about game rules into a single json string and store it in a game rule-sets table. Leave a copy of the main rule-set in the repo and have the DB reload it at server start.

zetadin commented 1 month ago

Will need a custom API View and Serializer. As a basis for this can use TerrainTypeListView from #7.

zetadin commented 1 month ago

The RuleSet will store constant properties (or base properties before improvements) of all types of objects that can appear in the game.

Each set of object types will need its own validator.

The core RuleSet will need to be loaded from the file system and injected into the DB at server start.

zetadin commented 3 weeks ago

RuleSet is now read into the DB at server start. The list of RuleSets and their details can also be retrieved through the REST API.

Next:

zetadin commented 3 weeks ago

Closed & merged with pull request #8 .