[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Prince of Persia cheating, Continued
> > The only downside is that if there is any code updating these variables
> > at the same time it could cause a really horrible race condition.
> > Hopefully that won't be the case though.
>
> Hmmm. I would have expected that your recent experience with threads would
> have convinced you that Murphy loves non-determinism and has no respect for
> hope. ;-)
And you'd be right! Lesson learned: I update the event counter only after storing the new event data. That prevents the game from trying to use garbage values.
So the mouse cheat feature is done, and it's a whole lot smarter. Here is the summary:
- Right-click transports the prince (and puts his feet on the ground properly)
- If you right-click the ground just behind a gate, you will go around the gate. If you're not careful you will appear on the wrong side and start falling if there is no floor there. Feather-fall might be useful.
- Left-click on an enemy kills him dead and usually works on the first try now.
- Left-click on a gate opens it (with animation too, if it is not on the left edge)
- Left-click on a gate on the left edge will open it but the screen redraw is glitchy. It still works though.
- Left-click on the exit makes it blink open (I had to find the screen redraw buffers and hack those too.) This also causes the game to set up certain variables necessary for the game to handle the level ending logic (otherwise, just setting "gateopen=1" caused the game to crash after the prince ascended the stairs.)
All in all, this cheat feature renders the game almost totally pointless but makes it interesting in other ways and fun to explore. I've tried to activate the editor flag in hopes the commercial version had the editor features compiled in, but no such luck. We'd have to reassemble the program to use Mechner's editor (and he even blogged about making it, and I saw glimpses of the source, it might all be there.) It would be exciting to use Mechner's editor instead of Apropos (though Apropos is a great level editor in its own right).
The JACE source is updated in sourceforge's SVN for anyone curious to see how I've managed to hack PoP's internals. I have a lot of cleanup to do (it's kind of a mess, way too sparse on comments) but it seems relatively stable to use these cheats now; e.g. the prince no longer falls through the floor after you warp and such.
-B