Return-To-The-Roots / s25client

Return To The Roots (Settlers II(R) Clone)
http://www.rttr.info
GNU General Public License v2.0
476 stars 75 forks source link

water not placed as in the original #1519

Open Spikeone opened 2 years ago

Spikeone commented 2 years ago

RttR places water wrongly. Sadly I have no idea yet on the correct algorithm.

grafik

grafik

It's not related to farming/trees: grafik

Flamefire commented 2 years ago

"Wrong" is a hard word here. We have an own algorithm to add water where there isn't any and "fill" up pre-filled water places which the original may or may not do. See the algorithm at https://github.com/Return-To-The-Roots/s25client/blob/4ce6199a77ebb44b5b14cdc23c0e0a19e41c77ca/libs/s25main/world/GameWorld.cpp#L1326-L1343 which is based on the terrain humidity.

So this deviation is a deliberate choice and I'm not sure we want the original behavior here especially if we don't know that anyway. I mean: We did fix other bugs too and "missing water" could be one of them. Maybe the original relied on the resource value stored in the map file only and hence on the editor setting that correctly which is likely not (always) the case for (all) custom maps.

Spikeone commented 2 years ago

Wrongly and not as in the original are interchangable in this case.

I guess this depends on how you view it, for me this hasn't been a bug in the original but I always expected it to work that way. Thats because now you have to put at least some thoughts into building wells. Currently you can use any building spot in RttR and just build a well. This can be any useless spot at all - so producing water is a nobrainer. In the original, especially on maps with fewer building slots, you at least should search if you are to close to water or not.

So I don't see any problem in adding a water placement algorithm that at least mimics the original. As said I don't agree with seeing the current behavior as a bugfix.

And yes we don't know the algorithm, but testing this may shed some light on a more correct behavior. I also think we once had a more original approach some years ago.

@Flamefire Just asking as I still don't fully understand the difference between "Water Everywhere" and "Inexhaustible" - aren't they the same at the moment? Except having different quantity signs but that doesn't make any difference with inexhaustible water.

Flamefire commented 2 years ago

And yes we don't know the algorithm, but testing this may shed some light on a more correct behavior

Well our current approach is to place water with an amount according to the terrain with the lowest humidity. I.e. next to desert there won't be any water. Feel free to try and research how the water is placed in the original or if the game (only) uses what is stored in the map. We seemingly do that partially, i.e.: If there is water, we adjust the amount (which may remove it)

Just asking as I still don't fully understand the difference between "Water Everywhere" and "Inexhaustible"

I.e. the difference is that for the first we change only the amount in places where any water already is and for the 2nd we additionally place water when there isn't any resource. See https://github.com/Return-To-The-Roots/s25client/blob/4ce6199a77ebb44b5b14cdc23c0e0a19e41c77ca/libs/s25main/world/GameWorld.cpp#L1316-L1319

I think the way we do it was a workaround for custom maps using only "binary" water, i.e. either there was 7 water or none. And we enhanced that to consider the terrain around the node and with the 2nd option above may additionally place water.