As I've already mentioned, this is a scale map projection of the entire world. There are two base maps and 6 different zoom levels of each. Here is the physical map at the lowest zoom level:

And here is the political version. Note, not all of the country labels are completed yet as my goal is to get a working mini-game of the German invasion of Poland first so the emphasis has been on getting that section of the world finished before the rest.

In addition to the base maps, there are 8 overlays that can be viewed. I'll cover those in a later post.
A square grid can be toggled on and off but not at the level seen above, it is too small to be useful as the squares are merely 2 pixels wide at this level.
Distances on the map are to scale as per definition of an equirectangular projection. In other words, the vertical distance is always the same but the horizontal distance depends on the latitude of the cell. As you get closer to the poles, the horizontal distance decreases. Diagonal distances are as they should be (square root of the sum of the square of the sides).
For example, the vertical distance is always 40 km (24.8 miles). At the equator, the horizontal distance would be the same and the diagonal distance would be 56.56 km.
Close to the poles, the horizontal distance can be as low as 6 km with a diagonal of only 40.45 km.
Diagonal movement is handled as follows:
Units are free to move diagonally as long as they would also be free to move to BOTH of the adjoining sides of the diagonal. Otherwise the diagonal is not available but it may still be possible to go around the diagonal by going through the other adjoining side.
In other words, a unit can move North East as long as it has a clear path North and a clear path East. If say the East was blocked, the unit could not move on the diagonal but may still reach the point by going North first and then East. Of course, this will result in a longer trip as it should.
What this results in is that in friendly territory, units can often move more quickly than in enemy territory above and beyond any other penalties simply because they are more likely to have access to diagonal movement options.
It also means that a diagonal front line can be formed to stop enemy penetration.
As you can imagine, the size of the map and the scaling of the distances results in a real challenge for the path finding algorithm. However, it is quite fast and accurate and is able to update in real time as the user moves his cursor around the map on a system with average performance.
This is partly as a result of treating rivers as being in cells rather than along the borders of cells. I'm not going to go into great detail on optimizing the A* path finding algorithm here but suffice it to say, that not having edge based features results in a very large optimization. This is necessary in a map with almost half a million cells.
Rivers still affect both movement and combat in a way that is logical for a game of this scale.
The entire size of the map with all of its zoom levels and both base maps in memory is about 800 meg. However, I use an 'on demand' algorithm that only loads the tiles needed for the current view. This means that there can be a slight hesitation the first time an area of the map is visited at a specific zoom level but the next time you go there, it is almost instantaneous.
Also, up to 10 locations can be stored and accessed with one key allowing very quick navigation to the specific areas of the map the player is currently interested in.
For example, you may store a view that shows all of Europe, another one zoomed in on an area in North Africa where you are involved in a battle, maybe another on Japan, etc. Then with the touch of a button you can jump from view to view without having to scroll around. These locations can be changed and saved at any time.
Tomorrow, I'll go into a little detail on the units.
No comments:
Post a Comment