About DrPetter


DrPetter's Trophies

Seriously... EVERYONE uses SFXR
Awarded by PoV
on December 15, 2010
Master of Distraction
Awarded by LunarCrisis
on April 21, 2008
The "I'd rather do it in C" Prize
Awarded by philhassey
on March 3, 2008
Glorious Particles Award
Awarded by Cthulhu32
on February 25, 2008
RSS Triumph
Awarded by philhassey
on February 4, 2008
The Über Awesome Sound Tool Award
Awarded by Endurion
on December 19, 2007

DrPetter's Archive

Tales from a Cavern

Posted by
Monday, May 19th, 2008 2:11 am

Maybe this is what I should have been doing for the last LD… It took me two days to make and it’s based on the code of my LD11 entry (I didn’t even miss Felicity!)

Download over herely

Making “just a game” was kind of enlightening, since I didn’t have any real technical challenges to overcome and could just get on with content and putting in simple control logic to make it all come together. It’s pretty much an unthinkable project viewed in terms of what I’ve been doing the last few years, but since both development and result were enjoyable it’s a pretty clear hint that I should be doing it more often.

However, I ruin that immediately by having a natural impulse to make some kind of convenient editor/engine which would reduce the need to write copious amounts of replicated-but-slightly-modified code for instance when I want new enemy types etc. I have made these before, and each time I end up spending weeks or months working on it and then never really use it because I get increasingly unhappy with how it’s built. Still, I couldn’t possibly make a game of say 10x the complexity/scope of this one without using more structured code at the very least. And defining animations, scripted events, enemy patterns etc would quickly get tiresome and repetitive to do in code+Photoshop if you have more than one or two types to deal with. The grunt of this game (discounting image loading and input code) is a 1500-line C file, where almost all logic is directly in the main loop – wonderfully spontaneous way to work but of course breaks down with increased program size due to convoluted value/flow dependencies, loss of overview and the need to repeat code.

The fact that I did manage to create this in just two days though, and that I didn’t run into any major hickups along the way, probably says something about suitable code vs application complexity. If I had gone and made “a perfect design” with fancy classes and streamlined algorithms for everything, I would most likely not be done yet. More importantly, I probably wouldn’t even have started since such a small project doesn’t really justify that kind of work. Not without the prospect of a larger product coming out of it, and if there was one I would probably be too intimidated by the thought of that and keep trying to out-think myself in terms of what stuff I’d need to make that “great big thing” work eventually.

I think Derek Yu recently said something about coders being able to “doodle” games like artists sketch with pencil and paper, and that’s probably an important thing. A sketch is never meant to be used for anything substantial, it’s just playing around with the tools of your trade to make something spontaneous and fun. If it turns out nice then you could potentially do it again from scratch but “do it right” and expand on it if you wish – but you should definitely not be doing it the roundabout way to begin with since that would destroy the spontaneity and make it a laborious task instead of a free-minded sketch. When sketching you can only use whatever skills and processes that come natural to you, without considerable planning or conscious mental effort. Of course, with increased experience this set grows larger and some people could probably do advanced class hierarchies without thinking too much about it. All the more power to them.

Since I made this thing in such a short timespan, I have a pretty good overview of all the techniques I used and the bare-bones code needed to make them work. This could provide some extra value when designing larger game systems as I might be able to target my efforts more carefully, and not get overly general or implement pointless things. For trying out pure game ideas though, I still feel that it would be sensible for me to “sketch” in a more streamlined tool… a kind of game maker for sure, but definitely not Game Maker (for the simple reason that I’m incapable of using any tool that is close enough to what I could potentially build myself, which is a most unfortunate condition in terms of productivity… but creating a tool to fill some (possibly imagined) need of my own is just so very rewarding)


Posted by
Saturday, May 10th, 2008 5:23 am

I put up an article on basic sound synthesis yesterday. It had been requested by some folks. Touches on fundamental aspects of sound in general as well as more specific details relevant to classic retro waveforms and the kind of stuff sfxr does.

