Here's my explanation of how the BF1942 "small ones" maps work. Firstly though, I should give credit where credit is due. Reading Rexman's code taught me a lot about pathmapping files that I probably wouldn't have worked out for myself, because I would have given up the whole thing as too hard! It was only through investigating things in Rexman's code that puzzled me, that I worked out the following information.
Here's how I think that DICE creates a waypoint map from a level zero pathmap.For each segment in the pathmap, do the following:
The algorithm that DICE use in step 3 is still a mystery to me, however. Also, why do you sometimes have to "mod 64" their waypoint coordinates?Once the above steps are done, then the connections between segments have to be determined. Note that I consider the segments to go from the bottom up rather than the top down (because that way they are in the same orientation as the map), so I think of the connections as being to the segment "above" and "to the right", rather than "below" and "to the right". So, starting at the last segment and working back to the first segment:
It's all very well to make these claims, but what evidence do I have to support me? To help me to analyse the path files I wrote a program to display the contents graphically. Here is a screen dump showing part of the Wake Island infantry path maps: Wake.png (24 KB). At the bottom left of the image you can see the current segment and the eight surrounding segments. To the right of that is the data from the waypoint map. To the right of that are the big grids showing the current segment, and the segments above and to the right, with the waypoints colour coded. In the top right you can see the colour-coded info segment.
You can see that the waypoints are in order of decreasing region size, and that the info map segment is a shrunk-down version of the current segment. Note that the "yellow" region doesn't appear in the info map.
You can download and play with my Pathfinding map explorer program (209 KB) if you wish, but be warned that I wrote this program for myself, so it's not production-quality code. Try it with the DICE maps, and compare the results with the output from other tools.
Here is my implementation of the above algorithms: CreateInfoWaypoint (50 KB). It takes a level zero pathmap, and generates the corresponding info and waypoint maps. Note: it doesn't handle boats and landing craft (and there isn't much point adding watercraft support now that FourCentsShy has created genPathmaps!)
Any comments, bug reports, grammar flames, send them to:
BF1942 at home.netspeed.com.au
Note: I'm really quite slack, so please don't be offended if I don't reply to your email immediately. It'll probably take me a couple of days just to get around to checking for new mail :-)