Hacking OpenSupaplex for PS Vita

sergiou87

Active Member
OP
Newcomer
Joined
Apr 28, 2019
Messages
31
Trophies
0
Age
36
XP
749
Country
Spain
Supaplex is a video game created by Philip Jespersen and Michael Stopp, two Swiss students, and published by Digital Integration in 1991.

And after almost two months of work, I've reverse-engineered (almost) the whole game and reimplemented it in C. It's a 1:1 clone of the original game for PC, using the original data files, and it's completely open source and available under the GPLv3 license with the name OpenSupaplex from my GitHub repository: https://github.com/sergiou87/open-supaplex

If you're interested about this reverse-engineering process, I talked about it in this thread: https://twitter.com/sergiou87/status/1254364851419447298

Description

Supaplex is an extended clone of Boulder Dash, but it introduces a number of new elements that were not present in Boulder Dash, including bugs, pieces of base that randomly cause a life-threatening electrostatic discharges, Ports, which limit Murphy's movement to specific directions, and terminals, which set off yellow Utility Disks. Utility Disks are explosive floppy disks and come in three different colors: Orange Disks work like Zonks, but explode when hit or when falling. Yellow Disks do not fall yet may be pushed in any direction, but not pulled (which allows creating Sokoban-like puzzles), and explode when the Terminal is used. Red Disks can be carried and dropped when convenient, exploding seconds after.

Supaplex is the first Boulder Dash-like game that is not fully grid-based: while the playing field is an obvious grid, the objects do not 'snap' from one grid position to another, but can be halfway or 'in between' grid positions while moving or falling. This behavior has led to a number of well-known bugs that can be turned to the player's advantage, many of which need to be exploited to complete fan-made levels. For instance, by turning around quickly, the player can cause an enemy or rock to 'bounce' off Murphy.

The game also applies 'gravity' on some levels, which means that Murphy will fall down empty spaces and will be unable to go back up, unless he climbs up by using bases. Gravity is not actually designated - the player can only notice via trial-and-error.

Changelog

v7.1.1:

FIXED:
  • LB/L1/L and RB/R1/R buttons won't change the game speed anymore when used in the main menu.
  • Wii and Wii U ports had the wrong title in the Homebrew Channel.
  • Fixed game panel behavior when you restart a level with it hidden. Now it will be shown when you restart a level.

v7.1:

NEW:

  • Added support for PSP, Nintendo 3DS, Windows 64bit, macOS, PS3, Wii and Wii U.
  • Added Music and Sound Effects.
  • Added support for saving and loading game states.
  • Bumped the default game speed from 5 to 10 (maximum).
  • Added different scaling modes.
  • Improved gamepad controls:
    • LB/L1/L and RB/R1/R buttons can be used in the main menu to select a different level set.
    • LB/L1/L and RB/R1/R buttons can be used in during the game to change the game speed.
    • Y/Triangle button (X on Nintendo consoles) shows/hides the bottom panel during the game.
    • B/Circle button (A on Nintendo consoles) displays, for a few seconds, the number of red disks you have.
    • Back/Select/Minus during a game will exit the level immediately.
    • Start/Plus during a game will pause the game.
  • Added advanced menu giving access to many options that were only available with a keyboard before, or not available at all:
    • Restart the level.
    • Sound and music volume.
    • Change the scaling mode.
    • Game speed.
    • Play/record demos.
    • Debug options (show FPS, load/save state, remove Zonks/Snik Snaks…). If you use these, your progress won't count!!
    • And more things!
  • Added command line options in platforms that support this. Just run the game with --help for more info.
FIXED:
  • Fixed many MANY bugs. Now the game should behave exactly as the original, validated by almost 7000 pre-recorded demos.
v7.0:
This is the initial version for Nintendo Switch and PS Vita. I chose version 7.0 because the original game and its subsequent updates went up to 6.3.

Almost everything has been reimplemented and the game is playable and can be finished. Otherwise, please, report bugs in my GitHub repository!

The main thing missing is music and sound effects. I'll be working on that soon.

There are also other things that are already working but can't be used from Nintendo Switch or PS Vita: recording demos, changing the game speed, using some debug actions (or cheats)…

I also intend to improve the key bindings and add support for more platforms! (Windows, macOS, Linux, Nintendo 3DS, PSP…) Stay tuned :)

Download

Source code and downloads available in the Github repo: https://github.com/sergiou87/open-supaplex

You can also download it from the Homebrew Vita Browser or VitaDB: https://vitadb.rinnegatamante.it/#/info/552

Enjoy!

