Sunday, 27 October 2013

Upon a Voronoi Sphere

The title may sound like a poem, but it's the start of a new game.  I started work on this a few weeks ago with a few ideas in mind.  I really liked the spherical properties of 'Last Chapter', like the camera motion etc and I wanted to build on some of the things I'd developed from that project.  This time though I'm going to work from a bottom up perspective rather than start with a high falutin' idea.  'The Prettiest Ribbon' is a result of that method, taking well known gameplay and build up from there.  I've settled on developing a cool turn based strategy game.  The first thing to tackle...the map.

A voronoi sphere with overlaid delaunay triangulation.
With zero to handful of smoothing

Rather than work on a flat grid, I want to generate a map on a sphere.  This is not totally straightforward and I may well fall back to a 2d grids but I think I've figured out the steps needed.  To create a more interesting adjacency I want to use voronoi regions.  There's a great article and demo that provides tons of help on this. The math for doing triangulation on a 2d plane is tricky enough but I got a simple case up and running, the 3d case was way beyond my abilities though.  A bit of internet searching though and I found a great C# library for creating convex hulls for physics collisions which conveniently are also delaunay triangulations.  I feel I need a tag for "I'm not sure if this is hard or I'm just stupid" because even though I'm not really writing the really hard math code it still takes me ages to work out how to piece the code together.  It's coming along pretty good though, check out the potential when I use more points.


The other news this week was that 'The Last Chapter of Man' was released on Desura.  Yay! And a bunch of people had trouble installing and launching it.  Boo!  It's a really frustrating thing as I don't know where the problem lies.  It could be the installer. (Though I followed the walkthrough from Microsoft to the letter).  It could be some bit of code I've written that doesn't work with certain monitor configurations.  It could be a driver issue with their system.  I just don't know.   In some ways it's good as I was fairly keen & happy to stick with XNA even though Microsoft have abandoned it themselves.  But if the framework can't be deployed reliably, and there are some interesting comments on the microsoft installer, then it's value is questionable. So I'm going to check out Unity this week, already had a little look this weekend, and I'll see if I can recreate what I've already done in xna.  There are another couple of other tools out there, both the wave engine and sunburn are an option, but I'll no more by the end of this week.

The users on Desura have been very patient and kind about this though.  It's upsetting as one the main points of XNA is to abstract away the difficult parts of handling windows & graphics devices etc.  So if it's not working it's frankly above my technical ability to debug.  And then all I can really do is apologise, and like I said, they've been surprisingly pleasant about the bugs.  Desura users.../good /people.