BSG-TUDelft / Utopolis

City building game for TU Delft course (IN4302TU)
2 stars 2 forks source link

Game data configuration #126

Closed spassvogel closed 10 years ago

spassvogel commented 10 years ago

Game data (such as cost of buildings and yielded resources) should be configurable. Perhaps through a configuration XML or JSON.

spassvogel commented 10 years ago

Structure cost, build time, maximum amount of citizens and revenue is now configurable through a json file. See:

src/main/config/structureproperties.json

Note that only the revenue is actually used at this point.

Important

The way it is implemented now, the file is read and parsed at every poll request for every structure (!!). This is obviously a performance issue that has to be resolved later. I suggest this information has to be read during server startup and stored in the application cache or something. For now it works. If anyone wants to do this, be my guest