Late resolutions

It's still January, so there's still time for me to make new year's resolutions, right? Good.

My new year's resolution is to release both Cities in the Sky and Banditos by the end of the year. They probably won't be final releases, but for each of them there will be something you can download and play and enjoy, at the very least!

I've just realised I've not really written anything about Banditos yet; I'll make a note to do that soon too!

Gone with the windmill

Really Ben, you couldn't think of a better windmill pun?

So I fancied doing a bit of 3D modelling recently, and got cracking on a new type of building for CITS - a windmill. In the process I've learned about all sorts of arty things - modelling, UV unwrapping, texturing, rigging, and animation (the blades rotate, you see). Ignoring the pretty naff texturing (which is basically an AO bake with some tints applied in Photoshop), I don't think it's that bad!

Windmill

Oh yeah, and I got myself a new skybox too, as the old one is stupidly bright and has massive black gaps in it. And I fiddled with the grass material a bit. I'll get onto some more gameplay soon, I promise!

Real live footage of Cities in the Sky!

I've been busy getting Cities in the Sky back up to where it was before I decided to replace the physics engine, and it's now at a point where it's actually better than it was before. Movement of the island is more fluid, the game performs better with more buildings and people in the world, and it's much more predictable than it was before - previously it loved to explode in interesting but stupid ways.

So to celebrate this, and to make the 'videos' section of the new CITS website look a bit less sorry for itself, I've uploaded to YouTube a tasty tasty video of CITS gameplay!

It looks like Google Videos is being decommissioned in favour of YouTube, so I thought I'd best get with the times. Unfortunately someone has already taken (and subsequently either abandoned or deleted) the names "hymerman", "BenHymers", "BHymers", and just about every other nickname I've gone by, ever. So I've had to go with one of their suggestions; the terribly self-important-sounding "TheBenHymers". Brilliant.

An update! Progress! Hooray!

It's been a very long time since I wrote about anything in particular, and believe me when I say I think about it every minute of every day, roughly. Maybe slightly less than that.

Since the last post, I've done all sorts; gone through crunch and release of Kinect Sports, cruised around California a bit, had my eyes lasered, and started a top secret new project.

I've also been making progress on Cities in the Sky, believe it or not! The unfortunate thing is that everything I change I think is too unimportant to write about, so I don't. And the more time passes since the last update, the more interesting the change has to be for me to consider it website-worthy. So I end up never writing about anything :(

From now on, I think I'll just write about what I've done recently, regardless of if it's interesting or not. Well, I'll have some kind of standard - you probably won't care about my latest whitespacing strategy.

To get the ball rolling, here's a quick run-down of everything I've done since the last time I wrote about CITS:

Gameplay

  • Lots ...

Egad, two updates in as many days?!

Yep, that's right, I'm writing blog posts on consecutive days now. Whatever next; Twitter?

Anyway, I've tapped on my keyboard a bit more and have now gotten rid of those pesky Piece and Debris classes once and for all, and fixed up some bugs that have crept in during my purging. Pieces are now defined by their behaviour components, which take their parameters from good old objects.xml. To show off how fantabulous this is, I went and added raise pieces in the shapes of crosses, lines and blocks, and had them hooked into the game in probably under a minute.

Eye candy is always nice, so here's a screenshot of the CITS after a couple of minutes of play:

Busy island

No more buildings any more

I've done a wee bit more work; the Person class is now completely gone and replaced by GameObjects with PersonBehaviourComponents. Also Building, and its subclasses SmallHouse, LargeHouse and RaisableHouse are gone, replaced by GameObjects with NormalBuildingBehaviourComponents and RaisableBuildingBehaviourComponents. What this means to me is squeaky clean code and the right to lord it up over other programmers, and what it means for you is that I can now edit my objects.xml file to have a "Lighthouse", "Observatory", "Sheep Factory" and so on without having to go through lots of copying and pasting (and subsequent maintaining) of lots of C++ code. Hurrah!

I actually removed Person a little while ago, but I didn't think you'd be particularly interested. Not that removing Building and friends is any more interesting to you but it was quite significant to me! That, and Rich told me to write another post. Is this satisfactory, o great blog critic? :)

Isn't XML clever?

One of the things I've been doing recently is transitioning from an inheritance-based to a component-based game object system. I started the project with full knowledge that component-based game object systems are better, but intentionally didn't implement one since I thought it would be unnecessary for such a small game. It turns out that I was wrong, and since it's something I'm very interested in and have thought about a lot, and since something similar was going on at work, I thought I'd give it a go.

Originally I had specific classes (Building, SmallHouse, Person) that handle everything about themselves (like graphics, physics, game logic) and do all their processing in a big 'update' method. I've factored out and moved around this code through several stages, keeping it building and running along the way, as it's dangerous to just rip it out and start again. Now I'm at a stage where these classes have been replaced by a GameObject class, which owns a collection of Components, whose subclasses like PhysicsComponent and GraphicsComponent are registered with and updated by PhysicsSystem and GraphicsSystem respectively. GameObjects can be created by name from a GameObjectFactory, and ...

Random bits and bobs

Just a small update this time; I noticed the lighting was a bit odd in that the surface of the island seemed to be shaded uniformly and the underside was a bit too light, so I tweaked that.

Also I noticed looking at the past few screenshots that the island is the same each time, when it's meant to be random! That's a shame since I spent quite a while making a nice island generator. So I reinstated that code and now it's generating random islands again every time.

Lighting tweaks and random island

You may also have noticed that I'm now using Flickr to host screenshots (well done you). I chose Flickr because Picasa seems to reduce the quality of its thumbnails massively, which is really annoying and makes CITS look even worse than it should do. Also Flickr's image previews happen to be exactly the same width as the text on this page which pleases me :)

Still, one tiny update in over a month? I'd be a bit miffed if I were you. Trust me though, I've been doing all sorts of other interesting things (that don't deserve screenshots) which I'll post about very ...

Happy little chaps and demolition

As I said in my last post, the next thing I wanted to get done was to fix up the physics on the raisable buildings by rejiggling the code for the Building class. I've now added 'Debris' which is spawned by each 'Building' when it decides it's time to fall off the island. Currently all the buildings just spawn a piece of debris that looks exactly like the building itself, though in the raisable building's case this means one piece per floor. Since the physics can be a tad unstable at times, this can result in interesting-looking explosions such as that pictured in this screenshot!

Broken buildings and little people

You may also notice there are some bright orange buildings there. If you don't notice them you're not looking very hard. They're just replacements I made for the 'tudor house' mesh that I borrowed from Ogre right at the start of this project - it was unnecessarily highly detailed, a bit ugly, and not mine. These new buildings have only one of those problems.

I also replaced the graphics of the people - they're now little chaps made out of several cuboids (what an evolutionary leap!). They're even textured ...

Skyscrapers

Tonight I added those raisable buildings I was talking about. This involved a lot more work than you'd think! Mostly this was because it's quite a radical change from the way things are done currently. Each building is made up of several meshes now - a ground floor, a roof, and several middle floors, whereas before there was the assumption that there was a 1:1:1 mapping between building, physics object and mesh.

High-rise buildings

You may also notice that I've thrown some random rotations of buildings into the mix. This pretty much came for free when I was adding in all the other stuff, so I'm happy since it makes things look a whole load more interesting! Similarly, it'll now be easy for me to add things like stilts/foundations to make sure buildings don't hover like they can now, or to add scaffolding temporarily just after construction, or to change the appearance of buildings entirely (make them more futuristic as the game progresses or the buildings are developed enough). All graphical niceties that I'll get to in time!

Unfortunately I've broken the physics on those buildings since they can no longer just ...