If you've been following me on the social networks, you may already know, that for the past three months I was working on a Spelunky Classic modification called Spelunky SD. It is a pretty broad project, implementing a number of fixes and improvements to the original game, and, most importantly, adding a 2-player cooperative online game mode.
Today, I am proud to announce the first public release of this project.
And this is a blog post about my experiences.
Long story short
If you don't feel like reading through this somewhat lengthy post about my experiences, here's a brief summary:
I've made this mod. Making it was hard. But in fact it's pretty cool. It also adds a bunch of things that weren't there. You can get it now for free (and it doesn't take a lot to get running).
Reasons
As silly as it sounds, this project has started somewhat... spontaneously. Since the late 2013 I am experimenting with small online multi-player games. This involves several solo and collaborative projects, one of which is `Color Ninjas`, that I'm making with Max (@insweater).
In one of discussions, we recalled about several of our attempts to play local multi-player games (including Spelunky HD) over TeamViewer. Not to say a lot, but that doesn't work if participants are located in different countries. Precisely, even average (200ms) round-trip times result in having almost half of second input latency, which, basically, means that you are not going to play any real-time games efficiently.
Later it was noted that original Spelunky Classic is open-source, and how some of my approaches to online multi-player could work for it too. With it being late Friday night, I've said that I'll look if I could plug in some basic support over the weekend.
Least did I know what that "over the weekend" will turn into.
The art of underestimation
Perhaps a surprise, but online multi-player was smallest amount of work to do, taking about 5 days (along with the most basic tweaks to have the game running in GameMaker: Studio).
What I did not consider, was that socket and packet wizardry is not the only obstacle for a game transitioning from strictly single-player to online multi-player.
To take a pause here, this isn't the first time that someone tries to add multi-player support into Spelunky Classic. Over the years of game's existence there were multiple attempts. Mostly devastatingly unsuccessful. The best I've found did somewhat work when testing locally (hinting that it could work on local networks), but would completely glitch out when attempting to test over internet. And, of course, it did include a small but most important flaw that became a stumbling stone in my own work.
As I have already mentioned, the original game is single-player. There's only one instance of player, and game does it's best at working with it. So, what happens when you add another player? Nothing considers it. Enemies will not chase the second player, traps will not trigger, and overall it will seem that second player is merely a ghost or a product of imagination.
Another thing that I did not consider was migration bugs. Migrating source over two major versions of the program is already no easy task, and, while I wouldn't say that game is poorly written (neither it is possible to foresee all possible changes to the development tool), after being migrated over to GameMaker: Studio, in some cases the code would behave slightly unexpectedly at best.
Dealing with these two things included changing thousands of lines of code, and spanned several weeks. Somewhere in the process I've also posted this tweet, which, to my surprise, actually gained a fair of attention, certainly helping morale as well:
Another thing to morale was constant testing, which, due to newly gained online multi-player nature of game, was actually also pretty entertaining. Game sessions would last for hours, with bugs being written down and fixed every day.
Eventually...
Somewhere by mid-April, the game did work considerably well. It would no longer randomly crash under odd circumstances, population of bugs took a huge hit, and was generally quite alright.
What was my mistake then, that I have tried to reach out to several people that I would like to see playing my modification, and that could probably suggest things that could be changed to make it better.
So I've sent messages and waited. I wouldn't say that any of people contacted were ultra-large figures, and I did have responses to all of my messages, but process of waiting was dreading.
What is it to check mail, timelines, and activity feeds every morning only to find that seemingly nothing happened about your work?
That hurts the morale, and sparkles some thoughts about whether you did something wrong, or overlooked some crucial flaw.
Perhaps a response most reflective of situation was
I'll get to it, eventually.
"eventually" is a wonderful word. As it is said, aeons and aeons afar, the last stars will burn out, and the universe will submerge into it's last, endless night. That might happen. Eventually.
The context here is though, that people are busy.
Even ones primarily doing gameplay videos or streams have schedules, and in some cases might not even play any games "outside" the recording times.
In the end I'm not even sure if any of people that I've asked did eventually get around to playing the mod, but with all this waiting there were two weeks where I've made close to no progress.
On the bright side, project received sufficient testing from people I know and few that did contact me about it. Some are more known, some aren't, but it was all great help.
Doing it right
Getting the mod done is a good thing, but a separate question is - what makes it better?
Well, what does not make it better, is bugs.
So I've fixed "some" those. Bugs from the original game, bugs left from migrating the game from single-player to multi-player, undefined or unforeseen behaviours...
overall there are now fewer situations where something would go weirdly.
Then there were also the gameplay tweaks. Some of these are more apparent (like sounds fading off-screen or enemies "blinking" when about to get up), while others remain transparent (such as game being slightly more forgiving on input precision), but these sure add some missing bits to game.
Then there's cooperation. As for a mostly-cooperative game, being able to interact with the other player matters. You can carry the other player around, throw them over (or into) the obstacles, share items... of course, cooperation is not required, and players can just selfishly run around on their own, but there are some options.
And for when you're done with the game, there are mini-games (all of which work both with one and two players), game modes, and endless chat commands for changing the way levels are played or just messing around.
Overall, things should play and feel quite better now.
Looking forward
And so, that's it.
Of course, there are still more things that I would like to add to this.
It would be nice to allow the game to support more than two players.
It would be nice to have a PVP mode (akin to Spelunky HD).
It would be pretty great to get level editor and level sharing back in, as well as some other forms of extensibility (to let the fun last even longer).
Although right now a semi-distant dream, it would be great to have this work on Mac and Linux too (and maybe something else as well).
And lots of other smaller things that matter.
Perhaps these will get done. The time is always hard to find, but I might get to it.
It won’t let me download it on game jolt it says will download shortly but never does what do i do?
Try downloading from itch.io instead.
Thanks! =)
I assume by now we’ll never see the source code?
Between me having an endless stream of work (attempts to fund development of tutorials and sample projects via Patreon had failed miserably) and recent developments to mod being increasing piles of hacks (by now SSD includes substantial snippets from at least 4 completely unrelated projects), it seems increasingly unlikely for this to ever reach presentable format that can be learnt from.
While I am somewhat proud of what I was able to accomplish in the scope of the mod, and I had learnt a lot (both in terms of networking and having expectations for performance), it also happens to be the lowest-quality functioning networking project that I made.
Perhaps at some point reverse engineering of GameMaker: Studio projects will become sufficiently real for you to be able to see why so I’m hesitant of publishing the source.
That’s really a shame.
I’m an amateur ‘developer’ (tinkerer would probably be a better word), and your post here (http://mossmouth.com/forums/index.php?topic=4124.msg87688#msg87688) didn’t really help me too much to get the original Spelunky Source working in GameMaker: Studio.
Would you know if there’s a more detailed write-up on how to get this working in GM:S? Very much appreciated.
Slightly delayed, but here’s a thing: https://yal.cc/spelunky-classic-source-for-gamemaker-studio/
Pingback: Spelunky Classic Gets A Two-Player Co-Op Mode | Time to game
Hey, I wanted to try modifying this; would you be comfortable releasing the source?
Not at the time, there’s still a lot to fix in source for readability and editability. I have a separate idea that would allow small tweaks (e.g. level generation or custom minigames) to be implemented without touching source at all, but I haven’t got to that just yet (still need to migrate multiplayer to new API for gamepad support and Mac/Linux builds).
Pingback: Cooperativa a due giocatori per Spelunky Classic grazie a una nuova mod | VG247.it
anyone hosting
What do you use for online? I am working on an online game in GM:S and I use a third party server right now.
Current version uses FaucetNetworking for multiplayer. I’m planning to migrate it over to built-in network_ functions, but porting is a fair of work.
Pingback: Starting All Over Again with The Binding of Isaac: Rebirth | Everybody's Talking at Once
I can’t really understand some of the key changes. Using space instead of up arrow to enter doors seems a bit strange, and I seem to fail entering doors for a while everytime I encounter them. I would just bind it with uparrow, but it’s coupled with buying for some reason.
Much more infuriating is not having a running button but instead having running and attack coupled together. The only way to run while carrying something now is to pick things up and keep the button pressed indefinitely. Since running is something you need to do repeatedly and throwing is something you don’t want to do mostly, it seems broken to couple these.
“buy” key is used for entering doors since using “up” meant that it was impossible to climb a rope in front of door without entering it. Spelunky HD also does the same. It is generally better to remap it to some other key (personally I prefer [V]), as multiple keyboards do not allow to press two arrow keys and spacebar at once. You can also technically hold the buy key to exit as soon as you touch the door.
As for running, there’s still a running button (Shift by default). It’s button #8 for /remap command. The “attack to run” thing is from original game, I’m not really sure if anyone uses that.
Ok then, then you need to update your readme, since it said nothing about running! Thanks for the info though. Played some rounds with a friend and introduced her to the game this way, she enjoyed it.
Tunnel man skin didn’t seem to work, when I tried that (/style tunnel) it just made me the regular spelunker.
Style for tunnelman should be “/style tunnelman”. ReadMe is improved a fair bit in the upcoming update (snippet) – should be out sometime soon (once I’ll have enough time to finalize changes/additions).
Congrats on the game! Works really well. Been playing with a friend for weeks.
Works perfectly fine under Wine, no tweak required! Really cool!
I’m running Linux Mint 17 by the way. Everything works pretty well, even the multiplayer. :)
playing now tell me ip and port
Is there any way to remove the ghost from the game? I mean its all great and fun to explore with a friend, but the ghost appearing after just 2:30 makes it very annoying :/
Yes, if you enable cheats (/cheats), you can just do
/remove ghost
Or you can set up a command queue to do this automatically:
/qadd noghost
/qpush noghost delay 4500 remove ghost
/qauto noghost
(that’ll also take enabling cheats)
Hi do i have to install the mod into the original game files or something, because when i start it on its own it doesn’t start up and i get an error report. The same thing happened when i put the files into the original games folder. Is there something i have missed?
No, mod just has to be unzipped into a directory of it’s own. What is the error that you are getting?
Pingback: Yet Another Spelunky Mod Update 1.8.1 | I SPOTTED THE CAVE'S ENTRANCE
Pingback: Superlicious | Superlevel
Hi thanks for this mod! Any chance of releasing the source
I might release source at some point. There’s still a lot to do both in terms of functionality and clean-up.
If you are asking for purposes of integrating some other mods into it, I do have a plan on how to permit that without requiring people to figure out how my changes to the game, but I’m not sure when I’ll have time to do that.
Please release it i’ve been waiting on open-source for a year now so I can play with my friends on a modded server. That would really be awesome and there’s no need to comment and what not, as I just want to add some of the other mods like Yasm in.
Truth to be told, I wasn’t able to devote much time to the project at all. I’ve done a few updates to improve the networking capabilities a little, and was working on adding 4-player support, but wasn’t able to get that to a “release-able” state yet.
Coincidentally I had the project file open just as a notification about your comment had arrived, and I’ve done nothing particular but update GM:S the other day, and it’s all up in flames already, runner “stopping working” as soon as you try to connect to someone, not a single trace of source of error.
I’ve been working on a system that allows to load mods (written in a GML-like language) without the need to recompile the game or worrying about understanding how the netcode works, but that’s a little stalled at the moment due to contract work. Hopefully around spring or something – I’m personally very excited about the possibilities this would open, even if it’s small things like being able to program minigames or game modes. All time-consuming stuff though.
That’s pretty sweet mayne. So you ported this to studio or did you start this game on studio? Just curios because mods of my own that I would like to implement are purely 8.1 gml. Well, eitherway I’m glad you are working on it. Is there a donate button somewhere by chance? Maybe a little motivation is in need?
Found the answer for myself oddly enough : http://mossmouth.com/forums/index.php?topic=4124.msg87688#msg87688 so you ported it eh? So Spelunky Sd wouldn’t be compatible with 8.1?
Yes, it’s ported to Studio; the post briefly highlights this. The primary reasons were performance (YYC permitted to drop out-of-view instance deactivation without rewriting everything), new networking functions, and general forward compatibility.
Source code compatibility in general is one tricky topic both because of 8.x->Studio migration, and because of my own changes to make it multiplayer compatible. Again, a custom mod system would solve this, though you’d have to do some “player_find(1).x” instead of “oPlayer.x” like the original game does virtually everywhere.
While it might be possible to migrate some of the code back to 8.1, the lack of networking functions used would kind of defeat the point.
Regarding donations, that can be done via the game’s itch.io page (which is currently a little placeholder-y because I haven’t found time to fill it out yet). I used to have a Patreon page, but eventually closed it, as I wasn’t able to attract enough subscriptions to make a difference. So I currently switch between own projects, collaborations, and contract work. Not so fast, but this works.
Hello, Great game soo far playing it my friend all day :D. But the controls are not, they are terrible for me. Like is there a way to play it with a normal controller? It would make it a lot easier for me
There currently isn’t built-in gamepad support (since I need to migrate related code to use current versions of functions), but you should be able to use a program like Joy2Key for gamepad controls until then.
Pingback: SpelUNky diventa SpelDUEky! (... brrrr ...) · Gioca Giuè
Have you considered utilizing GGPO netcode?
Haven’t heard of GGPO until recently. I was considering use of Kaillera (which, apparently, is also at heart of GGPO), but the library is closed source, and the forums seemed inactive (while as of writing this they are filled with spam), so I have decided not to risk working with something that it could be hard to get support for if I get stuck.
I have a wineskin wrapper to use with this, you can add that as an unofficial mac download if you want http://www.mediafire.com/download/kxdobvrs2tcqev4/Spelunky+SD+Wineskin.zip
Were you able to test this in multiplayer and was it working correctly, if so? I’ve heard from someone that use of Wine (presumably on Linux) resulted in poor performance in multiplayer.
I was using this on linux with wine, and it works very well. I also tried to play online with a friend, and it works again! Stable FPS, all works as needed.
Pingback: Revisit Spelunky Classic with Two-Player Co-Op Mod | mooshou.com
Shops seem to be significantly broken. There’s no way of learning how much something costs, you can’t pick something up without automatically buying it, and if you don’t have enough money you can’t pick it up at all.
When you pick up an item in shop (by picking it up from ground, not pressing `buy` key), price will be shown. This is how it always worked in Spelunky Classic.
Apologies; the key mapping throws me off and I’m guessing I had one of the picking up keys double-mapped to buying.
Pingback: Original Spelunky gets online co-op mod
Pingback: Spelunky SD Mod Adds Co-Op To Free Original Version | Rock, Paper, Shotgun
Pingback: Classic version of Spelunky has received a mod that lets you play online co-op multiplayer and it’s also free. via /r/Games | Why are we here?