The Mezunian

Die Positivität ist das Opium des Volkes, aber der Spott ist das Opium der Verrückten

Let’s Code a Crappy 2D Platformer Like Millions o’ Other People on the Internet & Lose Interest & Give Up Only a Few Months In, Part XXXIII

Audio

I finally got round to adding sound to this game, after almost a whole year o’ silence. The music is all royalty-free songs offered to the public by Kevin MacLeod on Incompetech, which may be temporary, may not be. Since I have no musical skills, I can’t imagine how I’d make a decent soundtrack for this.

As for the sound effects, they’re made with various Flash programs online that randomly generate some wave patterns.

Honestly, it took mo’ time wandering MacLeod’s site & listening to hundreds o’ songs in search for the best song for each level — an exercise that brings me back to the Super Mario World romhacking days when I’d do that with user-submitted SPCs on Super Mario World Central, since in addition to having no musical skills, I couldn’t e’en figure out how to port already-composed video game songs into Super Mario World’s weird format.

Meanwhile, using SDL2’s music & sound libraries only required a couple hundred lines o’ code & a function call strewn in various places to tell the global Audio class to play some song or music. The most complicated thing was preventing sound effects from noisily o’erlapping each other, such as when collecting gems, without blocking sounds I do want, such as the sound for collecting a diamond, which I solved by dividing the sound effects into channels & stopping only that a sound’s channel when playing a sound. Thus, collecting multiple gems will interrupt other gem sounds, but not a diamond sound, since that’s on a separate channel.

But I can see there’s still some bugs with the way the sound works. As the video shows… well, 1, recording with sound causes slowdown, which ne’er happened before; but related to that, if slowdown does happen in-game, it’s separate from the music, leading to sync issues. The playthrough o’ “Warm Up” shows this: it’s timed so that the song ends right when the timer reaches 30 & the level ends; but ’cause o’ slowdown, the song ends early & loops awkwardly. That ne’er happened in any o’ my earlier test — only when finally recording & encountering slowdown.

& there’s probably hours o’ fiddling to be done. Different songs are all o’er the place in terms o’ volume. For instance, while the mines music ( officially, “Chillin Hard” ) is quiet, “Mart Cart Madness”’s ( officially, “Got Funk” ) is so loud, you can hardly hear the sound effects.

As the video also shows, I spruced up the level-select screen so that it’s not just plain black & white.

Lunacy

Beating the time challenge for this video probably took mo’ effort & time that designing this level. ’Cause jumping is so slow, any extraneous jump can fuck you o’er.

Part o’ me thinks this level may be too difficult, considering it’s s’posed to be a 1st-cycle level. On the other hand, the level’s deceptively easy: while the slowness makes beating the level quickly hard, just beating the level in general is easy, since you get plenty o’ time to land jumps. Thus, 1-block jumps you’d expect from late-game Super Mario Bros. levels are trivially easy. Similarly, e’en though the spike passages are tight, it’s not too hard getting through them without getting hit ( though I think you absolutely need to be holding the run button to get through some passages ).

My original plan for the graphics was to have crater moon graphics; but every time I tried drawing them they looked like crap. Then I came up with the idea o’ blocks shaped like Hershey chocolate bars, & went with that — which fits, since canonically in the Boskeopolis universe the moon’s surface is s’posedly made o’ white chocolate. I still think this level looks a bit too sparse; but I could spend eternity sprucing up the graphics in every level, so it’s best to let some levels look simple.

Next level will probably be a harbor level with “Rusty Bucket Bay” sludge water as a gimmick.

Source code

.

Posted in Boskeopolis Land, Programming