Controls

- Up/Down/Left/Right: left joystick or directional pad
- Removing bases/infotrons next to Murphy: Square button + direction
- Detonate red disk: hold Square button
- Show/hide bottom game panel: Triangle button
- Show number of red disks: Circle button
- Change game speed: L and R buttons
- Exit/back: Select button
- Pause: Start button

Screenshots


upload_2020-5-6_0-14-58-png.207790


upload_2020-5-6_0-15-11-png.207791


upload_2020-5-6_0-15-20-png.207792


upload_2020-5-6_0-15-36-png.207793
 
Last edited by sergiou87,

niuus

Well-Known Member
Member
Joined
Mar 4, 2016
Messages
2,023
Trophies
1
XP
4,456
Country
Venezuela
Pretty cool port! I will be waiting the next version with better speed, music and effects, i could never play it with Sound Blaster sounds! :D

One suggestion: some simple video options, even through the use of a .ini? Integer pixel scaling would eliminate the shimmering when scrolling.
 

sergiou87

Active Member
OP
Newcomer
Joined
Apr 28, 2019
Messages
31
Trophies
0
Age
36
XP
749
Country
Spain
Pretty cool port! I will be waiting the next version with better speed, music and effects, i could never play it with Sound Blaster sounds! :D

One suggestion: some simple video options, even through the use of a .ini? Integer pixel scaling would eliminate the shimmering when scrolling.

I intend to add some kind of "advanced menu" to allow using integer pixel scaling. I have other priorities right now (like music and effects), but it's definitely in my list :D

What do you mean by "better speed" though? In theory it's running just like the original (from PC, not Amiga).
 

niuus

Well-Known Member
Member
Joined
Mar 4, 2016
Messages
2,023
Trophies
1
XP
4,456
Country
Venezuela
I intend to add some kind of "advanced menu" to allow using integer pixel scaling. I have other priorities right now (like music and effects), but it's definitely in my list :D

What do you mean by "better speed" though? In theory it's running just like the original (from PC, not Amiga).
Well, i haven't played the original in a great while, but it seemed much more fluid and speedy. For example, check how the time passes, it is slower than full seconds.

Now that you mentioned it, i checked YT gameplay:

And yep, it is faster.

Did not knew the game came from Amiga, i was exclusively a DOS gamer in my childhood. :)
 
Last edited by niuus,

sergiou87

Active Member
OP
Newcomer
Joined
Apr 28, 2019
Messages
31
Trophies
0
Age
36
XP
749
Country
Spain
Out of curiosity, in which PC did you play it back then?

My theory is that video isn't running the "speed fix": http://www.elmerproductions.com/sp/history.html#c_around

Basically the logic of the original game was not time-dependant, the speed of the game was faster in faster CPUs. So when it was developed for PC initially, seems like it was designed for 70Hz screens but the computers were so slow it took about 2 frames to update the logic and render the screen, so it was effectively running at 35fps, which is what I limited the gameplay to. From the SPFIX63.DOC file that you can find nowadays in some Supaplex bundles:

Code:
        +-------------------------------------------------------------+
        | HOW TO DEFINE SUPAPLEX SPEED, AND WHAT IS THE CORRECT SPEED |
        +-------------------------------------------------------------+
I took my 286/10 for the Supaplex speed reference.  I use the standard demo
which is started from the menu with the F2 key, and check the panel time at
the end of that demo. (The panel clock always seems to run correctly.)
My speed reference is 2 minutes and 9 (+/-1) seconds for that demo.
On my Pentium 133 this time was exactly half of this: 1 minute 4(5) seconds.
Until now I do not have a definitive answer from Robin Heydon how fast
Supaplex is supposed to run, except that the slower speed "feels right".
Does anyone object?  Please correct me if I take the wrong speed reference!
Several selected statements from Robin Heydon to me:
...
>>Well the game should run at 60Hz.  But on a PC it would run at 70Hz, due
to the video graphics hardware.  So it would run quicker than the original
Amiga Version.  Or though, not so quick that it makes it unplayable.<<
...
>>I have tried your version on this machine and it does 2min 10.  BUT I have
not tried an original version.  I don't have one, and no way of getting one.<<
(Note by Herman Perk: this is about original packaged Supaplex, not the ZIP!)
>>However, it does "Feel" right to me, and that's what is important in all
games.  Anyway, go and release it.  It should be excellent.  I've certainly
created a little interest on this side of the Atlantic.<<

It's true that I tried the Amiga version in an emulator, and unless I haven't configured the emulator properly, the game seems to run at 60fps, but feels a bit unplayable to me, too fast!! :rofl2:
Anyway, the PC/Mac version of OpenSupaplex (not released yet) already has speed controls, I just need to make those available to PS Vita and Nintendo Switch.

FWIW I also compared the speed of my implementation to that "speed fix" version running in DOSBox and looked fine to me:

And I just ran the demo with F2 described in the document above, and it took exactly 2min 10 seconds, so at least it's adhering to that "unofficial spec" :rofl2:
 

niuus

Well-Known Member
Member
Joined
Mar 4, 2016
Messages
2,023
Trophies
1
XP
4,456
Country
Venezuela
Out of curiosity, in which PC did you play it back then?

My theory is that video isn't running the "speed fix": http://www.elmerproductions.com/sp/history.html#c_around

Basically the logic of the original game was not time-dependant, the speed of the game was faster in faster CPUs. So when it was developed for PC initially, seems like it was designed for 70Hz screens but the computers were so slow it took about 2 frames to update the logic and render the screen, so it was effectively running at 35fps, which is what I limited the gameplay to. From the SPFIX63.DOC file that you can find nowadays in some Supaplex bundles:

Code:
        +-------------------------------------------------------------+
        | HOW TO DEFINE SUPAPLEX SPEED, AND WHAT IS THE CORRECT SPEED |
        +-------------------------------------------------------------+
I took my 286/10 for the Supaplex speed reference.  I use the standard demo
which is started from the menu with the F2 key, and check the panel time at
the end of that demo. (The panel clock always seems to run correctly.)
My speed reference is 2 minutes and 9 (+/-1) seconds for that demo.
On my Pentium 133 this time was exactly half of this: 1 minute 4(5) seconds.
Until now I do not have a definitive answer from Robin Heydon how fast
Supaplex is supposed to run, except that the slower speed "feels right".
Does anyone object?  Please correct me if I take the wrong speed reference!
Several selected statements from Robin Heydon to me:
...
>>Well the game should run at 60Hz.  But on a PC it would run at 70Hz, due
to the video graphics hardware.  So it would run quicker than the original
Amiga Version.  Or though, not so quick that it makes it unplayable.<<
...
>>I have tried your version on this machine and it does 2min 10.  BUT I have
not tried an original version.  I don't have one, and no way of getting one.<<
(Note by Herman Perk: this is about original packaged Supaplex, not the ZIP!)
>>However, it does "Feel" right to me, and that's what is important in all
games.  Anyway, go and release it.  It should be excellent.  I've certainly
created a little interest on this side of the Atlantic.<<

It's true that I tried the Amiga version in an emulator, and unless I haven't configured the emulator properly, the game seems to run at 60fps, but feels a bit unplayable to me, too fast!! :rofl2:
Anyway, the PC/Mac version of OpenSupaplex (not released yet) already has speed controls, I just need to make those available to PS Vita and Nintendo Switch.

FWIW I also compared the speed of my implementation to that "speed fix" version running in DOSBox and looked fine to me: https://twitter.com/sergiou87/status/1256740733433896967

And I just ran the demo with F2 described in the document above, and it took exactly 2min 10 seconds, so at least it's adhering to that "unofficial spec" :rofl2:
I used a 486DX2.

Interesting notes about the fix!

In any case, if you end up adding a speed selector, then it won't matter since it could be customizable, which will of course be great for more fluidity. :D

Eager to see your next version! Meanwhile i'll check out the new 0.2 of the N64 emu. B-)
 
  • Like
Reactions: sergiou87

sergiou87

Active Member
OP
Newcomer
Joined
Apr 28, 2019
Messages
31
Trophies
0
Age
36
XP
749
Country
Spain
Totally! Yesterday I reimplemented support for loading/saving snapshots. I hope to have sound and music soon, I need that!!

Regarding the speed, as you say it's kind of pointless with the speed selector. But I can't help it, I need to know :rofl2: So I just asked the original author of the game about it:
 
  • Like
Reactions: niuus

sergiou87

