Monday, April 11, 2011

Character Controller, new World Algorithm and... another video!



I've been working a lot on a better world algorithm.  The last algorithm was pretty but it really only generated rolling hills at various heights (and it didn't even do that very well).  The new one will generate a preferred height for the chunk itself and then build on that height.  It'll try and make it so the cubes will generate primarily around that area, but it won't necessarily completely limit it (as you'll see in the youtube video).  I'm somewhat happy with what I have so far but it does generate some definable squares.  I have an idea on how to fix them so hopefully that'll be in the new release.

The other thing I worked on is gravity and a character controller.  The player can now walk and jump around.  I need to refine the keyboard controls so they're not as jumpy but the game works great with a 360 controller :]  I also did a lot of performance changes.  Beforehand, I was building a chunk (deciding which cubes are present and which ones aren't (Step 1)), then iterating through all those cubes to figure out which faces are visible (Step 2), and lastly building the TriangleList to send to the GPU (Step 3).  Now I've combined the Steps 1 and 2 into one loop and worked on optimizing Step 3.  This has gotten most of my chunks to generate under 100ms (my target is 150ms per chunk with all wildlife added, so I need the wiggle room).  Some of the higher mountain ranges that have a lot of cubes visible will take up to 200-300ms to generate and that is unacceptable to me, so I will continue to work on making performance optimizations.

The only thing left to do before I can declare version .01a complete is adding/removing cubes.  I toyed around with it for a little but haven't found a final answer.  I also got distracted with the world algorithm and switched to that, so that didn't help.  I will go back to working on that this week so I can officially say that this version is done.  The next version (.02a) will be mainly world items (fun stuff).  This includes more work on the world algorithm, multiple biomes, skybox, day/night cycle, fauna, basic creatures and an actual HUD.  I'll update my roadmap on the right when I get there.

So without further adieu, I give you the latest youtube video (click on it to go to the actual youtube page):


No comments: