PR 1.3.1 (final)

About PR usage and development, and about the POP format.
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

PR 1.3.1 (final)

Post by David »

Here is the new version, PR 1.3.1 (final).
Yes, I added the pre-release label back in 2013; so it lasted for, like, 5 years? :)

EDIT: The changes are:

Code: Select all

+ Fixed PoP2 palettes and added "paletteoffset" attribute.
- Fixed XML parsing error on tags without attributes.
- Added some better error messages.
- Added level numbers to PoP2 levels in resources.xml.
- Fixed some mistakes in file names in resources.xml.
- Don't crash on empty images.
- Report only the number of successfully exported resources.
Attachments
PR-1.3.1.zip
(373.59 KiB) Downloaded 340 times
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: PR 1.3.1 pre-release 2

Post by Norbert »

David wrote: May 12th, 2018, 11:05 pm Here is the new version, PR 1.3.1 (final).
Yes, I added the pre-release label back in 2013; so it lasted for, like, 5 years? :)
Maybe put this post you wrote about 1.3.1 (final) in a new thread?
Currently this "PR 1.3.1 pre-release 2" thread is a sticky thread that starts with a post that includes the second pre-release as an attachment.
I'll put 1.3.1 (final) on popot.org shortly, plus I'll mention it on Twitter/Facebook.
[Edit: Done.]
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: PR 1.3.1 pre-release 2

Post by David »

Norbert wrote: May 13th, 2018, 2:22 pm Maybe put this post you wrote about 1.3.1 (final) in a new thread?
Done.
I also removed stickiness from the old thread and made this new thread sticky instead.
And I added a list of changes (from the changelog) to the first post, because I saw that the previous topic also had such a list.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: PR 1.3.1 (final)

Post by Norbert »

