How can I make 'the shadow' look exactly like the prince?

About PR usage and development, and about the POP format.

Moderator: English Moderator Team

Post Reply
elmaton
Sheikh
Sheikh
Posts: 26
Joined: October 6th, 2015, 7:52 am

How can I make 'the shadow' look exactly like the prince?

Post by elmaton » October 9th, 2015, 12:35 pm

I've tried to change the palette of "the shadow" folder with the palette from the "kid" folder.
Because in the "folder shadow", the shadow looks exactly like the prince but in the game he doesn't. :?

What I've tried won't work, has anyone an idea how to do that. :?:

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3139
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: How can I make 'the shadow' look exactly like the prince?

Post by Norbert » October 9th, 2015, 2:52 pm

elmaton wrote:I've tried to change the palette of "the shadow" folder with the palette from the "kid" folder.
Because in the "folder shadow", the shadow looks exactly like the prince but in the game he doesn't. :?

What I've tried won't work, has anyone an idea how to do that. :?:
After extracting the original (unaltered) game with PR, you will find that res750.pal in the shadow/ directory is actually the same as kid.pal in the kid/ directory. If you compare the files you will see that they are already the same. :) The reason is that, for the shadow, Mechner exclusive-OR'ed each frame with itself (the executable does this, not the images themselves), bit-shifting it one pixel over. He talks about this on page 67 of his book "The Making of Prince of Persia" (page) and also starting 18:34 in this video.

Anyway, if you use apoplexy to place a shadow in level 12(a), you will see it already looks like the prince in-game. It has no dying sprites though, which means the game might crash if the prince kills the shadow. PRINCE.EXE only changes the falling shadow that appears in room 15. CusPop has several shadow related settings, and it might be expandable to include an option to disable the exclusive-OR'ing. Or maybe you could alter the shadow's images in such a way that XOR'ing them will show the regular prince. But the easiest solution is probably to ask someone to include an option to turn blit_xor (or something) off in SDLPoP, and just work with SDLPoP to edit other images.

David
The Prince of Persia
The Prince of Persia
Posts: 1496
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: How can I make 'the shadow' look exactly like the prince?

Post by David » October 10th, 2015, 2:28 pm

The XOR-ing is done in draw_objtable_item(). (seg008.c)
In SDLPoP, just move the "case 1: // shadow" line (and maybe the next line) up a few lines, above add_midtable().
Or just remove the line that contains "blitters_3_xor".

It looks like this in the original game:

Code: Select all

seg008:20E2 3D 01 00                             cmp     ax, 1
seg008:20E5 74 49                                jz      draw_shadow
seg008:20E7 E9 3A 01                             jmp     return
Search: 3D 01 00 74 49 E9 3A 01
Change: 49 to 03

@Norbert: Thanks for the journal link!
I didn't know that the prince is considered "cute"...
I was explaining to her why there are no enemies in Prince of Persia. The animations for the player’s character are so elaborate, there’s not enough memory left to add another character.
But then the guards were added...

elmaton
Sheikh
Sheikh
Posts: 26
Joined: October 6th, 2015, 7:52 am

Re: How can I make 'the shadow' look exactly like the prince?

Post by elmaton » October 14th, 2015, 1:59 pm

Thanks for support.
If I don't work with SDLPoP, which file and which line do I have to edit?

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3139
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: How can I make 'the shadow' look exactly like the prince?

Post by Norbert » October 14th, 2015, 3:07 pm

elmaton wrote:If I don't work with SDLPoP, which file and which line do I have to edit?
According to David's post above, you'd have to...
David wrote:Search: 3D 01 00 74 49 E9 3A 01
Change: 49 to 03
...by hex editing PRINCE.EXE.

An explanation how to hex edit PRINCE.EXE can be found here.

elmaton
Sheikh
Sheikh
Posts: 26
Joined: October 6th, 2015, 7:52 am

Re: How can I make 'the shadow' look exactly like the prince?

Post by elmaton » October 14th, 2015, 8:20 pm

:)
Worked Perfect!
You are awesome, guys!

elmaton
Sheikh
Sheikh
Posts: 26
Joined: October 6th, 2015, 7:52 am

Re: How can I make 'the shadow' look exactly like the prince?

Post by elmaton » November 1st, 2015, 7:10 pm

Hey guys once more I need your help. :(
Finished editing the levels with apoplexy.
Also I finished editing the resources with PR 1.3.
Now one big problems stops me from publishing my mod.

As you surely remember you helped me to hex-edit prince.exe to remove the XOR-ing from the shadow which worked fine.
BUT now i changed the resources of the kid (gave him a red suit) I did NOT change the resources of the shadow (white suit like original).
When I start a test play and the shadow appears in level 5 the XOR-ing isn't there, but the shadow is also red suited. :shock:
Why is that? How can that be? Didn't change the resources of the shadow.
I also tried to change the palette of the kid to give him the red suit (change white to red) but still the shadow appears in the same colors like the prince.

I don't get it, the shadow has its own resources + but the game uses the files from the kid?
I just figured out the resources of the shadow are only the ones for it fighting stances.
Is there a way to say the prince.exe to use another .DAT for the shadow?
What i want is a red suited prince and a white suited shadow in the levels 5 and 6
Please help me out guys. :(

Thank you

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3139
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: How can I make 'the shadow' look exactly like the prince?

Post by Norbert » November 3rd, 2015, 8:52 am

elmaton wrote:I just figured out the resources of the shadow are only the ones for it fighting stances.
Right.
elmaton wrote:Is there a way to say the prince.exe to use another .DAT for the shadow?
CusPop has a "Shadow Guy" filename setting.
You could create a new PRINCE.EXE using CusPop, then re-apply the other shadow hex edits.

elmaton
Sheikh
Sheikh
Posts: 26
Joined: October 6th, 2015, 7:52 am

Re: How can I make 'the shadow' look exactly like the prince?

Post by elmaton » November 3rd, 2015, 9:58 am

Thanks, but I'm doing a dos mod and using apoplexy.
Apoplexy has another prince.exe than the one from CusPop.
Last time I tried to modificate a prince.exe with cuspop and replace it, the game didn't run properly.
Like I showed in another post (the screen was nearly completely black where the chompers were, etc...
Can I edit the existing prince.exe in apoplexy to give the shadow a new .dat?
Also I dodn't get how to use the cuspop downloaded! The prince.exe I've edited was with the web based version,
can you explain how tu use it?
Last edited by elmaton on November 3rd, 2015, 10:07 am, edited 1 time in total.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3139
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: How can I make 'the shadow' look exactly like the prince?

Post by Norbert » November 3rd, 2015, 10:02 am

elmaton wrote:Apoplexy has another prince.exe than the one from CusPop.
If you use "prince.exe 1.0 unpacked" it is the same.
Don't use a packed version, because then CusPop cannot enable all resources.

elmaton
Sheikh
Sheikh
Posts: 26
Joined: October 6th, 2015, 7:52 am

Re: How can I make 'the shadow' look exactly like the prince?

Post by elmaton » November 3rd, 2015, 10:12 am

In the prince.exe Cuspop uses, there is Shadow Guy already using shadow.dat
I think u can edit the shadow guy - graphics only for its fighting stances.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3139
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: How can I make 'the shadow' look exactly like the prince?

Post by Norbert » November 3rd, 2015, 10:22 am

elmaton wrote:I think u can edit the shadow guy - graphics only for its fighting stances.
Oh, yeah, we just established that above. (Doh. Sorry...)
The only solution I can think of is to use David's SDLPoP.
Unfortunately, I cannot help you with that nor do I know how much work it would be.
David is, of course, very familiar with the SDLPoP code, so maybe he knows.

elmaton
Sheikh
Sheikh
Posts: 26
Joined: October 6th, 2015, 7:52 am

Re: How can I make 'the shadow' look exactly like the prince?

Post by elmaton » November 3rd, 2015, 10:48 am

Ok thank you.
Maybe I just leave the shadow red suited also.
This makes the mod indeed imperfect, but I've put quite a lot work in it.
The idea I had for this one (my first mod) is also great, i think.
After a complete testrun, I will publish it, because there is nothing worse, than a incomplete or faulty mod being published.

Where can I publish it, by the way?
Regards Wolfgang

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3139
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: How can I make 'the shadow' look exactly like the prince?

Post by Norbert » November 3rd, 2015, 11:54 am

elmaton wrote:Where can I publish it, by the way?
You can simply attach a ZIP of the mod to a post in a new thread on the New Levels and Mods For DOS board.
Then I'll add a copy of it to popot.org, which automatically makes the mod available in Total Pack.

Post Reply