You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The server should store all the building data in the database such as: costs, requirements, generates (how much resources it generates), build time, citizen capacity. If not in database, then in XML config files.
During the initial page request the server should send this to the client, who will use it for the GUI. (server should serve it as a .js file to the client (this is best imo..), parse in HTML, or a seperate AJAX request (probably easier..))
The benefits of this are:
Single point of truth: Not specificing game balance stuff in two places
Security: clientside stuff is SUPER easy to hack
The server needs to know the resource generation and build time information anyway
It also enables us to do a server side check to see if the player has enough resources to build a perticular building, if he/she managed to circumvent the clientside check.
This is the JSON signature of this data (subject to change):
structureTypes: {
"house": {
cost: {
wood: 1,
food: 2
},
requirements: {
culture: 4,
knowledge: 4
},
buildTime: 30000,
generates: {
wood: 1,
metal: 1,
stone: 1,
safety: 1
},
citizenCap: 4
},
The text was updated successfully, but these errors were encountered:
The server should store all the building data in the database such as: costs, requirements, generates (how much resources it generates), build time, citizen capacity. If not in database, then in XML config files.
During the initial page request the server should send this to the client, who will use it for the GUI. (server should serve it as a .js file to the client (this is best imo..), parse in HTML, or a seperate AJAX request (probably easier..))
The benefits of this are:
This is the JSON signature of this data (subject to change):
structureTypes: {
"house": {
cost: {
wood: 1,
food: 2
},
requirements: {
culture: 4,
knowledge: 4
},
buildTime: 30000,
generates: {
wood: 1,
metal: 1,
stone: 1,
safety: 1
},
citizenCap: 4
},
The text was updated successfully, but these errors were encountered: