Postmortem: Old .Net project
Back to 2006, I start to work on a personnal game project involving C#, .Net and Managed DirectX.
The goal was a X-COM/Master of Orion/Prevateer cross-genre “clone” (yep… perhaps I should clarify later 🙂 ). No need to say that I wasn’t able to end that game 😉
But during the process, I have worked on interresting topics:
- Procedural generation;
- Parrallax mapping;
- Atmospheric scattering;
- Scene Graph;
- Xml DataSet.
In fact the most important thing I have worked on was the procedural generation based on Perlin noise. The aim was to generate planets surfaces, clouds, etc. using fractals methods (mainly based on Fractal Brownian Motion, or fbm).
Explanations on Perlin noise can be found here:
Explanations on fbm and landscape generation:
Real Time Procedural Universe
Here some exemples of the result.
The basis for me was a seeded 3D fractal noise generator (with the same seed you generate the same output), the said Perlin Noise, use it with fractal methods (frm and like) to generate a heightmap (surface storing the result for each x/y coordinates).
In a second time, I generate a texture representing the surface of the planet using the generated height against a texture atlas (depending on the climate of the planet).
In a third time, I generate a normal map (floating point texture storing the normal vectors) based on the planet texture and the heightmap to be used by the parallax mapping shader to simulate depth by displacing texture coordinates.
Description of the Parallax Mapping:
I also generate cloud cover with that tool, using this method.
For the setup of the scene graph reprensenting the different star systems, I use a .Net DataSet saved as a xml file. The DataSet allow to define tables, collumns, primary keys, foreign keys, so you can use it as a lightweight database (it have to stay small, everithing is loaded in memory). Nothing complicated (the model is strongly inspired from Master of Orion II 😉 ).
By using procedural generation, I was able to fill a large world with unique planets and that was cool 😉
The main frustrating point for me was the performances. By the time of the project, fractal generation wasn’t fast enough in .Net to process at runtime, so it was limited to the editor part to generate content.
I will continue to investigate in procedural generation and perhaps more sophisticated methods (like Biomes, etc.).