This is a direct continuation of the first part. Let this partial quote from there serve as an introduction:
This series (hopefully) of blog posts will gather and shortly describe some previously unreleased and/or forgotten projects I’ve worked on over the past decade and a half, starting from 2000. This is by no means a complete listing, I’m still skipping over the vast majority of unfinished ideas and half-baked projects, but I’m trying to include everything which worked to an extent or has some interesting features.
The primary purpose of this is to serve as an archive for myself, because, as you will notice when I go through the list, I’ve already lost a lot of somewhat interesting stuff and would rather not have that happen again. Perhaps one thing or another might also be useful to someone else, but I obviously won’t troubleshoot code I wrote more than a decade ago and haven’t touched since then! And, just to make that clear, it’s also obviously not indicative of my current skills.
I stopped the previous post around 2003-2004, a timeframe of abortive attempts at creating a 3D multiplayer physics-driven space ball game.
I wasn’t sure where to slot this in, as I started this project in ~2002, but did a lot of work on it in 2005. I chose to go with something closer to the latter than the former. This is an Arkanoid clone written in Ruby. It used the RUDL SDL wrapper (another amazing example of my naming sense really), and initially did software rendering. Later on I switched to using OpenGL for the rendering for performance reasons, which is why the final 2005 iteration was called RudloidGL.
What is interesting about this project is that it’s actually written rather well, in some ways at least. For example, I implemented features like collision detection, sound effects and sprite animation as Ruby mixins, and they are re-used in every object where it makes sense. So the balls, paddle, blocks etc. use the same basic collision code with distinct response events, and animated blocks, paddles and balls use the exact same sprite animation code just with slightly different parameters.
Of course, there are also some things were I was maybe going a bit too far with trying to be smart. For example, I used the “evil” library (yes, that’s actually its name) to implement different ball/paddle/etc. types and changing between them (when picking up a powerup pill) by actually changing the class type. It works, and in a way it’s elegant, but it’s also a bit wild.
Talking about powerups, that’s actually another thing where the code for this game is a lot better already than most of what I discussed in the first post in this series. For example, I seem to have had attained a decent understanding of the “once and only once” principle at this point, and the value of setting up tools in the code base so that it can be effectively used. For example, this is the actual, entire definition code for all 12 powerup pills in the game:
gen_pill_class :SlowPill, :SLOWPILLFILE, -100, "Balls.instance.speedfactor *= 0.8"
gen_pill_class :SpeedPill, :SPEEDPILLFILE, 300, "Balls.instance.speedfactor += 0.15"
gen_pill_class :SplitPill, :SPLITPILLFILE, 0, "Balls.instance.split!"
gen_pill_class :TetrisPill, :TETRISPILLFILE, 400, "RudloidGame.instance.blocks.add_row!"
gen_pill_class :FireBallPill, :FIREBALLPILLFILE, 0, "Balls.instance.change_ball_type!(FireBall, 1000)"
gen_pill_class :PhantomBallPill, :PHANTOMBALLPILLFILE, 0, "Balls.instance.change_ball_type!(PhantomBall, 600)"
gen_pill_class :MoneyBallPill, :MONEYBALLPILLFILE, 0, "Balls.instance.change_ball_type!(MoneyBall, 1200)"
gen_pill_class :CrazyBallPill, :CRAZYBALLPILLFILE, 1000, "Balls.instance.change_ball_type!(CrazyBall, 1000)"
gen_pill_class :PaddlePlusPill, :PADDLEPLUSPILLFILE, -100, "RudloidGame.instance.paddle.changewidth(25)"
gen_pill_class :PaddleMinusPill, :PADDLEMINUSPILLFILE, 300, "RudloidGame.instance.paddle.changewidth(-25)"
gen_pill_class :StickyPaddlePill, :STICKYPADDLEPILLFILE, 200, "RudloidGame.instance.paddle.change_to(StickyPaddle)"
gen_pill_class :MirrorPaddlePill, :MIRRORPADDLEPILLFILE, 700, "RudloidGame.instance.paddle.change_to(MirrorPaddle)"
While eval’ing some random strings would make my hair stand on end now, at least the heart for this code is in the right place, and I still appreciate how concise it is.
On the whole, this isn’t too bad really. What was bad, no, terrible are the sound effects. I never spent much time on those and it really, really shows. Check it out for yourself in this Shadowplay video I took of the game (after spending literally 2 hours finding all the dependencies in compatible versions and getting them to work together).
I will not upload the .zip for this, since I don’t think I am actually allowed to distribute some of the music and sound effects I used. If anyone cares a lot, post a comment and I’ll try to create a working package without those.
The imaginatively-named “Wasser” (German for Water) is a very small program I hacked up in early 2005 in order to generate daily data fitting a decent-looking curve from monthly data about the electricity production from hydroelectric power plants. Until I made this, that was apparently a process carried out manually in Excel (I shit you not).
- It uses both Tk for the UI window and SDL (via RUDL) for the visualization window. That’s insane, but I guess I just used what I knew, and it works.
- I came up with the method of how to distribute data across the days of each month on my own, without really knowing how one would actually solve such a thing correctly. Nonetheless, what I do in the end isn’t too different from what an explicit iterative solver would look like.
You can get it here, though I have no idea why you’d want to.
Released (actually released!) Christmas 2005, Ragex is a tiny generator for XHTML. I don’t need to write much about it here, because the web page is still online, I’m just including it for completeness’ sake. The best part about this one was when I got an email from someone actually using it, in 2008 or so, when I had almost forgotten creating it.
After my 3D experiments in 2004, and other game projects that never quite reached completion, I really wanted to actually finish a game. That’s why I came up with a very simple action/puzzle principle, and Crystalise was born (also check out the help file for a visual explanation of its gameplay).
Here’s a bullet point summary:
- It’s made for PSP, the hottest gaming device of 2005
- The vast majority of the game is written in Lua, with some of the heavy lifting (rendering, collision detection) in C. Pretty modern in that regard!
- As far as I can tell, I completely lost the entire C source code for this project, as well as all the original (non-distribution) assets. A valuable lesson about backups, and even more so the value of releasing the source. The lua code at least is included in the distribution.
- It really is a complete game, including stuff like a main menu, difficulty levels and high score tracking.
- The levels (including boss and special levels) are procedurally generated, probably one reason why I actually managed to finish this game.
- If you hit a certain level (which probably no one except me ever did) the game increases the PSP clock speed to 300 MHz in order to keep up solid 60 FPS:
Lua1234if self.levelnum == Difficulty.clocklevel thenSystem.setClock(300)Window:showText("Not Bad", "Impressed by your formidable prowess,\nthe Crysts had to request more power!\n\n(PSP clock speed increased)")end
- I believe I invented the now commonly used paradigm for writing text with a analog gamepad in this game. That is, selecting a direction with the analog stick and then selecting a character from that direction using a button:
This is one of those projects where I’m really sad I lost (part of) the source. At least in this case most of the Lua is still available. And some of it is pretty neat, check e.g. circle.lua which (despite the name) keeps track of and handles updates to the current state of the level.
This is a C#-based program launching (and other stuff) tool that I’m still quite proud of. I made and released it in early 2006, and the web page is still online. I just downloaded and ran the 54 kB package, and it still works well on my current Windows 7 installation.The major reason I created this was because I was fed up with the Windows (pre-Vista) way of launching programs. Of course, Microsoft seemingly agreed, and the keyboard / string search driven way of using the start menu in Vista onwards pretty much made LuXr obsolete.
Still, there are a few things to like about this one:
- The aesthetics for the startup effect were influenced by the OS in Serial Experiments Lain. Which was much more awesome of course.
- It features a plugin system which dynamically loads plugins written in C#, which can have their own config dialogue pages (they are adressed by adding a prefix to what you type, e.g. “g something” to google “something” with the google plugin, or “e” to use the eval plugin:
- I still prefer how this resolves substring matches comapred to the Windows Start menu search. For example, if I write “vis 13″ in the start menu on my current PC, it finds no matches. LuXr finds “Visual Studio 2013″.
What’s not to like is that I believe I lost the source for this one as well (except for the plugins, which are part of the distribution package). It seems that with the years progressing I got better about actually releasing stuff from time to time, but worse about keeping backups.
That’s it for today, next time around we’ll get to actual 3D graphics programming. WHOOOHOO!