kid pixel shifted

Threads about other remakes and ports.

Moderator: English Moderator Team

polipo
Vizier
Vizier
Posts: 89
Joined: September 6th, 2012, 8:34 am

kid pixel shifted

Postby polipo » October 29th, 2014, 9:44 am

Dear,
Can someone help me to determine all kid pixel shifted movement for all actions ?
Into the PoPsdl can i found this information, frame by frame ? how to calc it ?

I have some problem to compare the original Prince Of Persia action to Prince Of Persia.net.

For example, during a normal Standing Jump (STANDJUMP) action, how many pixel in X,Y kid is moved ?

A document brief with ACTION and X, Y pixel shift (+ or -) it will be usefull.

ACTION NAME X Y
standing jump +120 0

Thanks

[Edit: I have moved your post from the SDLPoP thread into a separate thread. --Norbert]

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

Re: kid pixel shifted

Postby Norbert » October 29th, 2014, 12:33 pm

standing jump 89 0

The simple jump is 18 frames. You can use PR to view /kid/simple jump/ in KID.DAT.
Added to those 18 frames are the 2 standing frames (normal.bmp), before and after the jump.
So, in total you will need (18 + 2 =) 20 frames to determine a) the distance, and b) the exact movement path.
You can get all the frames by playing PoP1 in DOSBox and making screenshots (How? See here and here.)
Start by pressing the ESC key. This will pause the game and show a "GAME PAUSED" message.
Then make the standing jump and immediately press ESC again.
Make a screenshot. Press ESC. Make a screenshot. Press ESC. And so on, to advance frame by frame.
By comparing the frames before and after the jump, you will see that the prince moved 89 pixels.
You will also have screenshots of all frames of the animation and will know exactly how the prince moved.

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

Re: kid pixel shifted

Postby David » October 29th, 2014, 1:53 pm

[Edit: I have moved your post from the SDLPoP thread into a separate thread. --Norbert]

... while I was writing my answer.

polipo wrote:Can someone help me to determine all kid pixel shifted movement for all actions ?
Into the PoPsdl can i found this information, frame by frame ? how to calc it ?


The sequence table (seqtbl[]) is in seg006.c, the offsets of each sequence (seqtbl_offsets[]) are in seg005.c.
The contents of seqtbl (sequence commands) are interpreted in play_seq() (seg006.c).
Among these commands are the "move x/y pixels" commands.
The frame table also has some x/y offsets. (frame_table_kid[] in seg006.c)
The meanings of the sequence IDs are scattered in comments at calls to seqtbl_offset_char().

These are the same things that you can find in the Apple II source, in SEQTABLE.S and FRAMEDEF.S.
I think I just found a removed feature in SEQTABLE.S: It's called "superhijump (when weightless)". Hmm...

I should really document these things...
Actually I have some documentation. I attached it to this post.
Attachments
internals_sequence.zip
(3.53 KiB) Downloaded 16 times

polipo
Vizier
Vizier
Posts: 89
Joined: September 6th, 2012, 8:34 am

Re: kid pixel shifted

Postby polipo » October 30th, 2014, 9:19 am

Thanks a lot, i downloaded and i have some question (i'm not a c programmer)

For example : how to determine the x shift for "standing jump" (ps i have removed lines not necessary for calc)

typedef struct frame_type {
byte image;
byte sword;
sbyte dx; //shift pixel x
sbyte dy; //shift pixel y
byte flags;
} frame_type;

const word seqtbl_offsets[] = {
0x0000, 0x1973, 0x19A0, 0x1A93, ....}

void __pascal far standing_jump() {
seqtbl_offset_char(3); // standing jump 0x1A93 hex = 6803 dec ?? what's that ??
} //standing jump index=3 found also in the csv file sequence

const frame_type frame_table_kid[] = {
{ 255, 0x00| 0, 0, 0, 0x00| 0},
{ 0, 0x00| 0, 1, 0, 0xC0| 4},
{ 1, 0x00| 0, 1, 0, 0x40| 4},
{ 2, 0x00| 0, 3, 0, 0x40| 7},
{ 3, 0x00| 0, 4, 0, 0x40| 8},
{ 4, 0x00| 0, 0, 0, 0xE0| 6},
{ 5, 0x00| 0, 0, 0, 0x40| 9},
{ 6, 0x00| 0, 0, 0, 0x40|10},
{ 7, 0x00| 0, 0, 0, 0xC0| 5},
{ 8, 0x00| 0, 0, 0, 0x40| 4},
{ 9, 0x00| 0, 0, 0, 0x40| 7},
{ 10, 0x00| 0, 0, 0, 0x40|11},
{ 11, 0x00| 0, 0, 0, 0x40| 3},
{ 12, 0x00| 0, 0, 0, 0xC0| 3},
{ 13, 0x00| 0, 0, 0, 0x40| 7},
{ 14, 0x00| 9, 0, 0, 0x40| 3},
{ 15, 0x00| 0, 0, 0, 0xC0| 3},
{ 16, 0x00| 0, 0, 0, 0x40| 4}, //initial standing jump frame but the x=0 and y=0 to until index=33
.......

In my PoP.net the standing jump begin with the FRAME = 16 and end at FRAME =33, i think isnt the right corrispondence in frame_table_kid

I lost somethings... can i help me ?

Thanks

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

Re: kid pixel shifted

Postby David » October 30th, 2014, 10:54 am

0x1A93 hex = 6803 dec ?? what's that ??

In seqtbl[] find element with index 0x1A93 - 0x196E = 0x125. (I think I should add some line breaks in that table...)
There you'll find these elements:
0xF9,0x01, -> Action 0x01 (run/jump)
0x10, -> frame 0x10
0x11, -> frame 0x11
0xFB,0x02, -> delta x=0x02
0x12, -> frame 0x12
0xFB,0x02, -> delta x=0x02
and so on...

I know that it is hard to read (even for me!), so I made a table that makes reading seqtbl easier.
I attached it to this post. (I had it for a while, sorry for not posting it earlier!)
Attachments
pop1seq.zip
(165.92 KiB) Downloaded 15 times

polipo
Vizier
Vizier
Posts: 89
Joined: September 6th, 2012, 8:34 am

Re: kid pixel shifted

Postby polipo » October 31st, 2014, 8:58 am

David, you material its like a gold.
There a miss understand in pixel anim movement.
For example:
standjump : i sum the delta in hex and the result in dec is X=39, but is a short jump, in grab anim picture on real pcdos it was X=178
Wheres the trick?

thanks a lot

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

Re: kid pixel shifted

Postby David » October 31st, 2014, 12:36 pm

1. On-screen X=178 is actually 89. Your screenshots were probably stretched to double size. (DOSBox does that.)
2. The "trick" is that there are two ways of measuring the X coordinate. (Actually three, see internals_sequence-table.txt in internals_sequence.zip)
There is the "Char" system, where one tile is 14 units wide. -- This is used in the sequence table.
And there is the "Screen" system, where one tile is 32 units wide. -- This is used on the screen.
The conversion is: X_Screen = X_Char * 32/14.
In your example, 39 * 32/14 ≈ 89.


Return to “Other Remakes and Ports”

Who is online

Users browsing this forum: No registered users and 1 guest