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 wrongly placed #947

Open Spikeone opened 5 years ago

Spikeone commented 5 years ago

Original: image

RttR: image

Water shouldn't be found near mountains - but in RttR it is. Although it looks like the original had some bugs here as well as sometimes the distance to mountain must be 2 nodes and sometimes 1 node

Flamefire commented 5 years ago

But isn't this the map which says where water is?

Spikeone commented 5 years ago

Sorry, I don't get it, what do you mean @Flamefire ?

Flamefire commented 5 years ago

water is just a resource like everything else (coal, gold,...), so unless we additionally place water somewhere this information comes from the map

Spikeone commented 5 years ago

If true, then settlers 2 seems to ignore this map for water. Anyway I tested this by checking the map file. Calculating the position of resource in the map file as follows: image

2352 + (16 12) + (11 64 64) + (64 27) + 29 MAPHEADER + 12 BLOCKHEADER + 11 BLOCKS + X * mapwidth + Y

This results in 49357 Checking the file at that position: gives the following: image

So - looks like RttR fails to load water then?

Flamefire commented 5 years ago

Ah yes, I seem to remember that we added water to every vital spot and ignore the map data. Guess we only shall add water, if in radius 2 all are vital?

Spikeone commented 5 years ago

Guess so - although it looks for me like settlers 2 used to check only block 2 (or 3) and not both which could explain why it's sometimes a distances of 2 and sometimes 1. Going to check if the same applies near lava / desert / water

Flamefire commented 5 years ago

Shall we make this optional? Like Addon-Off: Read water from map, Addon-On: Add water to every watery terrain if in radius 2 all are watery? (see https://github.com/Return-To-The-Roots/s25client/blob/db01993df545504b3e8a30bd6f13a0e9905fe80f/RTTR/gamedata/world/greenland.lua#L101)

Spikeone commented 5 years ago

Guess humidity = water level in % so 100 gives 7 water, 29% gives 2?

But I agree an addon' would be great a) Settlers 2 like (default) b) By terrain (humidity level) c) by resourcemap (editor set level)

Only one question left: should we use settlers 2 way (as described it might differ from the simple 2 node idea) or just the simple 2 node solution.

Flamefire commented 5 years ago

Yes

I'd use only 2 settings: By map or by terrain.
Doesn't S2 use what the editor set?

For by terrain: I'd go for simplicity and use min(humidity-of-2-nodes-radius)

Spikeone commented 5 years ago

Well, could be great if we could also set in other editors the water level - therefore the resource map. I'm also not sure if some editors correctly set water (e.g. s25edit or my tool (I'm sure I always set fish anywhere by default)).

Also with 3 options we can do the following: steppe has less water than greenland, thus yields less water when using exhaustible wells.

Flamefire commented 5 years ago

Again: What is the 3rd setting? Or does the s2 editor not set water at all and it is only set there by the game? What you call resource map is what I mean with "By map": The amount of ALL resources should be set by the editor in the map.

steppe has less water than greenland

Thats already what humidity does.

If S2 does the amount differently I wouldn't care as the amount only matters for that addon which is not in S2 in the first place.

Spikeone commented 5 years ago

Okay so:

1st = level the original editor would set 2nd = levels set by terrain in rttr 3rd= level any other (e.g. s25edit) editor has set

Flamefire commented 5 years ago

And what is the difference between 1 and 2? In the original there are no different levels, it is either water or no water. We enhanced that to have different levels but this is only used/meaningful with the addon.

Spikeone commented 5 years ago

Well basically it's about how much water a map possibly has. If you use exhaustible wells and the first option you have more water than with the 2nd option. You could create quite some nice scenarios where the player has only steppe, thus less water and has to fight for water.

Although I agree, that 1 and 2 don't differ that much, in some cases this could be really cool.

Flamefire commented 5 years ago

I still don't understand the difference. Isn't 2==1? (if we include: water=min(humidity-of-2-nodes-radius))

Spikeone commented 5 years ago

As in settlers 2 humidity just means water yes or no I don't see what humidity is good for if not for the amount.

So Option 1 waterspots == Option 2 waterspots But Option 1 wateramount != Option 2 wateramount Thus Option 1 map wateramount > option 2 water amount

Should be easy as option 1 just sets 7 water if in humidity range while option 2 sets 7 x humidity / 100

Flamefire commented 5 years ago

So option names: