The full 16 scripts compiled in 1 page: 16 scripts
The Fractal Engine
The Oorxx flying above the planet
When the Oorxx flies above the planet, the terrain is computed in realtime. Some games on 8 bits systems have a similar wireframe fractal engine: Rescue on Fractalus, Koronis Rift, The Eidolon.
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.
A raytraced fractal landscape
For each pair of the 10 curves (1-2, 2-3, ..., 9-10), 50 curves are computed in between using random interpolations. Then the raytracer colorizes each strip, applying shadow when needed:
Starting point of the raytracer
Intermediate result: 50 interpolated random curves between each of the 10 curves
Final result of the raytraced fractal landscape
The above screenshots have been made with the Fractal Viewer of my reverse engineered work of the Atari ST version.
The next logical step has been to adapt the viewer to use the raytracer in real-time during the flight as you can see in the following video.
Because the raytracer computes the intermediate curves every frame and the 10 curves move at different speed horizontally to fake a depth perception, you will see some glitches when moving left or right (the points of the curve pair are shifted, giving different starting and ending points for the interpolation).
A video showing the Fractal Viewer in action, using the 3 different rendering methods (original, intermediate and raytraced)
You can download the Fractal Viewer and its C# source code here (it requires the Microsoft Framework .NET 3.5):
play a sample at a choosen frequency. A higher frequency gives a fast and high voice. A lower frequency gives a slow and low voice.
start playing a sample at a specific memory location for a specific duration. All the samples are adjacent to each other in memory (forming 1 block), without additional data between them. They could be played from the first to the last in one go without any glitches.
play a sample reversed (yes, from end to start, reversed!).
These 3 features are the core of the aliens digitized speech.
Each alien race has its own voice frequency.
Each symbol is made up of 2 syllables. Each syllable is defined by 2 values:
a value indicating if the syllable is played reversed or not
an index used to compute the start offset of the sample in the "contigous sample memory block" seen previously (offset = index * 1437). To give a reference point, the word Vision has a length of 3488 bytes.
Every syllables have the same memory length of 1024 bytes, but the frequency with which they are played makes them shorter or longer.
This is a very ingenious system, building a language on top of existing samples.
There are 64 aliens in the game, split in 16 races (4 aliens per race).