HiveWE icon indicating copy to clipboard operation
HiveWE copied to clipboard

Terrain render

Open Retera opened this issue 1 year ago • 3 comments

When I am using a Java port of HiveWE terrain render on Warsmash, I encountered a visual issue with the way tiles were merged together in mosaics when a square of terrain had more than two types of tiles touching it. It appeared that a possible solution might be to change this line: https://github.com/stijnherfst/HiveWE/blob/master/src/Base/Terrain.cpp#L541

At that point in the code, instead of checking if the corner was equal to the current value, I checked if it was greater than current value:

Before:

		index[0] = bottom_right == texture;
		index[1] = bottom_left == texture;
		index[2] = top_right == texture;
		index[3] = top_left == texture;

After:

		index[0] = bottom_right >= texture;
		index[1] = bottom_left >= texture;
		index[2] = top_right >= texture;
		index[3] = top_left >= texture;

In the specific edge case on the specific map I was testing with, this change appeared to make the display of the map look more War3 alike. But I do not know if this creates other problems in other edge cases, and it would be worth more testing before merging it to HiveWE.

Also, as a sidenote, although it occurred to me to document this today, in the past two years while I was using my Java port of HiveWE terrain there were times I made other undocumented changes without making a pull request back to HiveWE. Sorry about this. One big one that I remember was that all cliff models were wrong, because they were being rendered 90 degrees rotated from what I saw in Warcraft 3. But they are all so similar that this was not apparent -- and in many cases the original HiveWE rotation looked passable -- until a lot of time and scrutiny was spent looking at the terrain.

Retera avatar Mar 12 '23 18:03 Retera