Skip to content

Buildings data files

pionere edited this page Apr 17, 2019 · 3 revisions

The buildings and their upgrades/businesses/adverts are configured by corresponding json files. Upgrades are described by 'upgrades.json', businesses by 'businesses.json', adverts by 'adverts.json' while buildings by 'buildings.json' in the content/db/buildings folder.

I suggest to use notepad+ or atom to work with json files, or any other game files.

Since upgrades are referenced by businesses (and buildings) and businesses/adverts are referenced by buildings, the Data Fields are listed in a bottom-up order.

Advert Data Fields

General Fields

  • "name": the unique identifier of the advert. Mandatory field.
  • "desc": a free text to describe the advert to make modifiers/bonus visible to the user. Optional field.
  • "price": price of the advert, charged only once. Optional field (default is 0).
  • "upkeep": cost of the advert, charged daily. Optional field (default is 0).
  • "unique": a boolean value. If true, the advert is deactivated at the end of the day. Optional field (default is False).

Modifier Fields

  • "client": raises the minimum number of the expected clients. Optional field (default is 0).
  • "fame": a pair (list) of integers. the daily fame modifier randomized between the two values. Optional field (default is [0, 0]).
  • "reputation": a pair (list) of integers. the daily reputation modifier randomized between the two values. Optional field (default is [0, 0]).

Upgrade Data Fields

General Fields

  • "name": name of the upgrade, used as a label in the game. It is mandatory, but does not have to be unique (although from the users POV, it is preferred)
  • "class": the python class of the upgrade. Must be an existing class defined in the game. Mandatory field.
  • "desc": a free text to describe the upgrade to make modifiers/bonus visible to the user. Optional field.
  • "img": the image of the upgrade. Mandatory field.

'Cost' Fields

  • "materials": a map of item.id/amount pairs. This is used as a base when the building cost of the upgrade is calculated. Optional field.
  • "cost": The base to determine how much 'gold' does it cost to build the upgrade. Optional field.
  • "duration": A pair of integer to determine the way the upgrade is constructed. The first value sets the amount of days required to build the upgrade, while the second is a job_effectiveness modifier applied to the business (subtracted from the workers effectiveness) while the construction is in progress. Optional field.
  • "in_slots": The upgrade occupies the given amount of in_slots of the building when built. Optional field.
  • "ex_slots": The upgrade occupies the given amount of ex_slots of the building when built. Optional field.

Modifier Fields

  • "job_effectiveness_mod": A job_effectiveness modifier to apply to the business (added to the workers effectiveness). Optional field.
  • "client_flow_mod": A modifier to apply to the expected number of client the building is attracting. Optional field.
  • "daily_modifier_mod": A modifier to apply to the daily modifier of the building (thus affecting its inhabitants). Optional field.

Business Data Fields

General Fields

  • "name": name of the business, used as a label in the game. It is mandatory, but does not have to be unique (although from the users POV, it is preferred)
  • "class": the python class of the business. Must be an existing class defined in the game. Mandatory, unique field.
  • "desc": a free text to describe the business to make its purpose clear to the user. Optional field.
  • "img": the image of the business. Mandatory field.

'Cost' Fields

  • "materials": a map of item.id/amount pairs. This is used as a base when the building cost of the building is calculated. Optional field.
  • "cost": The base to determine how much 'gold' does it cost to build the business. Optional field.
  • "duration": A pair of integer to determine the way the business is constructed. The first value sets the amount of days required to build the business, while the second is a job_effectiveness modifier applied to the business (subtracted from the workers effectiveness) while the construction is in progress. Optional field.
  • "in_slots": The business occupies the given amount of in_slots of the building when built. Optional field.
  • "ex_slots": The business occupies the given amount of ex_slots of the building when built. Optional field.

Expansion-'Cost' Fields

  • "exp_cap_materials": a map of item.id/amount pairs. This is used as a base when the building cost to expand the capacity of the business by 1. Optional field.
  • "exp_cap_cost": The base to determine how much 'gold' does it cost to expand the capacity of the business by 1. Optional field.
  • "exp_cap_duration": A pair of integer to determine the way the business is expanded. The first value sets the amount of days required to expand the business by 1, while the second is a job_effectiveness modifier applied to the business (subtracted from the workers effectiveness) while the construction is in progress. Optional field.
  • "exp_cap_in_slots": The business-expansion increments the in_slots requirement of the business by the given amount. Optional field.
  • "exp_cap_ex_slots": The business-expansion increments the ex_slots requirement of the business by the given amount. Optional field.