Active Member
OP
Newcomer
Joined
Apr 28, 2019
Messages
31
Trophies
0
Age
36
XP
749
Country
Spain
NEW:
  • Added support for PSP, Nintendo 3DS, Windows 64bit, macOS, PS3, Wii and Wii U.
  • Added Music and Sound Effects.
  • Added support for saving and loading game states.
  • Bumped the default game speed from 5 to 10 (maximum).
  • Added different scaling modes.
  • Improved gamepad controls:
    • LB/L1/L and RB/R1/R buttons can be used in the main menu to select a different level set.
    • LB/L1/L and RB/R1/R buttons can be used in during the game to change the game speed.
    • Y/Triangle button (X on Nintendo consoles) shows/hides the bottom panel during the game.
    • B/Circle button (A on Nintendo consoles) displays, for a few seconds, the number of red disks you have.
    • Back/Select/Minus during a game will exit the level immediately.
    • Start/Plus during a game will pause the game.
  • Added advanced menu giving access to many options that were only available with a keyboard before, or not available at all:
    • Restart the level.
    • Sound and music volume.
    • Change the scaling mode.
    • Game speed.
    • Play/record demos.
    • Debug options (show FPS, load/save state, remove Zonks/Snik Snaks…). If you use these, your progress won't count!!
    • And more things!
  • Added command line options in platforms that support this. Just run the game with --help for more info.
FIXED:
  • Fixed many MANY bugs. Now the game should behave exactly as the original, validated by almost 7000 pre-recorded demos.

I just updated OpenSupaplex for PS Vita (along with many other platforms) to version 7.1.

@niuus you'll be happy to know I added the speed selector I promised, increased the default speed to 60fps, added different scaling modes, and of course… sound and music :D Enjoy!
 
  • Like
Reactions: niuus

niuus

Well-Known Member
Member
Joined
Mar 4, 2016
Messages
2,023
Trophies
1
XP
4,456
Country
Venezuela
I just updated OpenSupaplex for PS Vita (along with many other platforms) to version 7.1.

@niuus you'll be happy to know I added the speed selector I promised, increased the default speed to 60fps, added different scaling modes, and of course… sound and music :D Enjoy!
Wow, this is nice! I'l happily test those Wii and Vita versions. Thanks for the tag, appreciated it.
 
  • Like
Reactions: sergiou87

niuus

Well-Known Member
Member
Joined
Mar 4, 2016
Messages
2,023
Trophies
1
XP
4,456
Country
Venezuela
I just updated OpenSupaplex for PS Vita (along with many other platforms) to version 7.1.

@niuus you'll be happy to know I added the speed selector I promised, increased the default speed to 60fps, added different scaling modes, and of course… sound and music :D Enjoy!
What a blast from the past, lol. B-)

Quick summary of my playtest:

(Wii)
- Load Supaplex. At the Main Menu, go into the advanced menu. Press resume. Music cracks.
- Minor music hiccups during normal playback.
- If you do not touch the controller, music stops almost completely at the transition between the menu and the demo, same if you press the demo button, or load a level.
- Music cracks when you press L1/R1 to select a different level set.
- Music cracks when exiting the game.
- All of the above (except the first) alleviate a bit when using USB.

- The dpad is rotated 90° clockwise in the Wii U Pro Controller/Wii Classic Controller, when in gameplay or in the advanced menu. - Left analog on those controllers works fine, though it won't go Left if you don't press right first, at least one time (Main Menu or in-game)
- No Gamecube controller input, so that also means no adapters to other console's gamepads (no GCN port in the future?)
- Game speed hotkeys (L1/R1) are still connected when in the Main Menu, so if you change level sets, you also affect the speed when going back to a level.
- OpenSupplex instead of OpenSupaplex in meta.xml
- One time, it gave me an Exception (DSI) crash when i went back to the Homebrew Channel. Couldn't reproduce it, maybe random.
* Working on both SD and USB.

(Wii U)
- Load Supaplex. At the Main Menu, go into the advanced menu. Press resume. Music cracks.
- Game speed hotkeys (L1/R1) are still connected when in the Main Menu, so if you change level sets, you also affect the speed when going back to a level.
- OpenSupplex instead of OpenSupaplex in meta.xml


Feature requests, if it is possible:
- 240p for the Wii port (maybe inside scaling options?)
- 4:3 aspect ratio (integer of full screen) when used on a 16:9 configured Wii, Wii U, or PSTV.
 
Last edited by niuus,
  • Like
Reactions: sergiou87

niuus

Well-Known Member
Member
Joined
Mar 4, 2016
Messages
2,023
Trophies
1
XP
4,456
Country
Venezuela
(PSTV)
- Game speed hotkeys (L1/R1) are still connected when in the Main Menu, so if you change level sets, you also affect the speed when going back to a level.
 
  • Like
Reactions: sergiou87

sergiou87

Active Member
OP
Newcomer
Joined
Apr 28, 2019
Messages
31
Trophies
0
Age
36
XP
749
Country
Spain
Wow! Thanks so much for the testing!!

