To be precise, what I want to do is to automate a number of things with mapmaking, which otherwise require handwork. I want to create a map through the map editor and just add the various objects. Then, with the tool I am making, I want to be able to do the following with the press of just a single button:
- Add the POINTS to the Polygon of each object;
- Add the proper shadow to each object;
- Add various explosion entries for when the object can be blown up;
- Add the "ruined" graphics for those objects;
So, the tool should take the VOL file that comes from the map editor (or CME file, which is the map editor save file), scan it for known graphics file names, correlate that with its own internal library, find all the corresponding entries that belong to it for the items I listed above and insert those into the VOL file with the proper coordinates. Nothing manual, just let the script handle it.
I'm currently working on collecting all that information from the game's original files, using those to build the asset library that the tool will use as reference. However, I am running into further challenges and complications, the more progress I make. While fun and entertaining to solve those challenges, it does take time. One of the recent challenges that I have is that I've noticed that there are a fair number of polygons that are a composite of a number of graphics - in fact, across all missions from BEL and BCoD (32 unique maps in total, if I counted right, including the tutorial missions), there are 99 polygons that are each composed of more than 50 tiles. Usually these are "BASE" and "AGUA" polygons, so I should be able to ignore them for what I want to create, but there are others too. Even so, there are numerous other polygons that have a few dozen entries. To complicate matters, a number of these tiles are in fact stuff like "-EXPLO00", which are transient; i.e., only shown when the object blows up. They're related to a state change of the object, not the actual object I am interested in. I'm going to have to separate those and add them as reference to the actual object instead. That's going to be some effort, but I am determined.
Once complete, I will publish the asset library, so hopefully other people will be able to use it for their tools as well.
Update:
I've made an analysis across the MAPA*.VOL files of both games (will do the CHOQ files later, but I suspect those don't contain polygons with lots of tiles), to get a feel for the number of tiles per polygon, in general. From the number of tiles, I've excluded the tiles that start with a '-', as those indicate referenced files like explosions and ruin graphics. Note that they're not exclusive, in the sense that specific graphic files may occur in more than one polygon (for instance, tree graphics have a tendency to occur relatively frequently). I've also excluded polygons that have "BASE" or "AGUA" at the start of their polygon name. This is the distribution that I found:
Polygons with ...
1 tile: 4698
2 tiles: 682
3 tiles: 420
4 tiles: 165
5 tiles: 133
6 tiles: 114
7 tiles: 49
8 tiles: 49
9 tiles: 34
10 tiles: 24
It quickly tapers off beyond that. It makes me wonder if perhaps I shouldn't approach this from another angle: find the polygons of - say - up to 8 tiles and see which ones make sensible compositions (like tree clusters) and then add those as objects, instead of trying to categorize individual graphics files. Of course, the 1 tile polygons are pretty straightforward to categorize. Need to think a bit more about this.
Edited by Maurice1976, 04 October 2017 - 07:43 PM.