Author |
Message
|
htamas |
Posted: Wed Mar 28, 2007 4:13 pm Post subject: drawmap - map drawing utility |
|
|
Developer
Age: 21 Joined: 10 Aug 2006 Status: Offline Posts: 89 Location: Budapest, Hungary
|
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:
Code: |
gcc drawmap.c -lWand -o drawmap |
Usage:
First, extract the .plv files from levels.dat (pop1) or prince.dat (pop2) using PR.
Then, from the command line, use e.g.
Code: |
drawmap level01.plv |
to create a level map from level01.plv,
or
Code: |
drawmap level01.plv 18 |
to draw a map of room 18 from level01.plv.
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:
Code: |
for i in *.plv; do ./drawmap $i; mv drawmap.png $(basename $i .plv).png; done |
or this one, if you're using windows:
Code: |
for %i in (*.plv) do (
drawmap %i
rename drawmap.png %~ni.png
) |
(if you write it in a batch file, you need to escape the percent sign with another: % -> %%)
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. |
|
Back to top |
|
|
jora |
Posted: Wed Mar 28, 2007 5:34 pm Post subject: |
|
|
Maharajah
Age: 15 Joined: 25 Jun 2006 Status: Offline Posts: 255 Location: Setúbal, Portugal
|
I didn't understand, sorry, what does it do? |
|
Back to top |
|
|
starwindz |
Posted: Thu Mar 29, 2007 1:32 pm Post subject: |
|
|
Valued Contributor
Age: 36 Joined: 12 Jan 2007 Status: Offline Posts: 810 Location: South Korea
|
|
Back to top |
|
|
adam77 |
Posted: Thu Mar 29, 2007 8:31 pm Post subject: |
|
|
Citizen
Age: 28 Joined: 19 Apr 2006 Status: Offline Posts: 41 Location: Louisiana
|
So is thins for POP1 or POP2 ? |
|
Back to top |
|
|
jalal |
Posted: Sat Mar 31, 2007 4:59 pm Post subject: |
|
|
Site Admin
Age: 20 Joined: 04 Dec 2005 Status: Offline Posts: 2698 Location: Lebanon
|
jora wrote: |
I didn't understand, sorry, what does it do? |
adam77 wrote: |
So is thins for POP1 or POP2 ? |
It creates simplified maps for PoP1 and PoP2, like the simplfied maps of: PoP1, PoP2, 4D Prince, PoP TGE, etc.
So now you can generate maps for your own mods.
htamas wrote: |
Usage:
First, extract the .plv files from levels.dat (pop1) or prince.dat (pop2) using PR. |
For those who do not know to extract .plv files, read this thread for usage under linux, and this one for Windows.
@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. _________________ And we burned in the wine of our lips
And we were born again |
|
Back to top |
|
|
jora |
Posted: Sat Mar 31, 2007 7:05 pm Post subject: |
|
|
Maharajah
Age: 15 Joined: 25 Jun 2006 Status: Offline Posts: 255 Location: Setúbal, Portugal
|
Wouldn't that turn the mods too easy?
if u can see what's coming it'll be less hard. |
|
Back to top |
|
|
starwindz |
Posted: Sat Mar 31, 2007 10:45 pm Post subject: |
|
|
Valued Contributor
Age: 36 Joined: 12 Jan 2007 Status: Offline Posts: 810 Location: South Korea
|
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?
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). |
As you can see 'showing map' is something like spoiler.
Anyway I will add this feature(adding 'Map tab') to 'to do list'
for the next version of total pack. _________________ PoP1-Total Pack : Download V2.00-Pre12a
All Total Packs for playing the best DOS Games
Last edited by starwindz on Sun Apr 01, 2007 2:40 am; edited 1 time in total |
|
Back to top |
|
|
htamas |
Posted: Sun Apr 01, 2007 12:42 am Post subject: |
|
|
Developer
Age: 21 Joined: 10 Aug 2006 Status: Offline Posts: 89 Location: Budapest, Hungary
|
starwindz wrote: |
I got an error (drawmap.c unknown 355). |
Did you install ImageMagick? |
|
Back to top |
|
|
starwindz |
Posted: Sun Apr 01, 2007 6:44 am Post subject: |
|
|
Valued Contributor
Age: 36 Joined: 12 Jan 2007 Status: Offline Posts: 810 Location: South Korea
|
|
Back to top |
|
|
htamas |
Posted: Sun Apr 01, 2007 11:56 pm Post subject: |
|
|
Developer
Age: 21 Joined: 10 Aug 2006 Status: Offline Posts: 89 Location: Budapest, Hungary
|
starwindz wrote: |
Yes, I have installed ImageMagick.
Hmm... I will check it out again. |
I just thought that, because previously jalal had the same error message, and solved that by installing the ImageMagick libs (quotes from PM):
jalal wrote: |
Hi,
I tired it, but I got an error:
drawmap.c unknown 355 |
By the way, I've updated the utility to give a bit more verbose error messages, such as "NoDecodeDelegateForThisImageFormat `tiles1.png'". |
|
Back to top |
|
|
poirot |
Posted: Mon Apr 02, 2007 1:04 am Post subject: |
|
|
Princed Developer
Age: 25 Joined: 28 May 2006 Status: Offline Posts: 264 Location: Buenos Aires/Ushuaia
|
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. |
|
Back to top |
|
|
starwindz |
Posted: Tue Apr 03, 2007 2:39 am Post subject: |
|
|
Valued Contributor
Age: 36 Joined: 12 Jan 2007 Status: Offline Posts: 810 Location: South Korea
|
|
Back to top |
|
|
blood_445 |
Posted: Wed Apr 11, 2007 1:51 pm Post subject: |
|
|
The Prince of Persia
Age: 16 Joined: 30 Aug 2006 Status: Offline Posts: 1773 Location: Dahye, Lebanon
|
wow, nice, I will make the maps of my mods _________________ if you can see the future..... you can save it.....
you cannot change your fate... no man can...
|
|
Back to top |
|
|
jalal |
Posted: Sun Jun 24, 2007 8:37 am Post subject: |
|
|
Site Admin
Age: 20 Joined: 04 Dec 2005 Status: Offline Posts: 2698 Location: Lebanon
|
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. _________________ And we burned in the wine of our lips
And we were born again |
|
Back to top |
|
|
mk1994 |
Posted: Thu Aug 16, 2007 3:39 pm Post subject: |
|
|
The Prince of Persia
Age: 12 Joined: 26 Jun 2007 Status: Offline Posts: 6251 Location: Germany
|
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? _________________ We have a little cat,
the name is Simone.
Sie pullert auf's Parkett,
das riecht zwar nich ohne,
but is ma keen Parkett,
doing Simone a very bit klug,
she's schnurring beauty nett
and secht in DJ's shoe.
Angelsächsisch for yuh - MaxiMal
The Princess in Danger
The Princess in Danger 2 |
|
Back to top |
|
|
|