Black:  ravenblack.net | me | games | books | email | wishlist | rss
Blogs:  Angryblog | As Above | MonkyBlog | Nightshade | Journals
Blimey:  SomethingAwful | Advice
Archives: Last 4 Days | June2001 | July2001 | August2001 | September2001 | October2001 | November2001 | December2001 | January2002 | February2002 | March2002 | April2002 | May2002 | June2002 | July2002 | August2002 | September2002 | October2002 | November2002 | December2002 | January2003 | February2003 | March2003 | April2003 | May2003 | June2003 | July2003 | August2003 | September2003 | October2003 | November2003 | December2003 | January2004 | February2004 | March2004 | April2004 | May2004 | June2004 | July2004 | August2004 | September2004 | October2004 | November2004 | December2004 | January2005 | February2005 | March2005 | April2005 | May2005 | June2005 | July2005 | August2005 | September2005 | October2005 | November2005 | January2006 | February2006 | March2006 | April2006 | May2006 | June2006 | July2006 | August2006 | September2006 | October2006 | November2006 | December2006 | January2007 | February2007 | March2007 | April2007 | May2007 | June2007 | July2007 | August2007 | September2007 | October2007 | November2007 | December2007 | January2008 | February2008 | March2008 | April2008 | May2008 | June2008 | July2008 | August2008 | September2008 | October2008 | November2008 | December2008 | January2009 | March2009 | April2009 | May2009 | July2009 | August2009 | September2009 | February2010 | March2010 | June2010 | July2010 | August2010 | September2010 | October2010 | November2010 | December2010 | February2011 | March2011 | April2011 | May2011 | June2011 | July2011 | August2011 | September2011 | October2011 | December2011 | March2012 | April2012 | May2012 | September2012 | December2012 | March2013 | April2013 | May2013 | June2013 | October2021

Archive July 2008
Tuesday 22 July 2008
I went to a chinese supermarket the other day, because I like to buy crazy mystery food. One of the mystery foods I bought that time was "Rock Sugar (yellow lump)", which I was assuming from the picture to be similar to the chunky crystals of coffee sugar that I quite like. The ones that are about the size of a small fingertip.

Today I opened the "Rock Sugar (yellow lump)", to find that it's... not quite that. The package contains 16 ounces. That comprises 7 sugar crystals. That would make for some sweet sweet coffee. I really can't think of anything that calls for a single crystal of sugar larger than 2 ounces, other than making a horse hyperactive. [10:51] [2 comments]
I've rebooted myself again, starting on another new game project. This time I'm starting with physics, because physics is fun (not to program, but it makes for fun games). I was originally considering making jelly-physics versions of classic games (bouncy squashy asteroids, Pacman bloating up the more he eats and having to squeeze along the corridors), then I swung towards making a pack of puzzle-type two-player games along the lines of Tetris Attack (and less puzzly ones like Tron Light-Cycles variants), but I looked at what gets published on XBox Live Arcade, my chosen target platform today, and decided that individual polished small games is a better way to go than packs of less-polished smaller games, both for ease of publishing and reduction of work.

So, I started work on the physics of Secret New Project X, wrestled with getting my head round it for two days, and now, suddenly, it has all fallen into place, and it's beautiful. I'm using Verlet Integration (this is a good article, and I was also guided by this paper), for 2D physics. Each body is a triangle of three points with an arbitrary-shaped blob wrapped around it. The three points are joined by firm sticks. The result of this is that if you push on any piece of a body, the force is distributed appropriately amongst the points, leading to spin if there should be spin, and no spin if there should be no spin, pretty much completely effortlessly. The collision detection (on the blob not the triangle) is still a bit of a bear, but that's always been the case.

But that's not the beautiful thing. The first beautiful thing is that when two objects are joined, like, say, a person and an arm, all I have to do is add a new 'arm' body, and pin one end of it to the 'body' body's triangle, and it's acting appropriately already, swinging freely. (Also need to make it ignore collisions with the body it's attached to, but we're not talking about collisions just now.)

But that's still not the really beautiful thing. The really beautiful thing is that the constraints between points are arbitrary and I can extend their behaviour however I please. The upshot of this is that, for example, I can make a weak join, which, if a force is pulling against it more than (arbitrary amount), separates the join and the pieces come apart. Perfect for, for example, the join between a person and their weapon, or a horse and rider. Pushing down on the rider wouldn't separate them, but up or sideways hard enough and pow, they're dismounted.

But wait! That's still not the truly beautiful thing. The truly beautiful realisation is that I can make joins with timers that are caused by events. What do I mean by that? Well, again using the horses and riders for example's sake, imagine a lance charging into the chest of a rider. Pow! The rider is dismounted. But is that all? How about if, in addition, the lance sticks in for a few seconds, carrying the rider along, squirting gore all the way! And even better, the lance could stick into non-meat objects too. Charging beneath a low bridge, the rider forgets to lower their lance and pow! The rider is dismounted by his own lance, left hanging off the bridge for a moment until the lance drops out.

I don't think I can convey how lovely this is, because there's no way to convey how elegantly the code will do all of this, with almost no effort at all. The same physics code also effortlessly does flowing cloth and, with only a little more effort, jelly physics (which I'm not doing right now). I think only a programmer might understand my joy.

Relatedly, I finally decided to take the plunge and try C#, and it's actually not bad at all. Not really much different from C++, practically, but by being higher level it stops me trying to optimise everything when I know perfectly well I don't have to. And XNA is certainly less of a pain in the arse than DirectX. Also, the compiling is lightning fast compared to C/C++, presumably by virtue of the redesign leading to the equivalent of precompiled preloaded headers automatically. Also, no messing with header files. I'm quite impressed. If only they'd called it something you could type into search engines! C# and .NET, you bastards Microsoft. You must have done this on purpose. Surely.

I'm sure there's a fair amount of "another new project? But you didn't finish the last one, or the one before that, etc.!" reaction, which is appropriate. Hopefully this one will be a good one because it meets all three of the criteria whose absence I've identified as reasons why I've dropped other projects.
  1. It's not a massive project.
  2. It's relatively easily published (though still not easy.)
  3. I would like to play it. (3.5. Multiplayer, so I would still like to play it even when I'm sick of making it.)
[07:42] [0 comments]