Posts

Es werden Posts vom Juli, 2020 angezeigt.

Technical Tile Data vs. Visible Tile Data

Bild
While i was working on my game, i got stuck at a point where the actual height information of a walkable tile needed to be different than the the visual representation of it. If a Unit should be placed in a pond or just walk through a river, its legs and feed should be below the surface. But still the surface must keep its position. So here is a mismatch in the height of the terrain  (the Y Coordinate in 3D space). Here you see what i wanted to realize somehow: As i was already calculating the height of a tile in the map based on the avg of all the Y values that are located in the area of the tile, i ran into an additional problem. If i like to add more or special shaped geometry to the 3D mesh of the map, it would automatically have a impact on the height of this tile and a unit may be placed to hight or to low and all the logic like walking and attacking would also no longer work. Connected to all this information i would also need to know IF this tile is walkable at all and even...