Blog Archives

“One Windows” strategy.

At last, I hope it will be simpler to support all platforms ๐Ÿ˜‰

Still hope for a C#/.Net support of game oriented 3D API (DirectX/Shaders)… That’s why I still use XNA/MonoGame…

 

Source: One Windows

Advertisements

.Net Random numbers and portability

Working on fractals and procedural generation, I faced an “interesting” problem…

 

.Net Random does not guaranty to produce the same output with the same seed on two different platforms (Framework implementation)… See:
System.Random

 

In most cases I need the result to be the same across platforms (I need to generate the same landscape, event if I change the machine I am working on)… So the only workarounds are to override System.Random or implement my own random number generator.

For a good random number generator example (with tests and proof), see:
Simple Random Number Generator

 

For the design part, I have abstract the System.Random methods with an interface IRandom then developed a “portable” random number generator:

Random design

Random design

 

Some unit testing then go ๐Ÿ˜‰

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:
Noise Machine

Explanations on fbm and landscape generation:
Real Time Procedural Universe

Here some exemples of the result.

Planet and its moon

Planet and its moon

Another planet

Another planet

Another planet

Another planet

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:
Parallax Mapping

I also generate cloud cover with that tool, using this method.

Procedural Texture

Procedural Texture

Normal map

Normal map

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 ๐Ÿ˜‰ ).

Database editor

Database editor

Star map

Star map

 

In conclusion:

 

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.).

Back to source (codes)!

After one year made by tops but especially by bottom and by very low, here we go again!

 

In a sense, that was not more bad to disconnect from the development under Windows Phone / Xbox / Windows. Many things evolved and Microsoft stayed in theย deliberate vagueness on many technologies, of which XNA (I suppose that it will move on this side when the new version of the Xbox will be launched). On the other hand, when we work with Microsoft technologies, we know in what expect because this kind of behavior is not the first one. It is necessary to take it with philosophy ๐Ÿ˜‰

Excepted XNA, the ecosystem Windows evolved well (in any case to my taste): Windows 8, Windows RT, Windows Phone 8, Windows Phone 7.8 (old models) and always the Xbox 360, the whole in the sauce Metro… Forgiveness, “Modern UI”… And a convergence towards XAML/C#, DirectX11/C ++ and HTML5/Javascript, the possibilities of the cloud (Skydrive, etc.)
Smartphones, Desktop, Laptop, tablets, consoles, there is of what to titillate the imagination!

Without considering tools Express (to understand limited but free) covering more and more aspects of the development (Visual Studio, TFS, etc.)

 

In brief, it is the good moment ๐Ÿ™‚

%d bloggers like this: