Terrain, FoV, and LoS

terrainI’ve re-factored the terrain system so that different types of terrain are defined in an XML file, they each have their own base image, and the different shades for different elevations are generated on load. This makes it very easy to add new terrain types in the future. The terrain generation function still needs some work, but it will now output a reasonable map with rolling hills, ponds, fields, forests, and villages.

Field of View and Line of Sight calculations use the same system whereby lines of sight are cast outward from the observer, and use each hex tile’s elevation plus that of any blocking terrain in the hex to calculate whether a given tile is visible. In the image above, some tiles are behind forests, while others are hidden by hills or that village.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply