Forums / DQ: Horizons / General Discussions / Maintenance
Posted ByMessage
Maverick
[ Posts : 1331 ]
[Post Date: 07-Jul-2008 14:07]

Currently I'm working on maintenance. Each building has its maintenance cost and everything its quite clear for them. For ships maintenance is a percentage of its cost. Currently i have following values:

Freighter - 0%
Transports - 1%
Colony Ship - 3%
Corvette - 1.25%
Frigate - 1.25%
Destroyer - 1%
Cruiser - 1%
Battleship - 1%
Titan - 0.75%

Now, when your treasure is empty and you have a negative income we should do something. First we will scrap ships. If no ships available then we should destroy some buildings and here is the main issue. What buildings should we destroy first? On which planet? It's not so trivial to find a good algorithm.

A solution for this situation would be to stop all production on planets until empire treasure has something in it. Another solution would be destroying buildings randomly first military one and then rest of them the most expensive first.

Which way is better, I don't know. Still thinking...

Any comments are welcome
Emperor L
[ Posts : 1237 ]
[Post Date: 07-Jul-2008 14:18]

Quote
Now, when your treasure is empty and you have a negative income we should do something. First we will scrap ships.


Hmm, maybe if planets have recycling center some of the scrap (maybe 50%) should be turned to money, so you get 50% of the value of the ship added to treasury when they get scrapped, this stops endless loop of destruction...or something like this...

Quote
If no ships available then we should destroy some buildings and here is the main issue. What buildings should we destroy first? On which planet? It's not so trivial to find a good algorithm.


I think building that cost most to maintain should go first, but not if it makes alot of income.

Each building can have a maintenance value minus income generated, then destroy in order of highest maintenance.

So, if Building A costs 10 income, but produces 3 income, 10 - 3 = 7 maintenance.

If builing B costs 8 maintenance, but makes no income, then 8 - 0 = 8 maintenance.

8 is greater than 7 so destroy building B.

For buildings that make food/production. The money value of this production can be used to calculate the cost.

So if 4 food = 1 income, then each food can be worth 0.25 income, so a building costing 4 maintanance, and making 6 food will be 4 - (6*0.25). = 2.5 maintenance.


This message was edited by Emperor L
Maverick
[ Posts : 1331 ]
[Post Date: 07-Jul-2008 14:34]

Quote
Quote
Now, when your treasure is empty and you have a negative income we should do something. First we will scrap ships.


Hmm, maybe if planets have recycling center some of the scrap (maybe 50%) should be turned to money, so you get 50% of the value of the ship added to treasury when they get scrapped, this stops endless loop of destruction...or something like this...


But a ship/fleet could be anywhere in the galaxy. So "scrapping" is more of abandoning them.

Quote
Quote
If no ships available then we should destroy some buildings and here is the main issue. What buildings should we destroy first? On which planet? It's not so trivial to find a good algorithm.


I think building that cost most to maintain should go first, but not if it makes alot of income.

Each building can have a maintenance value minus income generated, then destroy in order of highest maintenance.

So, if Building A costs 10 income, but produces 3 income, 10 - 3 = 7 maintenance.

If builing B costs 8 maintenance, but makes no income, then 8 - 0 = 8 maintenance.

8 is greater than 7 so destroy building B.


This message was edited by Emperor L


That means we should have a priority list of destruction. Here are buildings goups:
- farming,
- industry,
- research,
- population,
- military,
- income,
- maintenance,
- polution

Only research and military are not producing income (directly or indirectly) So a priority list is a must. Any suggestions?
Emperor L
[ Posts : 1237 ]
[Post Date: 07-Jul-2008 14:42]

Quote
That means we should have a priority list of destruction. Here are buildings goups:
- farming,
- industry,
- research,
- population,
- military,
- income,
- maintenance,
- polution

Only research and military are not producing income (directly or indirectly) So a priority list is a must. Any suggestions?


Hmm, in this situation they will find their own priority I think.

The most expencive buildings (minus their output value) go first.

These should be real output (contribution) and not max. So, for pollution and maintanace buildings, its how much they are preventing and so indirectly creating.

In some situations the maintenance buildings may be produceing most, if you have many buildings, they could be 'contributing' 50 income indirectly by preventing this drain on the treasury. As other buildings are destroyed though the overall maintenance will fall, meaning these buildings are contributing less...

