[crossfire] New standalone program: mapper

Nicolas Weeger (Laposte) nicolas.weeger at laposte.net
Sat Jan 13 18:44:44 CST 2007


Some more info I missed :)

From a map, the program follows:
* linked maps
* exits, including teleporters
* end maps for random exits - random maps themselves will not be generated

It will not follow exits through plugins or such :)

No additional information about a map square (monster, treasure, hidden 
exit ...) is generated, because I felt it would give too much information. 
Map is, roughly, what a player would see, darkness removed.

The map picture itself will contain zones normally invisible to players (think 
hidden mechanism and such, surrounded by a blocked zone). This is because the 
program merely displays all squares, without checking if they are reachable 
or not by a player (something that makes generation much harder as you'd need 
to check all maps to search exits to certain zones, and process all squares 
recursively and such - but that could be an interesting exercise ^_-).

There are issues with layer ordering - some monsters can appear under fog or 
such. Also, Titans and coins (silver or platinum, not sure) have issues 
(missing square for Titan, distorded pic for coin).

A known effect is that, if you put a map limit, region information on the 
world map will probably be wrong - this is because the text position depends 
on all maps in region, something the program can't figure if it doesn't 
process all maps.


The program generates .html files, but should be able to generate other 
formats (.xml or whatever) without too much hassle (templates should be 
flexible enough). Changing .html everywhere should be a good start :)


The code can use much factoring - duplicated information, redundant strcpy all 
around, and such. I'll work on that later on :)
Also I may add a configuration file, and more options for flexibility (don't 
generate index, ...).

If you find map generation too slow, you can replace gdImageCopyResampled with 
gdImageCopyResized on line 757 - resulting small pic will be uglier, but 
generation should be faster.
Reciprocately, you can do the opposite on line 1081 to have a nicer world map.
(in a close future there will be a parameter for that, too ;p)


As a nice side effect, it's easier to find:
* exits leading nowhere (program will display that, including square with 
broken exit)
* unknown archetypes (use the -showmaps flag to see which map this happens in)



Nicolas



More information about the crossfire mailing list