Let it be Land!


... and anything that isn't Land is Sea.

While determining if the zone is covered with land or water looks like a trivial task, it, actually, isn't. Land(every country or island) is just an array of coordinate sets that form a polygon. Game zones are just rectangles with coordinates and sizes. And the task is to detect how fully this or that zone is intersected with countries-islands-polygons. The first idea was just to render the scene and count the colour of the pixels. While that would do the job, it would be an incredibly ugly code. I managed to keep this in the geometry scale.

Why do I even need this? It isn't just to determine if you can build ships in the middle of the African desert. This is the first step in making the big path-graph to help units move. Obviously, ships and tanks need different surfaces. Still, there is much work to do...

Get reWinWar

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.