Dropped inputs

Open-source port of PoP that runs natively on Windows, Linux, etc.
Post Reply
FluffyQuack
Vizier
Vizier
Posts: 86
Joined: June 6th, 2004, 7:05 pm

Dropped inputs

Post by FluffyQuack »

I did a playthrough of SDL-PoP a few days ago. It was my first playthrough of POP in over a year and there's one thing that keeps bugging me, which is that the game will sometimes drop input. It happens very rarely, but it's often enough that I find it a bit annoying. I can remember experiencing it during older playthroughs too, but I decided to try to understand the problem more this time.

First of all, it happens in DOS Prince of Persia as well (I tested it briefly in Dosbox and the dropped input behaved the same way).

It's rather easy to test: have the Prince stand still and briefly tap left/right to turn the character, and keep trying to turn this way. If your taps are quick enough, you should notice around a quarter of the key presses don't lead to the character turning. If you hold the key slightly longer, then the character will turn reliably with each key press. But quick taps will sometimes be ignored.

I think what's happening is that every 83.33ms (that's the interval between each game update at 12fps) the game checks if specific keys are pressed down in order for the prince to do actions, but if you manage to press a key and release it within that 83.33ms interval window then the keypress ends up being ignored.

I'm curious if this is something other people have noticed and been annoyed by, or if people have gotten used to how the game expects button presses (that is, lengthy key presses are always reliable). I haven't tested if the same problem exists when playing in gamepad/joystick mode. Either way, I'll see if I can find a good fix for this and implement it to the SDL-PoP codebase.
FluffyQuack
Vizier
Vizier
Posts: 86
Joined: June 6th, 2004, 7:05 pm

Re: Dropped inputs

Post by FluffyQuack »

Here's a video example showing dropped input:


At the bottom part of the video you can see input as they're received by Windows (this is shown by another application).
FluffyQuack
Vizier
Vizier
Posts: 86
Joined: June 6th, 2004, 7:05 pm

Re: Dropped inputs

Post by FluffyQuack »

I've got the problem fixed now. If anyone wants to test it, I've uploaded a build of my fork with the fix here: https://github.com/FluffyQuack/SDLPoP/releases

Make sure to enter Settings->Gameplay and turn on "Enhanced mode" for the fix to take effect.

I think this makes the controls feel nicer, especially during combat.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: Dropped inputs

Post by Norbert »

From what I can tell by looking at the video, you play by tapping keys instead of holding them down. I personally never play like that, so I won't be a good candidate to test this. I also never felt something was broken, so I have difficulty seeing this as a "fix". I recall a YouTuber reviewing PoP1 saying the prince has "weight". Feels like you're trying to bump him to move, and he simply doesn't feel like it if you merely push him a little. :)
FluffyQuack
Vizier
Vizier
Posts: 86
Joined: June 6th, 2004, 7:05 pm

Re: Dropped inputs

Post by FluffyQuack »

I don't remember ever encountering the issue as a kid so I must have been used to holding down keys for any action. But in more recent times as I've been bouncing between many different games (and 99% of games react to any button press, no matter how brief it is, and some games will also trigger different actions depending on if it's a tap or hold), I've gotten used to tapping for certain actions. The last two times I played POP I would sometimes struggle parrying during combat but I didn't know why. It just felt like the game randomly ignored my input. After the second playthrough, I decided to look into it by going through the source code, and that's when I discovered the above problem.

That said, even with the fix, you still need to hold "up" to reliably do running jumps. That's because the game only checks if "up" is held during a specific part of the running animation.

I assume when people talk about the game feeling like it has weighty movement they're talking about how movement is driven by animations and the animations realistically feature acceleration and prince needing to crouch a little before jumping rather it being instant like most games. The weighty feel of the controls and movement feeling very methodical is part of the reason I like the gameplay so much.
Post Reply