Archive for October, 2007

Buildings and crazy hidden fun stuff on the way!

Saturday, October 6th, 2007

I’ve refactored to a point where it should be straightforward to add more buildings without the fear that things will get messy further down the line, so since more building types are the most valuable thing I can add in right now, that’s what I’m doing. I’m going to use the excellent set of free models by Tucho for the time being, since they are pretty high quality and more or less fit in with the overall appearance of the game, but eventually I’d like to get some nice custom stuff done by either my good friend Mike (forgot your website, sorry Mike!) or Josh Larson, who offered his help some time ago (hope you haven’t forgotten, Josh ;)). The models are all exported into Ogre format and ready to use, so expect to see some pictures of interesting new things soon!

Also, I completely forgot to mention the fun side of all this refactoring - it should now be really easy to add in all sorts of gimmicky and not-so gimmicky features since the code is a lot more modular now. It shouldn’t be too hard to get multiplayer going (uh-oh, islands crashing into each other!), for example. I really need an issue tracker set up so I can sort all these crazy ideas I have by ‘business value’.

Poetry (amongst other things) in motion

Thursday, October 4th, 2007

Hooray for Google, once again! I thought I’d have a go at recording a video and getting it put on YouTube. It didn’t take long for me to dislike it though - there’s far too much going on, it’s too cluttered, and there’s too much unneeded functionality. Also, despite being owned by Google, there wasn’t an easy way to just add it to my Google Account. Instead, I headed over to Google Video to get an idea of the difference. It’s a bajillion times better - no clutter, easy as pie to use, and generally very slick. Highly recommended by me.

So, once I got to the “choose a video to upload” stage, I set about recording a video. I tried a variety of screen capture programs, but most produced horribly choppy video, presumably because they’re intended for relatively static desktops and so on, whereas I was recording a game in which every pixel was changing every frame. I ended up downloading Fraps (a brilliant piece of software, despite the odd interface), which unfortunately dumps out huge AVI files, so I went looking for something to edit and compress my videos. Again, I went through several pieces of software (one of which NOD32 informs me is a virus), and ended up using VirtualDub. It’s a little rough around the edges but it does exactly what I want it to do, and it does it well. Well, once you know what you’re doing - my first attempt compressed 150MB of video into 250MB, oddly.

Anyway, long story remaining long, I got the video uploaded and it’s now sitting happily on Google’s servers, ready for you all to watch. In fact, I’ve embedded it in this very blog post so you don’t even have to go anywhere. Happy days! It’s not a very exciting one, mostly just to show you all that I’m not just faking the screenshots or anything silly like that.

Programming is fun

Wednesday, October 3rd, 2007

Now that I’ve had a few days to do things other than search for jobs or flats, I’m getting back into the swing of development again, and really quite enjoying it. I’ve had an epiphany of sorts and seem to be able to actually program really quite well, as big-headed as that sounds.

Previously I’d be able to write code to do all sorts of stuff, but after a while it’d start getting tangled up with itself, surrounded by unnecessary crud, and development would grind to a standstill until I could be bothered to press delete and start again, with that little bit more experience.

I took a look over the code of CITS and decided something had to be done - there were ugly dependencies everywhere, lots of huge objects and massive methods, things had far too many responsibilities and so on and so forth. Most of the rules of good design had been broken (consciously, as I figured they wouldn’t matter on a small project). Adding a new building would have been a tremendous amount of work, let alone finishing the thing.

Now though, something has clicked and I’m refactoring like a beast (beasts are good at refactoring, I’ve decided). After not very long I started making small changes here and there, making sure I didn’t break anything and kept it running identically as I went. First thing was to separate out the graphics code from buildings into a “building graphics” component, which went well. Then I separated out the physics in a similar way. Then I tidied up the building class, and re-arranged the dependencies of all the other classes to depend solely on the specific bits they needed. After each change, however small, I’d compile and run it to check that things were working, then check the code in to the newly set up SVN repository. As I went, classes got more focused and small, dependencies started to make sense, the code got cleaner in general and compile times were reduced significantly. Dare I say it, the bits that I’ve touched up are actually really quite good now. Refactoring is fun :)

Things aren’t perfect of course; there are plenty more areas to refactor that are going to be a little more difficult (for example, the low-down bits of the island’s physics depend on low-down bits of its graphics, since the physical representation of the island is built from the contents of the vertex buffer). Also, I kind of wish I had started off with good practices at the very beginning - it would be great to have a full suite of unit tests to ensure correct functionality rather than having to run the game every change, and an issue tracker would be very useful.

Anyway, the short of it is that CITS is back on track, and once I’ve sorted out these slightly more tricky refactorings I’ll be back to adding functionality and pumping out pretty screenshots for you people :) Don’t be surprised if the new job and the move get in the way of things though!

A slightly more exciting update on life

Tuesday, October 2nd, 2007

A lot has happened since my last update! Firstly, after receiving numerous very good offers up and down the country, I finally accepted a position as Graduate Software Engineer at Rare in Twycross. It was a tough decision since there were three offers that stood out as being absolutely excellent, but I settled for Rare since they take care of their employees well (being owned by Microsoft…) and it seems like a fun place to work, which is the most important thing I guess. It just seems like such a shame turning down such good offers :(

Anyway, after the weeks of constant phone conversations, interviews, emails and so on, I thought it’d be nice to have a break. This didn’t happen of course, since I need somewhere to live. The very day they sent through the contracts to sign, me and my girlfriend rocketed off up North to find a new pad. We looked around Nuneaton (yuck…), Hinckley (eww…), Coalville (oh dear god) and Atherstone (yay!), and long story short ended up finding the perfect flat; it’s in the lovely town of Atherstone, it has a balcony overlooking a canal lock, it’s spacious and well-presented, and it has a garage for our bikes. We’re both dead chuffed :) Unfortunately the current occupants don’t move out until after I’ve started work so I’ll have to spend a couple of weeks living in a B&B, but it’s all paid for by them so no worries I suppose.

Right, those are the exciting bits… what else have I done?… I polished my bike the other day, and… ate… some cheese…

Ok, that’s about it I suppose, stay tuned for updates on CITS, more travel journal stuff, and more of me bleating on about how sickeningly successful I’m being at the moment.