Automated map analyzer (idea)
Automated map analyzer (idea)
I have an idea of writing a program that would analyze warzone2100 maps. The main thing it should do is calculate the "map metrics", by which i mean distances between important objects like player bases or "early" oil derricks.
Let me explain it a little further. One can make this analysis manually by sending a truck to a certain location and watching the game time. For example, it takes around 1 minute 30 seconds to "travel by truck" from one base to another on "Startup", but it takes around 2:30 on "Contention", which makes Startup much more suitable for rushing (the enemy will make less tanks during the time it takes to reach him). Another important aspect of the game is the time it takes to reach the first few "extra" oil derricks ("expansion") from your start location. Such analysis, being simple enough, could easily expose the balance flaws of asymmetric maps like Startup-1 or Highground. This could make making balanced asymmetric maps much easier.
Well, let me think. What do i need for this? First of all, i need a tool to extract start locations and oil derrick locations from the map. Second, i need a tool to make pathfinding and calculating the path length. The rest should be easy. Is it easy enough to obtain such tools?
Let me explain it a little further. One can make this analysis manually by sending a truck to a certain location and watching the game time. For example, it takes around 1 minute 30 seconds to "travel by truck" from one base to another on "Startup", but it takes around 2:30 on "Contention", which makes Startup much more suitable for rushing (the enemy will make less tanks during the time it takes to reach him). Another important aspect of the game is the time it takes to reach the first few "extra" oil derricks ("expansion") from your start location. Such analysis, being simple enough, could easily expose the balance flaws of asymmetric maps like Startup-1 or Highground. This could make making balanced asymmetric maps much easier.
Well, let me think. What do i need for this? First of all, i need a tool to extract start locations and oil derrick locations from the map. Second, i need a tool to make pathfinding and calculating the path length. The rest should be easy. Is it easy enough to obtain such tools?
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
- lav_coyote25
- Professional

- Posts: 3434
- Joined: 08 Aug 2006, 23:18
Re: Automated map analyzer (idea)
only if you make it. 
Re: Automated map analyzer (idea)
I know, i know (:
Well, maybe if someone could point me to the pieces of code i could use
It must be easy for Flail13 to give me some hints on extracting data from the map; Even if they'll be in VB.NET, i'd still like them
Well, maybe if someone could point me to the pieces of code i could use
It must be easy for Flail13 to give me some hints on extracting data from the map; Even if they'll be in VB.NET, i'd still like them
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Automated map analyzer (idea)
In the source code, look in tools/map/, there are some programs to extract map info.
Re: Automated map analyzer (idea)
Well, i've just found myself in the mood to try to look there, and found out that these tools aren't workingPer wrote:In the source code, look in tools/map/, there are some programs to extract map info.
Code: Select all
$ ls
2c-Contention.wz 8c-jp2100.gam map2lnd.c mapconv.c mapload.c pngsave.h
4c-Visionary.wz 8c-jp2100.wz map2png mapinfo mapload.h
8c-jp2100 8c-squared.wz map2png.c mapinfo.c pngsave.c
$ ./mapinfo 8c-squared.wz
Could not open 8c-squared.wz/game.map
Game file 8c-squared.wz.gam not found
$ ./mapinfo 8c-jp2100.wz
Could not open 8c-jp2100.wz/game.map
Game file 8c-jp2100.wz.gam not found
$ ./mapinfo 2c-Contention.wz
Could not open 2c-Contention.wz/game.map
Game file 2c-Contention.wz.gam not found
$ ./mapinfo 4c-Visionary.wz
Could not open 4c-Visionary.wz/game.map
Game file 4c-Visionary.wz.gam not foundI was also trying to unpack the map, but, curiously enough, the result was the same:
Code: Select all
$ ls 8c-jp2100
dinit.bjo feat.bjo game.map struct.bjo taglist.tag ttypes.ttp
$ ./mapinfo 8c-jp2100
Could not open 8c-jp2100/game.map
Game file 8c-jp2100.gam not found
$ ./mapinfo 8c-jp2100.wz
Could not open 8c-jp2100.wz/game.map
Game file 8c-jp2100.wz.gam not foundMaps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Automated map analyzer (idea)
I have never tested it on packed maps (.wz). It works when called on maps like this: mapinfo data/base/multiplay/maps/2c-highground
It is a bit picky about paths and stuff, because it is just a test tool that I quickly put together.
It is a bit picky about paths and stuff, because it is just a test tool that I quickly put together.
Re: Automated map analyzer (idea)
Yay, got it working! It just needs at least some sort of path to the file supplied as an argument (at least "./map.wz"), to initialize the PhysFS. Still, i can't get it working with .wz archives (i was thinking that PhysFS is just supposed to do it, but had no luck yet), but at least it works with unpacked maps.
Looks like it's easy enough to extract a heightmap (using the code from map2png):
But the MAPTILE structure doesn't seem to include any info about the tile type. I want to check if a tile is a water or is a cliff. Relying on is bad, because tile types are reassignable. Well, at least i can start trying to make it work on maps with original tile types.
Another question: Is there some info on how the hills affect unit speed?
Eg, how quickly will a truck-viper-wheels climb an orthogonal hill between a vertex line of height 10 and a vertex line of height 20?
Looks like it's easy enough to extract a heightmap (using the code from map2png):
Code: Select all
#include "mapload.h"
/*...*/
map = mapLoad(filename);
MAPTILE *psTile = mapTile(map, x, y);
// and then ask questions like "psTile->height", etc
Code: Select all
uint32_t texture; // Which graphics texture is on this tileAnother question: Is there some info on how the hills affect unit speed?
Eg, how quickly will a truck-viper-wheels climb an orthogonal hill between a vertex line of height 10 and a vertex line of height 20?
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam

