Surprise!

March 8th, 2009

Hah, I bet you didn’t think I’d wait this long before posting those interesting things, did you? Did you?

What I’ve done is had a good ol’ rethink of the way the gameplay is going to work. Up until now, the idea has been that individual buildings fall from the sky and get attached to the island when they hit it. If you build on top of an old building, you destroy both the old and the new. Your score was going to be decided on a measure of each building’s quality (depending on where on the island it was placed, and which other buildings were around and so on), multiplied by the number of people, to get a rough measure of the total ‘happiness’ of your population.

The problem with this is that you’d quickly run out of space and end up being forced to destroy all your old buildings. There would come a time when your island is full, and your task would change from building a nice city to coaxing the physics system into not wrecking everything each time you place a building. Development would be linear, and capped, and I don’t think that would be very fun.

I went through a few more ideas after this, and after some discussions with the guys at work (that means you Rich!) and an old university chum (that means you Mike!), I’ve come up with something that plays well in my head, which I intend to try out. It’s just a few changes to the old idea, but I think they add up to something quite fun.

Instead of dropping actual buildings, you now drop pieces which can create buildings, or perform some other function. The main pieces will be ‘raise’ pieces, which will raise whichever buildings they hit (or create them if not present. These buildings will be your ordinary houses, and the idea will be to just have as many of these as high as you can make them. Of course the higher they are the less stable they are. The other main types of pieces will be the special pieces, which build buildings like docks, windmills, farms, mines and so on. These will generally have some criteria for where they can be built – docks at the edge, windmills up high, farms on flat ground – and will sometimes have gameplay effects other than their physical presence – mines will mine out a cavity inside the island gradually which will act as a negative weight, docks will attract merchants which will serve as other physics objects to get in the way.

Scoring remains cumulative over time, but instead of the previous sum of building scores times population, it will be a general ‘development’ score (which I see being a sum of ordinary buildings and their heights), affected by several multipliers relating to the special pieces. These multipliers will be things like ‘have 3 docks’, ‘have 3 windmills’, ‘have a really tall ordinary building’, and will be shown as greyed out icons next to the score when inactive, and lit up when active, probably with some crazy effects when several of them are acting together.

I’ve made a start, in that I’ve re-jiggled things to no longer drop buildings but to drop pieces, and I’ve added multi-part pieces (just an ‘L’ shaped raise piece at the moment), and added the base functionality for the raising mechanic (Note that you can also see the temporary Flash-based replacement for the in-game GUI in this screenshot!). In doing all this I’ve learnt some 3D modelling with Blender, which was different. Just today I figured out how to do UV editing and texturing, and exporting that information from Blender into a format that OGRE can use. All that must have appealed to my previously undiscovered inner artiste, since I then spent a few days learning to use my graphics tablet to do a spot of ‘digital painting’, but that’s a story for another day!

About bloody time!

January 26th, 2009

I started work on CITS again a couple of weeks ago, yet somehow it’s taken all that time just to get a couple of really very simple things done. All I wanted to do was to replace Simul Weather with a skybox of a Simul Weather sky, for debug builds, because it takes half a minute to load. So I went to the Ogre forums to ask how to go about saving a cubemap of the current scene out to file. I got no responses (thanks Ogre community!), so I made up my own way. Prepare for a rant.

I figured I’d just have the camera render to texture, then on a button press have it spin round to face each direction, update the texture and save it out. My first bit of fun was in tracking down a bug caused by Simul using the same string name for a texture as I did (moral of that story: don’t use string identifiers for bloody textures! What’s wrong with pointers or other unique handles?). Even so, once I’d sorted that, I found that it just didn’t work like that, and kept saving the currently rendered view.

So I thought I’d have six cameras each with their own render target, which I’d set off all at the same time. Except that did exactly the same thing.

So then I added in loads of calls to various Ogre update functions, to render extra frames in-between updating the camera and saving images. This worked to a certain extent, but gave very strange warped images for some directions, presumably because the Simul state depends on the previous frame and isn’t correct for sudden changes in viewing angle.

So then I thought I’d have twelve buttons mapped; six to get the current camera facing each direction, and six to save out the current view to each file, so I could allow the state to settle manually. Except that generated all sorts of weird twisting artifacts half the time, and the other half it’d make the clouds progressively blurrier each time I pressed a button to change the view.

So then I sat and tweaked values and mucked about with different ways of setting the camera’s direction, and eventually discovered that you could press the buttons in a certain order to get acceptable results, which finally worked. Sadly the sides of the cube don’t quite match up despite setting a FOV of 90 degrees and aspect ratio of 1, and the images are even more over-exposed than they appeared in-game (quite how I don’t know), but I was really quite bored of Ogre and Simul now and wanted to get on with something more fun.

Unfortunately in the process of all this I’d had to downgrade Ogre from SVN HEAD to the last stable release, 1.6, since I suspected it of being buggy, and it just wasn’t playing ball with CITS. It turned out that at some point there had been a switch from one memory manager to another, which required me to edit the Ogre source to change it back to the normal one. That was great fun, since changing something so fundamental requires a recompile, which takes a good hour or so.

Then OPAL went bad. Well, the code that converts an Ogre mesh to a format OPAL can understand went bad. I’d made some assumptions about the index buffer format Ogre uses, which were valid before 1.6, were valid after 1.6, but apparently weren’t valid at the instant 1.6 was released. That’s the fun I’ve been having this evening.

It’s finally done now though, and I can get on with some more important tasks!

There are a couple of other more interesting bits of news about the game, but they can wait for another update!

Flash-tastic

November 8th, 2008

Well, I sorted out a new Simul license so the sky is back to normal (and so I can post screenshots again!). I’ve also done a load more work on the UI. It’s still not totally functional, but the high scores screen displays high scores and the in-game UI shows points and tilt like it did before, so I’m back to normal functionality at least. I also did some clever-but-not-really things like learning a bit of Actionscript, and scaling the Flash output based on viewport resolution.

The high scores screen you see is the result of several hours of tweaking and fiddling. I’m fed up with temporary graphics so I thought I’d try to create something a bit more permanent. It turns out I’m not so good at this though – it looks a little boring to me. It’s not abysmal, but it’s not good either. There’s a chap at work who’s marvellous when it comes to interface graphics, maybe I’ll ask him to sketch something up for me, so I can at least get a nice theme and colour scheme going.

I’ll probably improve the UI functionality next, though there’s another little side-project I’ve been dying to get my teeth into for the past few weeks, so we shall see… yes, we shall see…

Into my face

October 28th, 2008

I had a little time to play with Hikari, a UI library for Ogre that effectively wraps a Flash control and adds some C++ interoperability. This means that I can make a little Flash application and have it run in-game as the user interface, which is much more flexible, easy to modify and generally nice than the Ogre overlay system I’m using at the moment.

I’ve made a Flash file for the menu, in-game UI and high-scores table and they’re being displayed in-game instead of the ugly temporary overlay graphics I had before (that you never did and never will see!). They’re not functional yet since I haven’t really had the time to learn Flash, and the input code I wrote doesn’t keep track of cursor position yet which would make buttons useless. That’s next on the agenda though.

I shan’t give you a screenshot since I still haven’t sorted out a Simul Weather license, so everything looks very ugly!

Typical “I’m not dead” post

October 20th, 2008

Honestly, I’m not dead, I’m just being quiet. I haven’t posted for a while because the Simul Weather evaluation ran out so I haven’t got anything pretty to post screenshots of!

I just thought I’d update you with some of the goings on, however uninteresting they may be to anyone but me.

Game-wise, I’ve been fixing up some bugs that have been around for a while. I finally got annoyed by them enough to kill them off. For example, previously you could only play the game once; if you chose ‘play’ from the menu a second time the game would crash. That’s because Ogre rather annoyingly requires you to give a unique string identifier to everything, and throws a wobbly if you use the same name twice. There are no other options. So I implemented the simplest and most effective solution I could think of: using the ‘this’ pointer converted to a string as the name.

Programming-wise I’ve been improving the quality of the code (I just got Effective C++ by Scott Meyers and it looks like there are one or two things I didn’t know!). I’ve also been writing some more unit tests, which has been surprisingly fun. I like seeing the number of tests slowly rising in Pulse. It’s like a little safety-ometer.

System-wise I’ve been investigating another build tool (partly because I need to for work, partly because I’m still unsatisfied with every other tool out there). I’ve always known Jam has been a good tool, but haven’t tried it myself since I know it’s unsupported and out-of-date. Recently though there was a discussion on the sweng-gamedev mailing list about resurrecting Jam, and one kind soul, Joshua Jensen, has started maintaining a modified version of Jam called JamPlus. I’ve tried it out a little and found it to be blazingly fast, and it scales excellently with the number of processors you have, which beats Visual Studio’s project-level parallelism hands-down. I’ll be seeing if I can write some Jam scripts for CITS soon.

Since JamPlus uses git for source control, I’ve also been investigating that, and it sounds pretty interesting. I can’t see it improving things for me since my project has only one author, but for larger teams it’d be great, and would solve a lot of the problems I’ve experienced at work (mostly due to the awkwardness of branching, and some terrible diff tools).

So, next on the agenda game-wise will be a new UI. That’s more than it sounds, as it’ll also make the current ‘menu’ (press ‘p’ to play…) and the highscore entry (you’re always Anonymous…) usable, as well as improving the in-game information display both in looks and functionality. Should be an interesting and worthwhile change, anyway.

Hmm. That’s a surprisingly large amount of text for such a small amount of information.

Clouds (really)

September 7th, 2008

Clouds are just about more or less sort of done. There are just a few loose ends to tie up (for example, at the moment there’s no ground, just a big black square if you look down, and the lighting is messed up at close range, hence the zoomed-out shot) and some tweaks to be done (it’s all looking rather over-exposed, for a start), but they’re in there, working, billowing their way across the screen in a cloudy fashion. Brilliant!

I just noticed when I went to upload the screenshot that I haven’t given you anything since June, so I’m very sorry about the delay! I’ll try to snap things a bit more often, since pictures are worth a thousand words and all that.

Now that the sky is super-spiffy, I should probably work on making the rest of the awful graphics nicer! I’ll see what I can whip up.

Clouds

September 4th, 2008

Well, I’ve nearly got Simul Weather’s nice clouds and sky in the game. I had a day off because the cable guy was coming to give us TV (sadly he turned out not to be Jim Carey), so I had a good go at integrating it with CITS but it’s not quite working yet. Well, it’s working, it’s just not working quite the same way the game is expecting it to work. I need to do some tweaking and fiddling, basically. The bits that look right are looking gorgeous though!

Sadly it’s looking like Linux support isn’t going to happen any more, since both Simul Weather and the library I’m hoping to use for the GUI are very heavily Windows-oriented. Looking at Google Analytics though, 94.44% of the visitors over the past month use Windows so I don’t know if that’s such a huge deal. I’ll keep it building and running on Linux since that’s what my build server is using, it just may not have nice sky or GUI!

Shouldn’t be long before I have some shiny new screenshots for you all!

Tests, clouds, and wasted time

August 29th, 2008

I managed to get loads done on Wednesday, but it’s all under the hood stuff (I wanted to ease myself back into development by writing something not too important). Basically I wrote some bits of maths code to remove a dependency on OPAL from some code that shouldn’t need it. The nice thing is that I wrote unit tests for everything as I went, so the new code has 100% test coverage and since I wrote the tests first it has a nice, simple and easy to use interface. This pleases me.

Thursday was not so successful – I started by streamlining the game a bit by removing some unnecessary screens and removing some crusty old graphics I had as placeholders, just to make it feel a bit more like a proper game. After that I tried making some half-decent graphics for the menu and in-game HUD, not to be totally functional but to get the look and feel right, and whilst I came up with something that looks good in Photoshop I didn’t manage to get that into the game too well – Ogre seems to like blurring textures a lot when not displayed at the exact original size, making text quite ugly. I haven’t solved that yet, but hopefully I won’t need to if the eventual UI system I use is good enough!

I also tried to improve the look of the sky – I went on holiday recently and took loads of photos from the plane so I could use them to get the feel of the environment right. I stumbled across Simul Weather (formerly Simul Clouds), which I’d seen screenshots of before, and decided it looks exactly how I want the environment to look, so I set about integrating an evaluation version with the game, but encountered many problems (probably my fault) and ended up with not a lot to show for my efforts. Ah well. I got some nice-looking mock-ups done though.

So, I’m back at work today and probably won’t be able to work on CITS again properly for another week and a bit. I’ll keep you posted on anything new though!

Interface in your face

August 27th, 2008

After a fair old bit of research and tinkering, I’ve decided to hold off on getting cracking on improving the interface since the GUI libraries available for Ogre just aren’t mature enough yet, and I have super-secret insider information that the solution I’m waiting for is in development. Once that reaches maturity I’ll be sure to start using it straight away as that’s the main area for improvement at the moment – the menus are horrible and the in-game interface is lacking things I want to show, and the current system makes this very time-consuming to change. I’ll eventually be using a Flash-based GUI system, which will allow me to develop interfaces in Flash (which is perfectly suited to the job) then send and receive messages to and from it from the game. Trust me, it’ll be beautiful!

It was my Birthday a few days ago (I’ve been around for 23 years now!), and my lovely girlfriend bought me a Wacom Bamboo Fun. I’ve been doodling away ready to try my hand at some concept art, with a view to getting a bit of direction art-wise, rather than the borrowed models and textures in use at the moment.

Right now though, I’ve got two days off work, so I’m going to be working on improving general gameplay – making it feel even more fun and making it just work as a game. That’ll involve improving the controls, tweaking the physics and other simulation parameters some more, and controlling the camera sensibly. After that I’ll post up another video, which will hopefully show that I haven’t just been sat on my arse this whole time!

It’s only fair to giveth back what you taketh away

August 7th, 2008

I just allowed people to be born, to balance out all the people that get sent screaming (in a silent fashion) to their doom. The birth rate is linked to the number of buildings you have. Hopefully this will prevent the game feeling like it’s slowing down as you get further in (which is exactly the opposite of what I want!).

I also changed the lose condition from “angle > 25″ to “people == 0″, partly because it’s much more fun the second way and partly because it’s really difficult to stop the island tilting, which makes debugging things very difficult!

Incidentally, I felt something different when I played CITS last… fun. It’s actually starting to feel like a fun game, despite being painfully simple. Huzzah! Next up is getting some UI up to show the state of things, which will probably require a bit of effort since the overlays system in Ogre is terrible, and I’d rather use a proper GUI library (even if I have to write one myself).