But, if for example a farm building that increases farmer output, but has no farmers may be making real contribution of 0, even though it is a farming building, it may be costing more than a military building. So this should go first.

So, by not having priority you can remove the building thats draining most from empire


So, this will be very complex to calculate, but could be something like this to work out the overall drain of a building.

Farming:

Value = Maintenance - (own food production*foodValue) - ((farmer output increase*farmers)*foodValue) Where foodValue is the money value of 1 food (0.25 right now).

Production:

Value = Maintenance - (own production*productionValue) - ((worker output increase*workers))*productionValue)

Research and military have no output value, so just use maintenance value for these.

Income:

Value = Maintenance - own income production - ((planetExcessFood*foodValue)+(planetExcessProduction*productionValue))*incomeIncreaseValue
This message was edited by Emperor L
Maverick
[ Posts : 1331 ]
[Post Date: 07-Jul-2008 14:54]

Quote
So, by not having priority you can remove the building thats draining most from empire
This is quite hard for a general case. I'll think on a strict order of building groups that would be destroyed.

A candidate could be following:
1 - military,
2 - research,
3 - pollution,
4 - population,
5 - industry,
6 - maintenance,
7 - income,
8 - farming,

BTW: do you have ICQ/Skype?
This message was edited by Maverick
Emperor L
[ Posts : 1237 ]
[Post Date: 07-Jul-2008 14:59]

Quote
This is quite hard for a general case.
Heh, yeah...players have no chance of working it out Thats good in some ways...bad in others...

Quote
I'll think on a strict order of building groups that would be destroyed.

A candidate could be following:
1 - military,
2 - research,
3 - pollution,
4 - population,
5 - industry,
6 - maintenance,
7 - income,
8 - farming,


That could work, but again what building in this group do you destroy first? The most expencive, or something else?

Quote
BTW: do you have ICQ/Skype?
This message was edited by Maverick


No...I dont really know what they are
Maverick
[ Posts : 1331 ]
[Post Date: 07-Jul-2008 15:02]

Quote
Quote
This is quite hard for a general case.
Heh, yeah...players have no chance of working it out Thats good in some ways...bad in others...

Quote
I'll think on a strict order of building groups that would be destroyed.

A candidate could be following:
1 - military,
2 - research,
3 - pollution,
4 - population,
5 - industry,
6 - maintenance,
7 - income,
8 - farming,


That could work, but again what building in this group do you destroy first? The most expencive, or something else?
I think the most expencive, even if its generating more income than a cheaper one. This way is more simpler for DB implementation.

Quote
Quote
BTW: do you have ICQ/Skype?
This message was edited by Maverick


No...I dont really know what they are
Ok
This message was edited by Maverick
Emperor L
[ Posts : 1237 ]
[Post Date: 07-Jul-2008 15:07]

Quote
I think the most expencive, even if its generating more income than a cheaper one. This way is more simpler for DB implementation.


Heh, that would be easier...but maybe let the player choose priority? Each planet may have its own priority to empire, and also then on this planet you can set like assignments for what is most important.

Again that would be hard...but gives player more control in an emergency

Or just allow players to demolish buildings, this way they can delete as nessasary buildings they dont need, to prevent problems happeneing...may be alot easier...




This message was edited by Emperor L
Maverick
[ Posts : 1331 ]
[Post Date: 07-Jul-2008 16:01]

Quote
Heh, that would be easier...but maybe let the player choose priority? Each planet may have its own priority to empire, and also then on this planet you can set like assignments for what is most important.

Again that would be hard...but gives player more control in an emergency
Thats way to complex to implement ;D

Quote
Or just allow players to demolish buildings, this way they can delete as nessasary buildings they dont need, to prevent problems happeneing...may be alot easier...


Demolishing/recycling/selling will be possible in near future. you will get some income for them And its much much easier to implement too

This message was edited by Maverick
Emperor L
[ Posts : 1237 ]
[Post Date: 07-Jul-2008 17:29]

Quote
Quote
Or just allow players to demolish buildings, this way they can delete as nessasary buildings they dont need, to prevent problems happeneing...may be alot easier...


Demolishing/recycling/selling will be possible in near future. you will get some income for them And its much much easier to implement too


Thats probably the best way then, and also allows you to do something before your loosing ships/buildings. And heps prevent waste, such as if you have completed science tree you can demolish all science buildings as they are not needed, and save money...