Some tips for the next Ludumdare
OK, here we go.
- Flixel, flashpunk, et cetera… just go for it, you’re making a game. I’m still not a fan, but if it gets you making a game, then you’re playing your part in this competition.
- Speaking of platforms, it helps if you pick something that’s truly cross-platform as not everyone uses Windows (I’m actually going to suggest a figure of 90% who do, which means 10% who don’t, which means 1 in 10 people). There’s Wine, but some things (especially Game Maker) run horribly, and it doesn’t run .NET binaries (and Mono doesn’t have XNA). It’s not against the rules but it’s a pain in the butt.
- Also speaking of platforms, make sure you give an idea of how fast your game is supposed to run. Or something like that. In most cases, your game will run “too slow” on some systems.
- Try to make it get progressively harder if it’s an endless game.
- Don’t use a “lives” system, unless it’s purely for score reasons – I kinda just want to get through everything.
- Don’t spend too long on the graphics. Best just to stick with placeholder art to start with, and then improve it as you go along.
- If you’re going to code an engine which is quite different from the target platform, code it beforehand. This is a tip for myself, who spent roughly 26 hours on getting the emulation working.
- The competition is more serious than the jam. If you’re afraid of criticism, I would suggest the jam. I think. Bleh.
If you want some throttling code, here’s some pseudocode.
CPS is Clocks Per Second.
CPF is Clocks Per Frame. If you have something which returns milliseconds ( 1000 ms == 1 second), and you want 50 fps (== Hz == occurences per second), use CPS/50 == 1000/50 == 20.
next_tick = get_time();
while(doing_your_loop()) {
current_tick = get_time();
if(current_tick < next_tick) {
do_video();
sleep_for_a_short_moment_say_5_ms();
} else {
do_logic();
next_tick += CPF;
if(current_tick – next_tick > CPS/10)
next_tick = current_tick – CPS/10;
}
}
This is essentially what I do in my entry. I thoroughly recommend that you use this. Alex the Allegator 4 uses it, which is an old LD48 (?) not sure what it was entry, but forgets the short sleep so it runs at a nasty framerate on FreeBSD (and I’d assume at least some other OSes, too), and it doesn’t do the lag clipping thingymabob.
It always pays to at least yield to the scheduler every now and then so other stuff can get done, ESPECIALLY if you’re using Java (I did a port of Shawn Hargreaves’ SPEED once and I encountered a problem with the sound being really, REALLY sloppy).
EDIT: Added in the lag clipping. It helps if you get an interrupt storm or something and you lag out for a second or two.