Friday, November 30, 2012

Castle in VRage 2


Some time ago I posted a blog presenting very simple castle in our voxel engine. And because I like editing and visualisations, I wanted to make something more.. challenging. Today, having a short time after our MinerWars 2081 release, I finished more advanced version of the castle, inspired by famous Germany Neuschwanstein castle.







This video is only presenting features of our in-game voxel editor and VRage engine, castle is not used in the game. But I can imagine more action in this area ;)







How would you like to build your own structures? How would you like to destroy it then? Can you image the game in this environment? ;)

Sunday, September 30, 2012

Castle in VRage

Not only space shooters can be made in our powerful voxel engine VRage. This castle was made in 30mins using our voxel hand tool.




Friday, June 22, 2012

Minecraft as a side-effect

Thanks to our powerful voxel engine we can get sometimes quite unexpected results. While we were testing a new feature, we accidentally developed new Minecraft clone. And it was fun to play :)


Would you like MinerWars craft mode? :)




Friday, June 15, 2012

NextAfter in C# without allocations or unsafe code

In C99, there is a standard way to get the next larger or smaller float32: the function nextafterf. In C#, there’s no such function and I had to roll my own version.
There are three ugly possibilities.
  1. use pointer aliasing,
  2. BitConverter.GetBytes,
  3. simulate an union.
The main update loop may not make any allocations, so BitConverter is out. Pointer aliasing is unsafe, so I couldn’t use it either. So the version I ended up with looks like this:
[StructLayout(LayoutKind.Explicit)]
struct FloatIntUnion
{
    [FieldOffset(0)]
    public int i;
    [FieldOffset(0)]
    public float f;
}

//  Returns the next float after x in the direction of y.
float NextAfter(float x, float y)
{
    if (float.IsNaN(x) || float.IsNaN(y)) return x + y;
    if (x == y) return y;  // nextafter(0, -0) = -0

    FloatIntUnion u;
    u.i = 0; u.f = x;  // shut up the compiler

    if (x == 0)
    {
        u.i = 1;
        return y > 0 ? u.f : -u.f;
    }

    if ((x > 0) == (y > x))
        u.i++;
    else
        u.i--;
    return u.f;
}

Friday, May 18, 2012

Meteor fields

Currently we made a new feature - meteor field. Occasional meteor field is coming from the space, burning, smoking, damaging everything what stays in the way. It combines several tuned effects - HDR, God rays, particle effects.. Non optimized version runs on constant 30 FPS.



Note that our game is made in C# using XNA technology.

Intro

Hello there,
if anyone is interested, I will try to publish here bits of my current work. As a lead programmer in Keen Software House, a company developing MinerWars 2081 game, I meet interesting people, solve mysterious bugs and see stunning game progress every day. If you are curious, be welcome to reading my blog.