Kobo IIKobo Deluxe

Game Logic

  • The actual game logic (enemy AI, player control, map construction etc) is roughly 8,000 lines or 170 kB of C++ code. It is entirely based on integer/fixed point calculations.
  • The game logic code is virtually taken as is from XKobo. The only significant change is that there is now a full health/damage system, which is also capable of emulating the old game rules.
  • XKobo ran at a fixed frame rate. (The default of 30 ms/frame became the official game speed for Kobo Deluxe. Changing it counts as a cheat!) In Kobo Deluxe, game logic and graphics are decoupled. Scroll and object positions are interpolated for smooth animation at any frame rate. This technique is also known as "tweening".


  • The graphics engine is about 11,000 lines or 240 kB of C and C++ code.
  • The game uses 1.3 MB of graphics data in PNG format. All of it was pixeled and drawn in GIMP, except for the tumbling rocks that were modelled and animated in Blender.
  • Rendering is done through a sprite engine that was originally written in Object Pascal and 386 assembly language for the DOS game Project Spitfire. It was ported to C as a first step in an effort to port Project Spitfire to SDL. The current version implements motion interpolation, manages logic/video frame rate, and contains a graphics manager with a load time image processing pipeline.
  • The game artwork is drawn for a native resolution of 640x480. Other resolutions (any N:16 factor - game tiles need to be of an exact integer size) are supported by scaling all graphics while loading.
  • The graphics engine supports (mostly) transparent scaling (most game code sees a virtual 320x240 display), and includes a low level windowing system with a dirty rectangle manager that automatically governs updates in page flipped video modes.
  • The noise and plasma effects are created by blitting one scan line at a time from various small "effect" textures with sine or noise modulated offsets. Fast and simple!
  • The animated logo seen in the intro is implemented by rendering various noise and plasma effects through a complex region (a simple scan line based implementation) and then "framing" the result with a logo outline image.
  • OpenGL accelerated rendering is implemented through the glSDL wrapper.


  • The audio engine is actually the biggest and most complex part of Kobo Deluxe. It's a total of 21,000 lines or 500 kB of C code, including the AGW (Algorithmically Generated Waveform) script parser; an ancient ancestor of the EEL scripting language.
  • Kobo Deluxe has a rather unusual sound system. All sound effects and instrument sounds are scripts rather than the usual sampled waveforms. The scripts control a modular synthesizer that renders waveforms as the game loads, or when it's installed.
  • The game comes with 50 kB of AGW scripts and 37 kB of MIDI files. This data covers everything you hear in the game.
  • The AGW sound effects and instruments render into 2.3 MB of raw audio data. The 50 kB of scripts compress into 7081 Bytes with bzip2. If you think of it as resynthesis based data compression, that corresponds to a compression ratio of 325:1.
  • The original audio code was written by Masanao Izumo, and has been modified, extended and perverted beyond recognition through countless nights of furious, unorganized hacking.
  • During the most intensive weeks, the audio engine grew at an average rate of 400 lines of working code per day.
  • The unnamed audio engine of Kobo Deluxe has evolved into a stand-alone project named Audiality. Audiality 0.1.x is still compatible with the Kobo Deluxe sound engine, but has been abandoned in favor of other projects - one of which will likely replace the old Kobo Deluxe sound engine eventually.

Copyright © 2001-2012 David Olofson