Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Second part of the best game ever made.
FluffyQuack
Vizier
Vizier
Posts: 100
Joined: June 6th, 2004, 7:05 pm

Re: Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Post by FluffyQuack »

Correction to something I had written above. There's 8 frames in the run animation loop -- not 6. Realizing this, I re-calculated how far the player moves between the 2 jump-able frames, and each interval is very close to one tile. I wonder if they had the logic of "We only need to check once per tile if the player is trying to do a jump while running, and with that change we can throw out the system from POP1 where we delay jumps until player is closer to an edge" and then they just didn't fully consider the fact that the player has a granular, sub-tile position and they'd need to drastically increase the range for "locking onto" a tile when doing running jumps.
David
The Prince of Persia
The Prince of Persia
Posts: 2863
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Post by David »

FluffyQuack wrote: January 29th, 2024, 12:10 am The game soft-locked after the epilogue when entering my name into the hall of fame. Tapping buttons on my controller just resulted in random characters being written and there was no way to press "enter"
By the way, how is the player supposed to enter their name on a real Xbox?
Did the developers even consider that? Or did they just assume that PoP2 is so hard that nobody is going to finish it? :)
FluffyQuack wrote: January 30th, 2024, 6:14 pm And here's the glitch on the Hall of Fame screen: https://www.twitch.tv/fluffyquack/clip/ ... x2nr6UVjmt
The random characters are: (&''''&('(&(ss

Hmm, it's as if the Virtual Key Codes of arrow keys were interpreted as ASCII codes.

Namely:
left = 0x25 = %
up = 0x26 = &
right = 0x27 = '
down = 0x28 = (

(Seriously, when I saw those symbols in the video, my first thought was "Windows virtual key codes of arrows". How do I even know these kinds of things? :) )

The percent sign does not appear in the video, though.
I can't type it in the DOS version of PoP2, either, and I think I know why.
The zip at the bottom of this post contains the fonts from PoP1 and PoP2.
font00010.fn2.txt contains the font used for the Hall of Fame and saved games.
It has no glyph for the percent sign. That may be why it cannot be typed.
FluffyQuack
Vizier
Vizier
Posts: 100
Joined: June 6th, 2004, 7:05 pm

Re: Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Post by FluffyQuack »

David wrote: February 3rd, 2024, 9:06 pmBy the way, how is the player supposed to enter their name on a real Xbox?
Did the developers even consider that? Or did they just assume that PoP2 is so hard that nobody is going to finish it? :)

The random characters are: (&''''&('(&(ss

Hmm, it's as if the Virtual Key Codes of arrow keys were interpreted as ASCII codes.

Namely:
left = 0x25 = %
up = 0x26 = &
right = 0x27 = '
down = 0x28 = (

(Seriously, when I saw those symbols in the video, my first thought was "Windows virtual key codes of arrows". How do I even know these kinds of things? :) )

The percent sign does not appear in the video, though.
I can't type it in the DOS version of PoP2, either, and I think I know why.
The zip at the bottom of this post contains the fonts from PoP1 and PoP2.
font00010.fn2.txt contains the font used for the Hall of Fame and saved games.
It has no glyph for the percent sign. That may be why it cannot be typed.
Good finds! That would explain why those symbols were the ones to pop up. If I recall, I tried pressing every single button the controller.

I kind of wish I still had my original Xbox so I could be 100% sure it happens on a real system. I know Xbox 360 has a system-level feature where a game can request a virtual keyboard to pop up and then the user writes on that using the gamepad. I have no idea if the original Xbox had that. You do write your profile name in the main menu for Sands of Time, and that uses a virtual keyboard that's part of the game itself.

I stumbled on this video, which I think is the only video on Youtube showing the game get completed on a real Xbox:


At the end of the video, you can see the Hall of Fame screen. You only see the screen for 3 seconds, but I feel it's rather telling how the list is empty and that you don't see any virtual keyboard pop up. So, yeah, it's looking like this is just a very, very silly bug. Maybe they ran out of development time and figured it was a shippable bug.
AJprince
Efendi
Efendi
Posts: 16
Joined: December 20th, 2021, 9:10 pm

Re: Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Post by AJprince »

I managed to find the same code in v1.0 (I must have done a mistake when searching for it the other day). So people can apply these changes to the v1.0 DOS EXE if they want running jumps that feel the same as in POP1:

Offset: 0x3197F: change 74 to 7D (jz to jge)
Offset: 0x31A53: change 0B F6 7D 09 83 FF 04 75 04 2B C0 EB 28 to 83 FE 00 7C 08 83 FF 04 75 03 EB 25 90
I just finished the POP2 1.0 version with this change and it felt great! Not having to stop and position the prince for a jump is a game changer. Kudos to FluffyQuack, yay!
FluffyQuack
Vizier
Vizier
Posts: 100
Joined: June 6th, 2004, 7:05 pm

Re: Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Post by FluffyQuack »

AJprince wrote: February 19th, 2024, 11:25 pm
I managed to find the same code in v1.0 (I must have done a mistake when searching for it the other day). So people can apply these changes to the v1.0 DOS EXE if they want running jumps that feel the same as in POP1:

Offset: 0x3197F: change 74 to 7D (jz to jge)
Offset: 0x31A53: change 0B F6 7D 09 83 FF 04 75 04 2B C0 EB 28 to 83 FE 00 7C 08 83 FF 04 75 03 EB 25 90
I just finished the POP2 1.0 version with this change and it felt great! Not having to stop and position the prince for a jump is a game changer. Kudos to FluffyQuack, yay!
That's good to hear! I'm glad you found this to be an improvement. I found myself enjoying the game a lot more when I did a playthrough with the change, and it makes it so much easier to bounce between POP1 and POP2.
FluffyQuack
Vizier
Vizier
Posts: 100
Joined: June 6th, 2004, 7:05 pm

Re: Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Post by FluffyQuack »

As requested by AJprince, I've found the modifications necessary for the FM Towns versions of POP2:

Offset: 0x13EF1: change 74 to 7D (jz to jge) (search for 74 23 83 3E if offset is wrong)
Offset: 0x13FD5: change 7D to 7C (jge to jl) (search for 0B DB 7D 0C 83 if offset is wrong)

I don't have an FM Towns emulator set up so I can't test if this works, but in theory it should be fine. If anyone can verify it works, that would be good.

By the way, I realized something huge while working on this. The FM Towns version of POP2 has debug symbols present in the executable!
AJprince
Efendi
Efendi
Posts: 16
Joined: December 20th, 2021, 9:10 pm

Re: Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Post by AJprince »

FluffyQuack wrote: October 25th, 2024, 3:31 am As requested by AJprince, I've found the modifications necessary for the FM Towns versions of POP2:

Offset: 0x13EF1: change 74 to 7D (jz to jge) (search for 74 23 83 3E if offset is wrong)
Offset: 0x13FD5: change 7D to 7C (jge to jl) (search for 0B DB 7D 0C 83 if offset is wrong)

I don't have an FM Towns emulator set up so I can't test if this works, but in theory it should be fine. If anyone can verify it works, that would be good.

By the way, I realized something huge while working on this. The FM Towns version of POP2 has debug symbols present in the executable!
Yes, it works! Wonderful! Thanks FluffyQuack. :D

For anyone that wants to know:
The way I got it to work was to extract a cue/bin of POP2 for the FM Towns with bchunk. That produced an .iso and audio .cdr track. With the .iso, I extraced the files and edited the prince.exe file with FluffyQuack's magic.
Create an .iso of the extracted files with all the folders and the new prince.exe and you have to run the new .iso through some IPL.com program (attached). Command line: "IPL IPL.BIN new.iso"

Play that new .iso and the cd audio won't be there but the game works with the Prince 1 edge detection magic.
As you may know, the FM Towns version allows for play game speed changes as well as fighting speed changes just like SDLPop. FM Towns also allows for difficulty changes (less or more potions at the start).

If anyone knows how to add the cd audio back as like a second track, I've been searching around and haven't found out yet. Cheers and happy Princing.
Attachments
IPL.zip
(19.67 KiB) Downloaded 38 times
AJprince
Efendi
Efendi
Posts: 16
Joined: December 20th, 2021, 9:10 pm

Re: Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Post by AJprince »

Got it to work with music! :D Unfortunately I needed different computers. :/

bchunk (Debian)
HexFiend (Mac)
mkisofs (Debian)
IPL.com (in DosBox)
IsoBuster (Windows) - this one let me open the .iso and save it again into a raw .bin image.
truncate (Debian) - we have to pad the new raw .bin file to be the same size as the original.
(I had to do "truncate -s 52038000 new.bin")

Use the original .cue file and change the track 1 name to your new .bin image.
(this assumes your original bin/cue had multiple bin files, one for track 1 and the other for track 2)

Then load that .cue file in Tsugaru FM Towns emulator and experience the wonder!
Thanks to FluffyQuack for a wonderful hack!
FluffyQuack
Vizier
Vizier
Posts: 100
Joined: June 6th, 2004, 7:05 pm

Re: Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Post by FluffyQuack »

AJprince wrote: October 30th, 2024, 10:17 pm Got it to work with music! :D Unfortunately I needed different computers. :/

bchunk (Debian)
HexFiend (Mac)
mkisofs (Debian)
IPL.com (in DosBox)
IsoBuster (Windows) - this one let me open the .iso and save it again into a raw .bin image.
truncate (Debian) - we have to pad the new raw .bin file to be the same size as the original.
(I had to do "truncate -s 52038000 new.bin")

Use the original .cue file and change the track 1 name to your new .bin image.
(this assumes your original bin/cue had multiple bin files, one for track 1 and the other for track 2)

Then load that .cue file in Tsugaru FM Towns emulator and experience the wonder!
Thanks to FluffyQuack for a wonderful hack!
Good to hear it works!

This suggestion is a bit late, but since cue/bin files aren't compressed, I think you could hex edit the bin file (the one with file data) and search for the byte arrays to find relevant code and change it. Then you wouldn't have to extract the cd image and re-create it.

I've never played the FM Towns version, but by looking at a disassembly I can see some of the stuff it does. A difficulty variable (called EasyMode in the code) seems to alter the starting health of enemies, it can somehow affecting the spawning of enemies in a room, and, as you said, it affects the starting health of the player.

I found one instance of a gameplay change that's not related to any setting. During combat and while outside range of the player, an enemy will consider advancing towards the player. Each tick the enemy will advance based on a random chance (how likely it is depends on the enemy). This code is slightly different in FM Towns compared to the Xbox (which I'm very sure is based on 1.0 code) and 1.1 versions of the game. In the FM Towns version, each time the guard considers to advance, he will not consider again for another 7 gameplay ticks (that should be 700ms as combat runs at 10fps by default).

I'm not sure if there are other hidden changes, but that's one small example of the developers making the FM Towns version slightly easier than the original.
AJprince
Efendi
Efendi
Posts: 16
Joined: December 20th, 2021, 9:10 pm

Re: Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Post by AJprince »

I think you could hex edit the bin file (the one with file data) and search for the byte arrays to find relevant code and change it.
Yes, I just tested and that completely works and is way more simple. Great suggestion. :D
Also, wonderful to hear about your investigations into the code.
AJprince
Efendi
Efendi
Posts: 16
Joined: December 20th, 2021, 9:10 pm

Re: Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Post by AJprince »

FluffyQuack wrote
I did encounter some funky bugs in the Xbox version. I'm not sure if those are bugs in the game or if if it's due to bad emulation (I used Xemu):
Magic carpet cutscene was invisible (but sound played)
The shadow randomly jumped to his death rather than going back into the player, but second time I tried it worked fine
The game soft-locked after the epilogue when entering my name into the hall of fame. Tapping buttons on my controller just resulted in random characters being written and there was no way to press "enter"
I just got out the original Xbox and tried out Pop2 from a softmod game backup of Sands...
- Magic carpet cutscene was visible
- Shadow worked and got the flame. When entering the prince's body again I couldn't move. I had to press start and pause the game and then after unpausing, I could move again.
- Random characters just the same but no softlock. No way to press enter. After a while a bell sounds 'cause I think it's reached max characters but still can't press enter but it doesn't freeze.

I completely agree with FluffyQuack and David that the developers didn't think or test the last part through.
The save screen doesn't allow entering text either and just puts the name of the level (Cave 2, e.g.)
1.png
FluffyQuack
Vizier
Vizier
Posts: 100
Joined: June 6th, 2004, 7:05 pm

Re: Are POP2's controls supposed to be this bad, or is something wrong with my setup?

Post by FluffyQuack »

AJprince wrote: November 6th, 2024, 12:28 amI just got out the original Xbox and tried out Pop2 from a softmod game backup of Sands...
- Magic carpet cutscene was visible
- Shadow worked and got the flame. When entering the prince's body again I couldn't move. I had to press start and pause the game and then after unpausing, I could move again.
- Random characters just the same but no softlock. No way to press enter. After a while a bell sounds 'cause I think it's reached max characters but still can't press enter but it doesn't freeze.

I completely agree with FluffyQuack and David that the developers didn't think or test the last part through.
The save screen doesn't allow entering text either and just puts the name of the level (Cave 2, e.g.)

1.png
Maybe the magic carpet bug was related to emulation, then.

It sounds like the hall of fame bug works the same way. When I said softlock, I meant you couldn't progress from the screen, not that the entire system freezes up. I find it pretty hilarious they didn't fix that before release. Maybe they did a last-minute change that broke it or they didn't have time to completely finish the port, but they deemed the port good enough for release.
Post Reply