View Single Post
Old 01 August 2011, 03:50   #1
Registered User

Kroah's Avatar
Join Date: Apr 2009
Location: France
Age: 40
Posts: 112
Lightbulb Captain Blood reverse engineering

Hello all,

Some days ago, i've launched in Steem a game i've played a lot 20 years ago.
This game, Captain Blood, has a very captivating atmosphere and talking with the aliens is very entertaining:
Click image for larger version

Name:	Pop Unknown.png
Views:	1272
Size:	13.5 KB
ID:	29233

After some long nights, i've finally recovered all my life fluids, thanks to the duplicates. On top of that, a nice girl on my dashboard.

But... I hadn't the feeling of accomplishment. Some aliens i encountered were still shrouded in mystery.
And I found intriguing the way the game handled the conversation between Blood and the aliens.

So i started disassembling the game and i found a script interpreter.
It uses an input (Blood symbols), some local and global variables and produces an output (the alien symbol).
I've developped a tool which exctracts the alien's script to something readable (for someone expert with the game).

You can find the result (>1mb) on my site: (direct link:

Be aware: it contains major spoilers! If you haven't finished the game and you mind playing it, stay away!

You may have some difficulties to understand how to interpret the script. I willl add some hints tomorrow about this.

Have fun!

***** UPDATE 07/03/2016 *****
The fractal engine used in the game along the raytraced landscape (when pressing a key) always fascinated me.

Then, even if i'm afraid of heavily optimized 68k code, i started reverse engineering the fractal engine in C# to understand how it was implemented.

Even if the asm code is not that bad to read, it's still massively optimized to efficiently draw the curves and to minimize the memory usage while having a feeling of an infinite landscape.

The fractal engine is a classic real-time midpoint displacement method using specific random number generator to give different landscape.
The canyon part is done by forcing some points in the curve, then applying the subdivision.
The raytracer uses the computed fractal during flight, computes another layer of fractal between the "blue lines" then colorize with shadow the landscape.

And... Some days ago, i had a crazy idea... The thing that is totally useless... but well, you know, doing it only to see if it can be done.
"And if i put the raytracer in place of the simple renderer during flight ??"

You can see the result in the following video (look at 0:33):
[ Show youtube player ]

PS: i know the term raytracer is not perfect because the engine does not cast rays like a real raytracer, but it still computes shadows.

Download link:

- Left mouse button while dragging the mouse to change the horizontal and vertical motion of the Oorxx.
- 'V' key to stop any horizontal and vertical motion.
- Right mouse button while dragging the mouse forward/backward to speed up/down the Oorxx.
- <Spacebar> to toggle between classic and raytracer mode.
- 'B' key to toggle wireframe while in raytracer mode.

Last edited by Kroah; 08 March 2016 at 22:21. Reason: Fractal Engine update
Kroah is offline  
AdSense AdSense  
Page generated in 0.17106 seconds with 10 queries