I made… something!

Posted by
Sunday, April 20th, 2008 6:00 pm

Ok. Managed to scrape something up that might be considered a game. About as complex and innovative as my last few LD entries 😉

I actually had fun this time around, but mostly with irc and blogs rather than actually making a game of my own. Maybe next time.  Now sleep before getting on with all the games!

Giddit: marge.zip (windows executable, and a bunch of code that you probably don’t want to try compiling)


Tremble in your boots!

Posted by
Sunday, April 20th, 2008 12:44 pm

Yes. See how far I’ve come. You all don’t stand a chance. Maybe, before time is up, I’ll even manage to make my sprites flip without glitching out in oldfashioned tilemapped glory… but who really wants that anyway? Tilemapped glitches are the best.


Distractions Deluxe

Posted by
Saturday, April 19th, 2008 12:45 pm

Someone (partly me) derailed the IRC into wild discussion of a math problem. I think some 5-6 people were involved at some points, and we still haven’t arrived at a conclusion as far as I can tell.

Here’s an image I cooked up to help visualize the problem:


The problem is deceptively simple: Determine what angle to fire a bullet in, if it is to hit a target that’s moving past you at a constant velocity. In other words, both objects are moving at a fixed speed, and you just have to figure out in what direction to launch the bullet so that it’ll hit the target perfectly. Iterative solutions need not apply. Good luck with interpreting the image, it’s pretty confus(ed/ing).


Posted by
Saturday, April 19th, 2008 4:16 am

Well, kitchen table at least. All these photos of computers-at-windows made me relocate to this unorthodox spot. It’s the most window-facing point in my apartment, and I must say the light is quite inspiring compared to being stuck between two walls and a closet. Seen in foreground is the comfy chair, complete with soft cushion and keyboard-in-lap action.



Posted by
Wednesday, April 16th, 2008 3:11 pm


PSDImage class

Posted by
Saturday, April 12th, 2008 7:20 am

I might want to use this for my entry, so I’m putting it up for free download to avoid cheating.

Just some loader code for PSD images, you can retrieve image data for each layer in the image through pointers to regular 32-bit ARGB  pixel buffers (with individual bounding boxes and positions in the image). Haven’t tested it extensively, and it will probably crash for some images… but if it works for you then go ahead and use it. My idea is to do level layout and similar stuff in Photoshop to remove the need for a level editor. Being able to draw scenery (and collider geometry?) in multiple layers should be enough to make something interesting, and do it conveniently.

Get: psdimage.zip

Nitro Butts!

Posted by
Saturday, March 1st, 2008 3:31 pm

Some more project additions on my shiny new site. New design really makes adding stuff a lot more convenient compared to what I had before. Actually one of the updates is a project entry on that very system; SPCMS (the morbid can have fun looking through some source code on that one)

Mainly though, I finally got around to releasing Nitro Butts – an old game from 2005 that me and my brother made out of oldschool boredom. It’s actually quite a bit of fun and you can even do co-op if you have a gamepad and additional human around.

An entry this is not, I think…

Posted by
Sunday, February 24th, 2008 5:52 pm

Considered doing something for the compo, but kept getting into other stuff (fun stuff, important stuff, interesting stuff) so time ended up running out. I decided to make a mockup screenshot instead, of something weird that could have been. Maybe. Anyway, behold:


Oh, I also happened to make an asteroids game during the compo… didn’t mean to do that, but technically I guess it could have been an entry. Not quite weird or unexpected perhaps, but at least it’s asteroids.  Windows-only.



Now where’s the Inquisition game? Me want play!!!

More good old stuff

Posted by
Tuesday, February 19th, 2008 7:51 am

Homepage has been padded with another couple of old projects – go see

This time around it’s a semi-usable animation editor (for making PNG images move around in a neat way) and a video smoothing experiment (no download, but lots of text and a demo video!)

Page update

