htamas @ popuw.com (Wed Mar 28, 2007 4:13 pm) wrote: Jalal has asked me to create a thread about the map drawing utility I wrote last summer. It creates simplified maps from PoP1 and PoP2 levels, similar to the small images shown in Roomshaker.
A level map looks like this (RoT level 1):
This is a room map (from PoP2 level 5):
Downloads:
source code (released under GPLv2)
binary for suse 10.2 (should work with other distros too)
binary for windows
You'll also need the ImageMagick library. For windows, download it from here. Linux users should install the ImageMagick package. If you would like to compile from source, you should also install ImageMagick-devel (and gcc, of course).
Compiling from source:
After installing the prerequisites, run:
Usage:Code: Select all
gcc drawmap.c -lWand -o drawmap
First, extract the .plv files from levels.dat (pop1) or prince.dat (pop2) using PR.
Then, from the command line, use e.g.to create a level map from level01.plv,Code: Select all
drawmap level01.plv
orto draw a map of room 18 from level01.plv.Code: Select all
drawmap level01.plv 18
Note that the output file is always called drawmap.png. The program is designed in a way that the caller script/application handles renaming/moving the resulting file.
Should you need to iterate through a list of .plv files, you could use this shell command on linux:or this one, if you're using windows:Code: Select all
for i in *.plv; do ./drawmap $i; mv drawmap.png $(basename $i .plv).png; done
(if you write it in a batch file, you need to escape the percent sign with another: % -> %%)Code: Select all
for %i in (*.plv) do ( drawmap %i rename drawmap.png %~ni.png )
Notes :
* You can't create a level map from a level with irregular room linking. In such a case, you should understand the rooms' structure from the ordinals of adjecent rooms shown at the side of the room maps.
* Maps only show background & foreground elements (no guards, starting locations, etc.). Also, some blocks (particularly the ones unused in the original game) are shown by their hex code instead.
* This utility is licensed under the GNU General Public License, version 2. This means that you're free to use, learn from or modify the source code, and release modified versions. Derivatives should use a compatible license. While I hope this program is useful, there are no warranties of any kind. For more details, see the license text.
* Don't be put off if I don't answer your questions, I don't have much free time.
jora @ popuw.com (Wed Mar 28, 2007 5:34 pm) wrote: I didn't understand, sorry, what does it do?
starwindz @ popuw.com (Thu Mar 29, 2007 1:32 pm) wrote: So cool and nice... htamas...
Thank you for making this program...
adam77 @ popuw.com (Thu Mar 29, 2007 8:31 pm) wrote: So is thins for POP1 or POP2 ?
jalal @ popuw.com (Sat Mar 31, 2007 4:59 pm) wrote:jora wrote: I didn't understand, sorry, what does it do?It creates simplified maps for PoP1 and PoP2, like the simplfied maps of: PoP1, PoP2, 4D Prince, PoP TGE, etc.adam77 wrote: So is thins for POP1 or POP2 ?
So now you can generate maps for your own mods.
For those who do not know to extract .plv files, read this thread for usage under linux, and this one for Windows.htamas wrote: Usage:
First, extract the .plv files from levels.dat (pop1) or prince.dat (pop2) using PR.
@starwindz: Wouldn't it be a good idea adding a new tab called "Maps" under the Info one (besides manual, review and etc tabs)? So if someone has his or her mod's maps, he or she could add or send them for the next PoP1-TP's release).
Thread Stickyed.
jora @ popuw.com (Sat Mar 31, 2007 7:05 pm) wrote: Wouldn't that turn the mods too easy?
if u can see what's coming it'll be less hard.
starwindz @ popuw.com (Sat Mar 31, 2007 10:45 pm) wrote: I got an error (drawmap.c unknown 355).
I used PR to extract plv files from 'PoP1 original' and
run 'drawmap level1.plv'. What is going on?
As you can see 'showing map' is something like spoiler.jalal wrote:
@starwindz: Wouldn't it be a good idea adding a new tab called "Maps" under the Info one (besides manual, review and etc tabs)? So if someone has his or her mod's maps, he or she could add or send them for the next PoP1-TP's release).
Anyway I will add this feature(adding 'Map tab') to 'to do list'
for the next version of total pack.
htamas @ popuw.com (Sun Apr 01, 2007 12:42 am) wrote:Did you install ImageMagick?starwindz wrote: I got an error (drawmap.c unknown 355).
starwindz @ popuw.com (Sun Apr 01, 2007 6:44 am) wrote:Yes, I have installed ImageMagick.htamas wrote:Did you install ImageMagick?starwindz wrote: I got an error (drawmap.c unknown 355).
Hmm... I will check it out again.
htamas @ popuw.com (Sun Apr 01, 2007 11:56 pm) wrote:I just thought that, because previously jalal had the same error message, and solved that by installing the ImageMagick libs (quotes from PM):starwindz wrote: Yes, I have installed ImageMagick.
Hmm... I will check it out again.
jalal wrote: Hi,
I tired it, but I got an error:
drawmap.c unknown 355By the way, I've updated the utility to give a bit more verbose error messages, such as "NoDecodeDelegateForThisImageFormat `tiles1.png'".jalal wrote: Great!
It has worked!
I've just downloaded:
ImageMagick-6.3.0-0-Q16-windows-dll.exe (Dynamic at 16 bits-per-pixel) from here: http://www.imagemagick.org/script/binar ... hp#windows
poirot @ popuw.com (Mon Apr 02, 2007 1:04 am) wrote: with a few modifications you can use the FP rendering engines to produce high quality maps
I'll try to make a sample asap, and perhaps an online script to draw a level.dat file.
starwindz @ popuw.com (Tue Apr 03, 2007 2:39 am) wrote: htamas, I got a blank png file(drawmap.png) after running drawmap utility.
download a following file and test it.
Download my test files
blood_445 @ popuw.com (Wed Apr 11, 2007 1:51 pm) wrote: wow, nice, I will make the maps of my mods :yees:
jalal @ popuw.com (Sun Jun 24, 2007 8:37 am) wrote: starwindz has sent me a couple of PMs about drawmap (it's not working for him (the Windows version)), I've been trying till I've found out what the problem was.
The map drawing utility does only work under ImageMagick-6.3.0-0-Q16-windows-dll.exe (10/15/06).
If running under the newest version (ImageMagick-6.3.4-10-Q16-windows-dll.exe 06/30/07) or older versions, you will either get drawmap.c unknown 355 error if using drawmap-win-20061015 or ../drawmap.c unknown 355 NoDecodeDelegateForThisImageFormat `tiles1.png' if using the latest version ... (it works if you delete the DLL files but a black blank image will be generated).
I would upload version 6.3.0-0 if I had high speed Internet.
PS: I think it will work if you compile drawmap under ImageMagick-6.3.4-10.
mk1994 @ popuw.com (Thu Aug 16, 2007 3:39 pm) wrote: One question:
You can make PoP2 maps with this, as well, can't you? But you need a *.plv file or something - and that you'll get from PR, right? So, how the heck do you make a *.plv file of PoP2?
programmer @ popuw.com (Thu Aug 16, 2007 7:29 pm) wrote: You have to extract it from PRINCE.DAT file.. It was said in this topic.
mk1994 @ popuw.com (Sat Sep 22, 2007 7:04 pm) wrote: Where?
Oloil @ popuw.com (Sat Sep 22, 2007 7:19 pm) wrote:loljalal wrote: Stickyed
Veke @ popuw.com (Sun Sep 23, 2007 5:49 am) wrote: What's so funny?
mk1994 @ popuw.com (Sun Sep 23, 2007 6:30 am) wrote: Yeh, I wonder, too.
- further messages written after Nov 11, 2007 may have been lost