Ok, I've done a bit more investigating and thinking. If I can find a formula for Krom to use then we can fix this.
Here's what I think is going on:
- Making all the light values be something is obviously not enough. Nick has proved this quite well.
- There is no obvious difference between the light values in single player and multiplayer maps.
- In multiplayer mode, the 3D engine relies heavily on the light value. This is probably because the map is revealed differently, due to the fact that there are multiple screens viewing the map.
- Normally, it
does use the light values, but only a little bit in some places. For instance, the contrast in the hill of original maps is far higher than that archived by maps map with Krom's editor. e.g. there are big black patches on the barracks hill in mission 1 TSK. This is confirmed by looking with JvK's map editor. There are great contrasts in light values in the hills.
- The hills have very high light value, with lines of very low values going through them. This lines up quite well with the hight values, although the hight is not nearly as contrasted.
- The far side of hills have lower light values than the near side.
- The average light value for flat terrain is about 16, and it doesn't vary very much.
I have one idea for what the formula is. I think that is must be calculated from the hight. My idea is something like this:
The light value of a tile is equal the average of it's hight value plus the average of the hight of all the tiles around it.
OR:
L means light value
H means height
AH means average hight of tiles around it.
L= (H+AH) / 2
Of course, that is assuming that both light and height are using the same ranges. (so some convention is necessary, to change it from 100 based to 32 based)
The reason why I think this is because high light value tiles generally have low hight values around them. I will build a program to do this at some point. Even if this is not exactly what the Joymainia map editor does, if it fixes the bug then that's ok. I might make a kind of program that you can write your own formulas for, and it will change the map according to that.
Edit: I just did some checking and I think that formula must be wrong. It doesn't seem to fit.
I will have to investigate further. I think my basic idea is right: It is to do with how much the elevation changes between this tile and ones around it.
It's possible that it might work with something far simpler.
It could also be a different byte, such as some of the unknowns that TB spoke about.
I don't know, but it will be quite a bit of work any way you look at it.
I'll have a go at some point.
Lewin.