How difficult would it be to add a command-line option to PR that would automatically change the transparent color of exported images to Jazz Blue (#5700CB)? If I'm not mistaken, it's not simply #000000 that would be changed to #5700CB. The parent folder of, for example, bricks03.bmp, has palette 200, which is dungeon.pal. And dungeon.pal has #000000 (0 0 0) as its first (= transparent) color. All pixels in bricks03.bmp using that first index of the indexed palette, that's where #5700CB would be the replacement. If dungeon.pal would have had #000000 (0 0 0) values in another indexes of the indexed palette, the pixels using these indexes would remain black in the final output.

The reason I'm asking this is, of course, that an export with Jazz Blue could allow me to give creating sprite sheets a shot. I'll probably start with vdungeon, which has a substantial amount of images (128, I think). The end result I have in mind is a single PNG file with all graphics double-sized (for future modding options), plus a .json file that explains where in the image all the resources - some overlapping - can be found.

[Edit: And, in the further, further future, PR could use the .json files.]
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: PR 1.3.1 (final)

Post by David »

Norbert wrote: September 22nd, 2018, 8:58 pm How difficult would it be to add a command-line option to PR that would automatically change the transparent color of exported images to Jazz Blue (#5700CB)? If I'm not mistaken, it's not simply #000000 that would be changed to #5700CB. The parent folder of, for example, bricks03.bmp, has palette 200, which is dungeon.pal. And dungeon.pal has #000000 (0 0 0) as its first (= transparent) color. All pixels in bricks03.bmp using that first index of the indexed palette, that's where #5700CB would be the replacement. If dungeon.pal would have had #000000 (0 0 0) values in another indexes of the indexed palette, the pixels using these indexes would remain black in the final output.
I think the simplest solution would be to edit the part where the palette is written into the BMP file: https://github.com/NagyD/PR/blob/master ... /bmp.c#L95
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: PR 1.3.1 (final)

Post by Falcury »

David wrote: September 23rd, 2018, 3:45 pm
Norbert wrote: September 22nd, 2018, 8:58 pm How difficult would it be to add a command-line option to PR that would automatically change the transparent color of exported images to Jazz Blue (#5700CB)? If I'm not mistaken, it's not simply #000000 that would be changed to #5700CB. The parent folder of, for example, bricks03.bmp, has palette 200, which is dungeon.pal. And dungeon.pal has #000000 (0 0 0) as its first (= transparent) color. All pixels in bricks03.bmp using that first index of the indexed palette, that's where #5700CB would be the replacement. If dungeon.pal would have had #000000 (0 0 0) values in another indexes of the indexed palette, the pixels using these indexes would remain black in the final output.
I think the simplest solution would be to edit the part where the palette is written into the BMP file: https://github.com/NagyD/PR/blob/master ... /bmp.c#L95
I'd be willing to give it a shot, to add a command-line option to PR that let's you choose the transparency color. And maybe exporting/importing to/from spritesheets instead of separate images too. Although I can't promise how long it will take (my only available time is during weekends).
I like the idea of spritesheets for graphics modding, because you would only need to modify one image file, instead of having to deal with many separate ones.
(As a side note, I don't think it would be necessary for SDLPoP to support spritesheets as well, because the functionality of a distribution/container format for images is already being provided by DAT files.)
User avatar
Emiliano
Wizard Scribe
Wizard Scribe
Posts: 718
Joined: July 31st, 2019, 8:53 pm
Location: Mexico
Contact:

Re: PR 1.3.1 (final)

Post by Emiliano »

There's still a mistake, I can't modify the walls in the vpalace.dat file :(
Please update it
65536
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: PR 1.3.1 (final)

Post by David »

Emiliano Fierro wrote: September 28th, 2019, 2:05 am There's still a mistake, I can't modify the walls in the vpalace.dat file :(
Please update it
Palace walls work differently from dungeon walls: they are made from single-colored rectangles.
So the only thing you can edit in VPALACE.DAT are the separator patterns and the palette (and the right side of the wall).

However, it's possible to change PRINCE.EXE to draw palace walls in the same way as dungeon walls.
* In CusPop, enable "WDA in palace", and download PRINCE.EXE.
* In PR's resources.xml, copy the walls section from the vdungeon section to the vpalace section.
(Make sure you have a copy of the original resource.xml. Or alternatively, you could save the changed file with a new name, and use it with the --resource= option of PR.)

Now you need a VPALACE.DAT compatible with "WDA in palace":
* Export both VDUNGEON.DAT and VPALACE.DAT.
* Delete the walls folder from vpalace.
* Copy the walls folder from vdungeon to vpalace.
* Copy the vdungeon\palette\walls.pal to vpalace\palettes\wall.pal (overwrite the existing file).
* Reimport VPALACE.DAT.
* Start PRINCE.EXE. The palace levels should have dungeon walls. Now you can edit them.

Alternatively, from the VPALACE.DAT page on PoPOT you can choose one of the files marked "WDA".
User avatar
Emiliano
Wizard Scribe
Wizard Scribe
Posts: 718
Joined: July 31st, 2019, 8:53 pm
Location: Mexico
Contact:

Re: PR 1.3.1 (final)

Post by Emiliano »

Thanks for the help
65536
User avatar
Emiliano
Wizard Scribe
Wizard Scribe
Posts: 718
Joined: July 31st, 2019, 8:53 pm
Location: Mexico
Contact:

Re: PR 1.3.1 (final)

Post by Emiliano »

Hi, I followed all your steps and made these file, it is the least altered possible and it's not a custom graphic
If you think this is duplicated or innecesary, you can delete it
You must reame it to vpalace.dat
Attachments
wda vpalace.dat
(22.61 KiB) Downloaded 98 times
65536
User avatar
Sting
Vizier
Vizier
Posts: 86
Joined: April 22nd, 2020, 1:49 pm
Location: Tunisia

Re: PR 1.3.1 (final)

Post by Sting »

I could not work with it is there a possibility of a tutorial video or a written steps because it does'nt even want to launch. thank you
Check out my first ever mod and rate it it is Journey in Mystery I hope I will improve next time, thank you :D :) :D
User avatar
Emiliano
Wizard Scribe
Wizard Scribe
Posts: 718
Joined: July 31st, 2019, 8:53 pm
Location: Mexico
Contact:

Re: PR 1.3.1 (final)

Post by Emiliano »

Go to CusPoP and enable this option
Now, you can use this file and if you want, you can edit the walls, in other post I will explain it
Attachments
WDA Option.png
65536
User avatar
Emiliano
Wizard Scribe
Wizard Scribe
Posts: 718
Joined: July 31st, 2019, 8:53 pm
Location: Mexico
Contact:

Re: PR 1.3.1 (final)

Post by Emiliano »

In a text editor search vpalace from resources.xml, later find walls folder

Code: Select all

  <folder name="walls" path="walls" palette="360">
   <item value="361" path="face stack main.bmp"/>
   <item value="362" path="face stack top.bmp"/>
   <item value="363" path="res363.bmp"/>
   <item value="364" path="res364.bmp"/>
   <item value="365" path="res365.bmp"/>
   <item value="375" path="res375.bmp"/>
   <item value="376" path="res376.bmp"/>
   <item value="377" path="res377.bmp"/>
   <folder name="patterns" colors="2">
   <item value="366" path="res366.bmp"/>
   <item value="367" path="res367.bmp"/>
   <item value="368" path="res368.bmp"/>
   <item value="369" path="res369.bmp"/>
   <item value="370" path="res370.bmp"/>
   <item value="371" path="res371.bmp"/>
   <item value="372" path="res372.bmp"/>
   <item value="373" path="res373.bmp"/>
   <item value="374" path="res374.bmp"/>
   </folder>
  </folder>
And replace it for the dungeon walls like this

Code: Select all

<folder name="walls" path="walls" palette="360">
   <item value="361" path="face stack main.bmp"/>
   <item value="362" path="face stack top.bmp"/>
   <item value="363" path="centre stack base.bmp"/>
   <item value="364" path="centre stack main.bmp"/>
   <item value="365" path="right stack base.bmp"/>
   <item value="366" path="right stack main.bmp"/>
   <item value="367" path="single stack base.bmp"/>
   <item value="368" path="single stack main.bmp"/>
   <item value="369" path="left stack base.bmp"/>
   <item value="370" path="left stack main.bmp"/>
   <item value="371" path="divider01.bmp"/>
   <item value="372" path="divider02.bmp"/>
   <item value="373" path="random block.bmp"/>
   <item value="374" path="mark01.bmp"/>
   <item value="375" path="mark02.bmp"/>
   <item value="376" path="mark03.bmp"/>
   <item value="377" path="mark04.bmp"/>
  </folder>
Those are the specific codes you need to search
65536
User avatar
Sting
Vizier
Vizier
Posts: 86
Joined: April 22nd, 2020, 1:49 pm
Location: Tunisia

Re: PR 1.3.1 (final)

Post by Sting »

I don't get it I am a little bad at that this is why it is better to perform a video tutorial of how to export and import from dat files but my problem also is the pr exe does not launch and I couldn't change anything in the xml file
Check out my first ever mod and rate it it is Journey in Mystery I hope I will improve next time, thank you :D :) :D
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: PR 1.3.1 (final)

Post by Norbert »

Sting wrote: May 15th, 2020, 2:25 pm I don't get it I am a little bad at that this is why it is better to perform a video tutorial of how to export and import from dat files but my problem also is the pr exe does not launch and I couldn't change anything in the xml file
Hi Sting.

The PR executable file does not launch a user interface (GUI).
It only prints output on the DOS prompt (console, command-line).

One thing that might help you is this PR.bat file.
Put this PR.bat in the same directory as the PR executable, and then run this BAT file.

If that doesn't help you, try watching this video.

Another solution is to use SDLPoP.
SDLPoP simply has all images in its data/ directory.
Also, unlike the DOS game, palettes do not limit the number of colors SDLPoP can display.
Post Reply