Archive for January, 2007

Defeat

Tuesday, January 9th, 2007

Unfortunately, I’m now back at university and have a fair few bits of coursework to get working on, so this project is being put on the backburner for a few weeks. I’ll still work on it every now and then, and hopefully have a prototype out soon (once I fix up what I’ve got), but the game is very unlikely to be released this term (the next 10 weeks).

More importantly though, Tim bet me £10 I wouldn’t have the game done by now, and it turns out he was right. Crap. I underestimated how much time family, friends and Christmas itself would take up, and didn’t expect physics engines to be as much of a pain in the arse as they have been. Still, it’s been an experience, and it’ll most certainly be completed over easter, so it’s not over yet.

The physics bits are looking better now, I’ve nearly sorted out all the problems with instability, and buildings can fall over and whatnot after being placed now, which is cool. There’s not a lot left to do before I can call it a prototype, so you can still expect an announcement sometime in the next few weeks.

Crap

Saturday, January 6th, 2007

Bloody crapping pile of wank with a cherry on top. I had no idea physics libraries were so crap. I’ve been wading through my code, purging it of everything OPAL and replacing it with Newton bits, and in the process have been finding out just how terrible the library actually is. In OPAL, you set the gravity like so:

sim->setGravity(opal::vec3r(0,-9.81,0));

Nice and easy. In Newton, you have to set a custom callback to a function that will be called every update, which adds a force to the object, for every object. I won’t demonstrate what that looks like in code, just believe me when I say it’s horrible. Anyway, I got all this coded, then ran the app and basically not a lot happened. Stupidly, the world size is set by default to something very piddly indeed, and anything outside the world stops.

Many problems like this later and I eventually find out that arbitrary meshes (such as my island) can only have infinite mass (ie. they’re immovable). Bloody great.

So, Newton is rubbish, OPAL/ODE are rubbish, what’s next? PhysX looks good, and it seemed that way until I got hold of the API (After registering with them - all very businesslike). Apparently that can only handle static meshes too. Frankly, I’d be pretty peeved if I was an Xbox 360 developer who’d just paid $50,000 for the library, and discovered I couldn’t simulate anything that’s not a box or a ball. Knobbers.

Tokamak was next on my list, and was looking good until I again saw the word ’static’ next to ‘mesh’, though I only found this after browsing their wiki (which details such classes as ‘neM4′, ‘neT’ and other cryptically named oddities), their forum (which details such themes as ‘amateur cum’, ‘bukkake movie’ and other erotically challenged topics), and their API documentation (which I’ll let you look at yourself. HAR!). What a bloody disgrace.

Bullet is apparently rather good, but I beg to differ- once again, no mesh support beyond ones that can’t move. And there was me thinking physics engines were all about things moving. Silly me. Anyways, finding this out required a lot of browsing around manually, as they’ve somehow cocked up their website so that their ’search’ feature simply tells me “you have requested an invalid special page”. Wankers.

Everything else I can find either has no support from the developers, costs more money than I’ll ever own, has no mesh support or has been bought by Ageia (the PhysX people). So, where does that leave me…..?

Back with OPAL. What a huge waste of time. I guess I’ll just have to battle the weird instabilities some more. Or release a buggy, crappy game, I don’t know. Frankly I’m fed up and more than a little disillusioned with the current ’state of the art’ in physics engines. I think for my next game I’ll just do pong. Night night.

Bollocks

Friday, January 5th, 2007

Well, crap, looks like OPAL is actually very unstable for what I want to do. I’ve tweaked and fiddled and tweaked some more, but everything still goes crazy after a little while, and frankly I can’t be arsed any more. Unfortunately I don’t know how to make a video of all this craziness, and screenshots don’t show what’s happening at all, so you’ll just have to take my word for it :)

I think I may switch over to Newton - I’ve heard good things about it, and apparently it’s more stable (though a little slower). There’s a lovely interface between Newton and OGRE (called OgreNewt) that I’m just checking out now, it seems nearly as simple to use as OPAL. Unfortunately I’ll be scrapping a lot of code since the two are actually quite different, so it’ll be a rather large step backwards.

I hate programming.

Arse

Friday, January 5th, 2007

Well, I didn’t actually finish what I was suposed to be doing, instead I ended up going to see the rather excellent Robin Bibi Band in Southsea. It’s the fourth time I’ve seen them, but they still blow me away… this time, they performed perhaps the best mix of Oh Well, Auld Lang Syne and the Batman theme I’ve ever heard. Perhaps…

