Captain Blood reverse engineering project

I found this the other day, and I thought it was pretty damned impressive.

Fractal viewer in C#

Fractal viewer in C#

Kroah has taken the time to reverse how the fractals worked in Captain Blood.  From

The procedural terrain generator uses 1D fractional brownian motion (fBm) with random mid-point displacement. Up to 10 curves are displayed on screen.

When a new curve appears at the horizon, 7 vertices are computed. Then mid-point displacement with fBm are applied to thes 7 initial points. This results in a discrete curve of 512 samples.

The random number generator and the fBm Hurst parameter H are adapted according to the current terrain type (flat, canyon…). This gives very different visual landscapes (plains, moutains, desert…).

No more fractal computation is done on the discrete curve. When a curve is drawn, only 256 of the 512 samples are used (according to the position of the Oorxx).

The view is 256 pixels wide, so if the visible part of the curve is larger than the 256 samples, the curve will be drawn zoomed with pixels linearly interpolated between the samples. Otherwise the curve will be drawn shrinked without any interpolation and using only some of the 256 samples.

The raytraced fractal landscape is computed from these 10 curves.

It’s pretty amazing to think that there was that much behind the game.

I played this back in 1988 on the lowly Commodore 64, but the Amiga version was simply amazing.  Such was technology back then.

4 thoughts on “Captain Blood reverse engineering project

  1. Just a side note: if I remember completely the original has been released on Atari ST and it was the only complete version with all the sounds etc.

    • Yes, they apparently garbled the samples on the amiga, even the intro song, ethicolour skips, and pauses on real hardware if you let it play long enough.

      I’ve never owned a ST,and the only one I got to briefly use had a black and white “high resolution” monitor and I used it to crudely draw a nuclear power plant for a project in high school. Probably 30 years ago, lol!

      Anyway I had a c64, and it really was a drag as other kids had Amigas, 286 & 386 based machines and I had my 1983 machine. Oh well

Leave a Reply