Monday, 11 November 2013

From XNA to Unity: That's no moon!

Some good Unity progress to report this is the first public demo!  I got all the voronoi sphere generation code up and running in Unity along with the line and vertex color drawing.  Hurray!  Go check it out and play around with the sphere generation parameters.

Voronoi sphere in Unity 
Moving to Unity is proving to be a very good thing.  While I prefer writing this code with XNA and Visual Studio Express, once I'm into spawning units and creating interfaces I think that's when Unity will really come into it's own.   For this early procedural stuff I'm copying and pasting it into MonoDevelop for Unity once done.  That integration is a little awkward, the solution keeps refreshing and the syncing to dropbox, where I back it up, keeps throwing the odd file in use error.  It's a bunch of minor fiddly stuff though.  You can use Visual Studio with Unity but I was getting linebreak errors and other quirks, so it's seems best just to use MonoDevelop which is...well it's ok.  For the really important step though, the build & deploying of a game, Unity seems tons better.

Tortured indices
Couple of glitches for the week, got my indices messed up on the first attempt but that often seems to produce interesting results anyway.  Not entirely sure how Unity handle mouse picking, I think I'll need to create static rigid bodies for all of the voronoi regions, and I presume it has it's own octree implementation which is nice.  That crossover between XNA  and Unity might be a little tricky to translate.  Next step though is to get a unit up and moving around.  Then we can go exploring the surface of the sphere.