Still, before I went, I managed to almost get the thing working properly - attaching buildings to the island and seeing it tilt slightly depending on where you place them. It’s not quite right yet - there are some stability problems and some tweaking needs to be done - but it’s getting close to being a prototype… stay tuned :)

Falling islands

Thursday, January 4th, 2007

CITS Screenshot 07-01-04cI hadn’t thought of that… the island is now simulated realistically, but in real life islands can’t fly. The screenshot is taken looking downwards, as the island is falling :(

Crazy physics!

Thursday, January 4th, 2007

CITS Screenshot 07-01-04bWell, I managed to get collisions with the surface of the island working correctly, and now the buildings tumble and roll nicely when you place them somewhere they’re not allowed! The funny thing at the moment is that since they get ‘activated’ when they touch the ground, and by that time they may be inside another house already, they tend to shoot out at stupid speeds, which is entertaining but will be changed soon :)

I also need to have some kind of timeout, since the buildings just hang about on the island after they’ve rolled around a bit. Maybe I’ll just make the island really slippery though… there are tons of solutions, I quite like this partifular bit of development! :)

Physics well on the way

Thursday, January 4th, 2007

CITS Screenshot 07-01-04Well, after a long day of reading all about physics libraries and whatnot, I’ve not only settled on a physics API (OPAL - the Open Physics Abstraction Layer) but also started on integrating it with the game.

I’ve got the basics done - that is, representing each house as a physical entity, linking this up to the graphical entity and replacing the old control scheme - but there’s still a lot to do. The island doesn’t exist in the physical world yet, so houses that aren’t attached fall straight through it, as you can see in the screenshot! It looks like the this is going to be the hardest part, since it’s not easy to represent physically - it’s a completely arbitrary mesh, which OPAL won’t like very much. Houses are currently represented as cubes, and won’t be much more complex than that when they’re done since OPAL generally likes only primitive shapes.

There’s also lots of other stuff - houses falling over, attaching them to the island, and so on - but it seems OPAL is actually fairly easy to use, so I expect I’ll have something quite interesting to muck about with by the end of today. The balancing of the island may take a little longer though, since I’m not sure that a completely realistic approach will be very fun to play.

Once I’ve got the physics done, and the Island tilting and whatnot, I’ll package up what I’ve got and post a download somewhere. The first alpha version is on its way :)

… And there was light

Tuesday, January 2nd, 2007

As you may have guessed from my last post, I’ve implemented the bits of code responsible for calculating the slope on each square, and for preventing buildings being built on terrain that’s too slopey. This is great, since my todo list is now one item shorter, and it feels a little more like a game.

CITS Screenshot 07-01-02Unfortunately it was very hard to tell what was a slope since I hadn’t implemented lighting properly (all the normals were the Y axis… yes, I’m lazy), so I figured it was time to figure out how to do that. I’ve written some more ugly looking code to work out what the normals should be (not entirely easy), and it looks quite good so I guess I wrote it correctly. It looks a lot darker and gloomier than the happy, cheerful screenshots of last year, but that’ll be sorted after a few tweaks and gratuitous over-the-top bloom effects.

CITS Screenshot 07-01-02bThe shadows I thought I’d throw in at the same time look a bit crap though… Basically, using OGRE there are two classes of shadows, and using the nice looking ones eat up memory like a fat hungry memory-eating… guy. I’m sure there are some things I can twiddle (I’ve done no optimisation yet), but for now I’m sticking with the crap looking ones, since I’m only doing this for the necessary graphical cues to users.

Tomorrow I’ll get started on the physics. I’ve got some ideas as to how to do it, I’ll have to wait and see how those turn out!

Oh noes!!

Monday, January 1st, 2007

CITS Screenshot 07-01-01bThe hill’s too steep to build on! What to do?!

Happy new year and all that!

Monday, January 1st, 2007

CITS Screenshot 07-01-01Yup, it’s 2007. Excellent.

Moving on, I’ve added a semingly insignificant feature (that took quite a while to get working right) - you can now see where a building will be built. It looks quite nice to me, and it’s all nice and flexible. Oddly shaped buildings are supported, and the area turns red if it’s an invalid spot. Next I’ll be sorting out how to determine invalid spots, as currently everything is valid! I know I said I’d get onto physics, but basically that’s going to be really hard and I don’t like hard work.