The main problem with the Buildings page which uses most of the server's resources is the calculation of the resources needed to upgrade a building to a certain level because the formula used to calculate them is:
- Code: Select all
Basic Cost (first level) * Upgrade factor ^ Building Level
Basic cost = the cost for the first level
Upgrade factor = how many times the cost is increased for each level usually it's 1.4 to 2 depending on the building
This formula is applied to 1-3 types of resources for 17 types of buildings, now imagine how long it takes to calculate that many powers if you have level 40-60 buildings.
I got a few solutions to the problem but that would require a change of the design for the buildings page.
1. Map style design:
You will get a terrain map and some building images over it, when you click on the building you will get all the info you need.
It will look something like this (the design will be much better this is just to make an idea about how it would look)

2. Modern style design
You will get a list with the images buildings, after you click on them you will get the info.
It will look something like this:

3. Same design but with a calculate button
Keep the old design and instead of showing the prices directly you will need to click on a calculate button to see the info.
4. Same design but calculate the prices on my PC
Keep the old design and use JavaScript to calculate the prices automatically on my computer. This option would be the best in case you want to keep the same buildings page but it may slow your browser down.
Other suggestions are welcome.

