Pulling the technical coding discussion out of the pitboss etiquette thread:
Could this be approached via giving improvements 3 states:
- Improved
- Pending_Pillaged (temporary state in which the resource is actually connected in the city screen and "under the hood" for unit production, but the tile is displayed on the map as unimproved as in the current pillage implementation)
- Fully_Pillaged (improvement destroyed as in current implementation)
When improvement gets pillaged, it goes from Improved to pending_Pillaged so that the improvement is not displayed on the map, but the resource remains connected. Then after turn roll and production is processed, do a check to convert all Pending_Pillaged resources to Fully_Pillaged.
This way you don't have to change anything regarding the production processing for an individual player. UI for the map remains consistent and the improvements disappear from the map as expected when pillaged, but they can remain connected until after production is processed. The same designation would need to be used for roads so that cutting a road also maintains connection of the resource for production purposes, but the map graphic and unit movement of the road still disappear immediately when pillaged.
(December 8th, 2020, 14:54)Charriu Wrote:(December 8th, 2020, 11:23)Cornflakes Wrote: @Charriu, is it possible to tie the resource-check for each player to their "end turn" event rather than the turn roll? In this way, the production can all be processed simultaneously at the turn roll, but players have the ability to actually use resources that are connected when they actually play their turn.
The way the code is structured would make this very hard and I would have to change a lot of stuff to get it work. I would not want to dare that if it isn't absolutely necessary.
Could this be approached via giving improvements 3 states:
- Improved
- Pending_Pillaged (temporary state in which the resource is actually connected in the city screen and "under the hood" for unit production, but the tile is displayed on the map as unimproved as in the current pillage implementation)
- Fully_Pillaged (improvement destroyed as in current implementation)
When improvement gets pillaged, it goes from Improved to pending_Pillaged so that the improvement is not displayed on the map, but the resource remains connected. Then after turn roll and production is processed, do a check to convert all Pending_Pillaged resources to Fully_Pillaged.
This way you don't have to change anything regarding the production processing for an individual player. UI for the map remains consistent and the improvements disappear from the map as expected when pillaged, but they can remain connected until after production is processed. The same designation would need to be used for roads so that cutting a road also maintains connection of the resource for production purposes, but the map graphic and unit movement of the road still disappear immediately when pillaged.