Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix #6233: Improve lock pricing and infrastructure counting, to achieve better consistency #6933
When building lock:
When removing lock:
When transfering ownership:
After loading a savegame:
This seems to do multiple things:
I do not agree with the new counting of infrastructure. The old one made more sense to me.
I am unsure whether the clear-check can fail for IsWaterTile.
I do not quite understand the intention of the cost change. I guess there are different ideas of what is part of a lock.
When building a canal on a river, it doesn't include the cost for clearing river. When building a ship depot on a river, it doesn't include the cost for clearing river. Even the north and south parts of a lock don't include the cost for clearing river. The watered part of a dock doesn't include the cost of clearing river either. So it would also make sense to make the middle tile of a lock to not include the cost of clearing the river.
As for simulating canal price and canal count… This canal tile isn't actually built or demolished, but its associated costs are simulated, much in the sense to mimic what happens on the upper and lower tiles of a lock. Objective here is to achieve pricing consistency, but mostly to fix a flaw that can be exposed using BaseCostsMod 5.0 as I reported in #6233.
If the value for building a canal was instead so blatantly much higher than the cost for building a lock itself, the flaw would become exposed: building several locks in a row would be cheaper than building a single contiguous canal line.
…ve better consistency When building lock: - don't add the cost for clearing river - if not building on a river, simulate canal build price and add it to the landscape clearing cost - if not building on a river, simulate canal maintenance count When removing lock: - if it was not built on a river, simulate the cost for clearing a canal tile and add it to the cost for clearing the lock itself - if it was not built on a river, subtract canal maintenance count When transfering ownership: - old owner: subtract canal maintenance count if it was not built on a river - new owner: simulate canal maintenance count if it was not built on a river After loading a savegame: - simulate canal maintenance count if it was not built on a river