I'm aware of the audio issues on Wii at the moment, not much I can do :'( but I'll investigate.

Regarding the controllers, on Wii only the Wiimote sideways is supported, and on Wii U only the gamepad. In the case of Wii it's an intended limitation to avoid overcomplicating the input code, on Wii U the problem is I don't have other controllers to test, and I need them to add proper support to SDL2 for Wii U :( I will create threads for those ports later today.

The "OpenSupplex" instead of "OpenSupaplex" is :blink: I checked that a hundred of times and never noticed :rofl2:

I'll fix that and make sure the speed doesn't change from the main menu.

- 240p for the Wii port (maybe inside scaling options?)
Why is this one interesting in your opinion?

- 4:3 aspect ratio (integer of full screen) when used on a 16:9 configured Wii, Wii U, or PSTV.
Doesn't this work already? :blink:

Thanks a lot for the feedback and bug reports, I really appreciate it!!!
 
  • Like
Reactions: niuus

niuus

Well-Known Member
Member
Joined
Mar 4, 2016
Messages
2,023
Trophies
1
XP
4,456
Country
Venezuela
Regarding the controllers, on Wii only the Wiimote sideways is supported, and on Wii U only the gamepad. In the case of Wii it's an intended limitation to avoid overcomplicating the input code, on Wii U the problem is I don't have other controllers to test, and I need them to add proper support to SDL2 for Wii U :( I will create threads for those ports later today.
In the case that you are not interested at all in supporting other controllers (which is basically already there. it is just the dpad thing bothering), could you make at least one build with the dpad rotated 90° counter-clockwise? lol. Thanks for considering it, anyway. :grog:

The "OpenSupplex" instead of "OpenSupaplex" is :blink: I checked that a hundred of times and never noticed :rofl2:
Hahaha, i have a certain 'clinical eye' for grammatical errors. (specially in my native language)

I'll fix that and make sure the speed doesn't change from the main menu.
Thanks. B-)

Why is this one interesting in your opinion?
When supported, 240p gives sharp, crisp, and beautiful pixel on CRTs, contrary to 480i which has a some video flickering (headache inducing for some sensitive persons). You can see it yourself, for example, by using Snes9X RX configured with Display > Original (which is 240p), a Wii with component cables, and a CRT TV (i use a Sony PVM). The quality is 99% identical to true SNES hardware and RGB output. Even ordinary composite video looks great with 240p when component is not an option.

Doesn't this work already? :blink:
The output was always stretched, in my case. On the Wii, Integer and Normal are the same.

Thanks a lot for the feedback and bug reports, I really appreciate it!!!
Happy to be of help.
 

sergiou87

Active Member
OP
Newcomer
Joined
Apr 28, 2019
Messages
31
Trophies
0
Age
36
XP
749
Country
Spain
Interesting, I think I know what the problem is with Wii in 16:9 mode. 240p is a whole other story, for different reasons haha But I'll think about it!
 
Last edited by sergiou87,
  • Like
Reactions: niuus

sergiou87

Active Member
OP
Newcomer
Joined
Apr 28, 2019
Messages
31
Trophies
0
Age
36
XP
749
Country
Spain
v7.1.1:

FIXED:
  • LB/L1/L and RB/R1/R buttons won't change the game speed anymore when used in the main menu.
  • Wii and Wii U ports had the wrong title in the Homebrew Channel.
  • Fixed game panel behavior when you restart a level with it hidden. Now it will be shown when you restart a level.

I just released version 7.1.1 which fixes some of the things you mentioned @niuus, thank you!

I took a look at the Wii issues you mentioned and they all need some changes in the SDL port. Not sure when I will have time to look into it, but if you're interested, I'll be happy to guide/assist you in where the changes are needed. From what I see, you already have the knowledge of how to do that :D At least the video part, the audio is trickier…
 
  • Like
Reactions: niuus

niuus

Well-Known Member
Member
Joined
Mar 4, 2016
Messages
2,023
Trophies
1
XP
4,456
Country
Venezuela
I just released version 7.1.1 which fixes some of the things you mentioned @niuus, thank you!

I took a look at the Wii issues you mentioned and they all need some changes in the SDL port. Not sure when I will have time to look into it, but if you're interested, I'll be happy to guide/assist you in where the changes are needed. From what I see, you already have the knowledge of how to do that :D At least the video part, the audio is trickier…
Can't say that i could achieve that, i'm just a filmmaker with an enthusiasm for emulation :grog:

Thanks for the bugfixes! Being able to play Supaplex again on all my favorite platforms is a joy.
 
  • Like
Reactions: sergiou87

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: Brb