Other Fields

  • "allowed_upgrades": The list of upgrades (referenced by their class) which can be built in the business. Optional field.

Building Data Fields

General Fields

  • "name": name of the building, used as a label in the game. It is mandatory, but does not have to be unique (although from the users POV, it is preferred)
  • "desc": a free text to describe the building to make its purpose clear to the user. Optional field.
  • "img": the image of the building. Mandatory field.
  • "location": location of the building. Must be one of "Flee Bottom", "Midtown", "Richford". Mandatory field.
  • "price": the base price of the building. Optional field.
  • "in_slots_max": the 'size' of the building. The sum of in_slots of the businesses and upgrades in building must be lower than this value. Optional field (default is 0).
  • "ex_slots_max": the 'size' of the building. The sum of ex_slots of the businesses and upgrades in building must be lower than this value. Optional field (default is 0).
  • "maxdirt": The maximum amount of dirt the building can accumulate. Optional field (default is 1000).

Business-related Fields

  • "maxthreat": The maximum amount of threat the building can have. Optional field (default is 1000).
  • "maxfame": The maximum amount of fame the building can have. Optional field (default is 0).
  • "maxrep": The maximum amount of reputation the building can have. Optional field (default is 0).
  • "fame": The base fame of the building. Optional field (default is 0).
  • "rep": The base reputation of the building. Optional field (default is 0).
  • "tier": Tier (or quality) of the building. Determines the income/expense and many other things while handling the building. Optional field (default is 0).
  • "adverts": A list of adverts (referenced by their names) to use in the building. Optional field (default is [] -> nothing)
  • "allowed_businesses": list of businesses to be built in the building. One entry is either a string referencing a business, or a map/dict referencing a business by its class and overwriting some/all of its fields. Optional field (default is [] -> nothing)
  • "allowed_businesses": list of businesses which are pre-built in the building. One entry is a string referencing a business by its class. Optional field (default is [] -> nothing)
  • "allowed_upgrades": list of upgrades to be built in the building. One entry is a string referencing a upgrade by its class. Optional field (default is [] -> nothing)

Other Fields

  • "inventory": a boolean field to determine, whether the building has an inventory of its own. Optional field (default is false)
  • "rooms": the number of inhabitants the building can have. Optional field (default is 0).
  • "daily_modifier": the daily modifier applied to its inhabitants during ND-calculations. Optional field (default is 0.1).
  • "sections": a map/dict of blocks to 'walk'-through the building. Currently used for the hero's home. Every morning the hero starts from the section named "mc_bedroom". When the user comes back from the city, they start from the section named "entry". The remaining sections can be freely named. Each section is either a map/dict itself, or a string referencing an other section (only one step is followed by the game).

Section Fields

  • "img": the background image to show the section. Mandatory field.
  • "objects": list of overlay objects which are added to the background image. Optional field (default is [] -> nothing)

Section-Object Fields

  • "name": name of the object. Reserved names : "report": a link is created to the ND-report. "gazette": a link is created to the Gazette. "exit": a link is created to go to the city. Otherwise it can be freely chosen / not used.
  • "pos": the relative position of the overlay on the image. Mandatory field.
  • "img": the image of the object to be shown. Mandatory field.
  • "tooltip": the tooltip which is shown to the user when the mouse hovers over the object. Optional field (default nothing)
  • "layer": determines the order how the objects are added to the image. Objects with low order are added first. Optional field (default 0).
  • "location": a reference to an other section (by its name). a link is created so the user can 'walk' to the other section. Optional field (per default it is not set).
  • "dirt": the object is not shown if the dirt of the building is lower than the amount set by this field. Optional field (default 0)
  • "upgrade": the object is not shown if the building does not have the referenced (by its class) upgrade.
  • "business": the object is not shown if the building does not have the referenced (by its class) business.
  • "business_upgrade": the object is not shown if the building does not have the referenced (by 'business.class/upgrade.class') business-upgrade. E.g. "Cleaners/BroomCloset" means the objects is not shown if the Cleaners business of the building does not have a BroomCloset upgrade.