Posted by
Tuesday, February 12th, 2008 7:54 am

Today I’m standing in for my RSS feed which seems to have gone haywire. By the look of things it’s still refreshing even though I removed the xml file!? Phil?

Anyway, updated the page with two more projects from 2007. Go see while they’re hot… uh, pretending they’re not already 4-6 months old.

Pelly suggestion

Posted by
Sunday, December 30th, 2007 3:15 pm

Someone asked for a pelly. I made one. It’s simple and boring, but I suppose it’ll do if nothing better comes along.

Here’s a psd file with suitable layers for making variations to suit all the themes: pelly_layers.psd

(I’m too lazy to do them now)

30 minute drawing

Posted by
Tuesday, December 18th, 2007 5:35 pm

Theme: “Running out of time!”


Time is ticking… but she doesn’t care.

Wordy final entry follow-up

Posted by
Sunday, December 16th, 2007 8:50 pm

Ok. Managed to upload and post the thing properly, so now I can relax and write some stuff about it.

This one was a shaky ride for sure. Throughout the first day I kept a laid-back attitude and sort of held a leisurly pace. Spent a lot of time on IRC and elsewhere, but still got a fair amount of code done. Second day started well, with some bugfixing and new implementation. Halfway through though, I started realizing that I didn’t really know exactly where I was going with this in terms of gameplay, and sensed a wall rising before me.

I was stuck for a few hours incabable of deciding what direction I should go with things and actually considered (briefly) forfeiting the whole thing… I came to my senses though and decided to salvage it as best I could by making some fun gfx and audio. As soon as I got a “living” player character and some sound effects in there it suddenly felt a whole lot better. I should have done that way earlier. With just one or two hours left on the clock I was all inspired again… dang.

The last hour was a blur of stressed music-making, panicked code-juggling to get it playing in the game, and some begging to get a few minutes to wrap things up in a respectable manner before making the final post. But it worked out in the end (sort of).

I just wish I could bend my sense of time/planning to actually fit reality a little better. I always act like I have all the time in the world until I’m literally running right out of it. THAT’s the point where I start doing actual work, and kicking straight into highest gear. If I had started working on the media 5 hours earlier (back when I didn’t do much of anything anyway) I would have had time to properly tweak things and maybe make a “good” song rather than a doesn’t-quite-make-you-rip-your-ears-off one.

Anyway, despite the little crisis and gloomy bughunts I will remember this compo fondly. I did have a lot of fun on IRC over the first day and a half, and the last pull-together of stuff for my entry made all the difference between a sense of failure and modest accomplishment. The final product didn’t end up being a proper game (as usual) but at least I’m not embarrassed of it.

I have an exam in 2.5 hours that I neglected studying for, so I’ll just sleep for a bit instead I think. Life’s tough, but you need to get your priorities straight… I’ll re-take it in March or thereabouts.

As for food, I don’t hold any sort of lightsource to the grand masters who have been posting here, but I did consume something like 10x the amount of sugar that I’d normally do over this time period. Lots of candy and soda, yuk. My tummy doesn’t quite like me atm. Also downed some chicken, pasta, vegetables and milk (which constitutes my staple diet) – and pilsnerkorv!

I kept a slightly more detailed/rambly timelog in my main.cpp which is included in the submission zip. Check it if you’re interested. Oh, also I forgot/neglected to put in some library code that’s needed for the game to compile… tinyptc, portaudio and playmu (which is my sort of in-development musagi playback library, used it for LD9 as well). I don’t see much point in uploading them at this point, but they’re available to anyone who might ask. I’ll have to clean up playmu at some point and upload it to my homepage properly.

Looking forward to checking out all the entries soonish, after some R&R. Congrats to everyone who joined/tried/failed/succeeded!

Final entry! I’m late!

Posted by
Sunday, December 16th, 2007 7:10 pm

Thanks Phil, owe you one there…

Just the link for now, will write post-mortem in a bit.



[cache: storing page]