Have it set up, so that if base terrain is 10, then that is the height. If there are trees in the hex, it does not add to the height of the hex base terrain. The program looks at the 'ground' and adds 'hgt' to it (in your example 10+8), when determining line of sight (LOS). In the game the base terrain height is what the mouse over indicates, as it ignores trees (it assumes troops are not up in tree tops).
Density works with visibility. If you have a visibility of 90 hexes, then you can see through several tree hexes, and if visibility is 10, then one tree hex blocks LOS. Density and visibility determine how much undergrowth, leaves in trees, low hanging branches, fullness of crop or field hexes, and so forth. Trees have a lower density than buildings, for instance.
Hard to explain, but I spent a number of months adding code to an already obscure system that was nearly 10 years old, when I got it and relied a lot on a library for which I never had the code. Somewhat complicated.
Bye...
Michael Wood
ORIGINAL: omegaall
Mike thanks for that it is a good help in seeing what is going on with teh terrain.[&o]
RockinHarry I think the the structure maps out as:
terType_t ter; // terrain type now 32 bits Bytes 0 -3
i16_t ground; // height of the ground bytes 4 - 5
i16_t hgt; // height of any obstacles byte 6 -7
u8_t density; // density of obstacles byte 8
u8_t smoke; // smoke level in hex byte 9
u8_t shellHole; // amount of shell holes byte 10
u8_t text; // text index 0=none byte 11
u8_t dirt; // road data .. uses a bit pattern see mcgraph.c byte 12
u8_t paved; // road data byte 13
u8_t rail; // road data byte 14
unsigned dark : 1; // darken heck byte 15
unsigned trench : 1; // trench in hex byte 16
unsigned improved : 1; // improvemets in hex byte 17
unsigned hole : 1; // is there a shell hole here? byte 18
unsigned bDir : 4; // bridge facing byte 19
But from what I have been testing I dont see how u8_t density works on terrain. Also i dont see how i16_t hgt works in say woods. Here the value stays at 8 for all ground levels. It seems this should also change with different heighs as defined by the base ground level. ie on level 1 (10) ground it should be 18 not 8.
Mike is this a glitch or am I reading this wrongly?