Tuesday, February 5, 2013

Goals for 2013

Hello there everyone! Long time no see! I am back and ready to announce my goals for 2013, together with a short recap of what I've been up to since last time I wrote.

Let's break the mold by starting with the goals, and not with the recap:
  • Opensource the physics enabled-terrain code. I said in the past that I would use opensourceing as a means of preventing code loss in case that something happens with my projects or my commitment to them and I was no lying. I still want to do this, only it does not mean having a public repository where you see every single commit that that I make. Instead I want to release a single very well polished version that is pretty much identical to the code I use, only having all the unnecessary stuff cut out.
  • Release a more simple one hour game/full featured demo as preview of a game that I can finish in 1-2 months. Probably in 2D. This project, while at least an order of magnitude less ambitious than the last one, is still quite the complex beast that I won't finish in 2013. 2015 the earliest at the rate I am progressing. So in the meantime I need something to "pay the bills". While I won't necessarily produce something destined to be sold, I'll approach it as a full retail product, making sure it is finished 100%. This "real" product will get it's own post, but I'm thinking of creating a new blog for it.
  • Find a replacement for XNA. Sigh. I just read the news these days. Microsoft is retiring XNA support in 2014. XNA had an uncertain future for quite some time now, but I was hoping that they would announce a new version with Windows 8 features, not the end of support for XNA 4.
  • Return the donations. Another task that I just didn't get to. I still need to cross-reference the blog, my mail and PayPal to determine who and when donated, but it is going to happen hopefully in February. I will also bump down the donation margin for return, from 10 euros to 5 euros.
In December, as usual, I did not work. Still, I manged to get some progress with grass. Since I want grass to be everywhere but you are limited on how much you can render, I wanted a solution to fade distant grass out. Grass buffers are filled and then I don't want to touch them, so fading should be done in shaders, like the animation is. The first step was to compute a displacement value based on distance from player. I applied it universally to grass  Y position, getting this:

Then I needed a way to ground the grass on its initial location (ignoring the displacement). This was not as straightforward because the vertex shader has no idea which vertex is up and which is down:

Then I inverted the displacement, making it start from zero and making the grass negative height in the distance. Here you can see without textures that grass fades out in the distance:

And here is the scene with textures:

OK, grass density needs to be increased. The problem is that with a 2k map, terrain + grass eats up 1.6 GiB of RAM.

So I implemented single-threaded streaming. The game now start almost instantly, loading up only physics. Then one by one it pulls in the chunks and data it needs. Grass is not streamed, but still, memory is down to 750 MiB, so a massive improvement. Once I finish grass streaming and maybe add multi-threaded streaming, I'll be very close to the point where I can opensource the terrain.

I also enhanced the shaders to support fog for all objects (except for grass, but grass already fades out before being effected by fog).

And I spent about two weeks studying animation. I learned about bones and vertex weights and even riged a few simple models. Still, I don't know enough about bones to make my shaders start using them. I don't fully understand the hierarchical transformation system yet and what calculations must be done from parent to child bone. I found some pretty good animation libraries for XNA, but I don't know what to say right now since XNA is dead.


  1. Cool to see you're posting again. Have you been planning to release an XNA game for Xbox Indie Games?

    1. I can't tell you yet because of the early conceptual stage of development: I am just thinking of ideas right now. I have topdown + ghosts :P.

      Also I am not very excited about the cancellation of XNA.

      Plus Xbox is nearing the end of its lifespan too.