Developer Diary: Tuesday 28th September 2010

Chimera Supervision

I had a pretty grim day at work today, so it was vital that I didn’t let that affect me in the evening. It did. It slowed me down and made it harder for me to really focus. I didn’t let it put a halt to proceedings, I know that’s fatal.

So I cleaned up the code as best I could. I put cross-hairs up so I could get everything aligned. Can’t believe I didn’t do that before. Now everything is drawing where I want it to draw.

I think I need to do collision detection tomorrow.

Now, I promised I’d talk about design, so here it is.

The Good Stuff

There are three essential themes to this game:

1) Conservation of Energy

2) Materialism vs Energy

3) Constant feedback

“But it’s a maze puzzle game!” I hear you say. And so it was. You also know the subheading for this game. And I do indeed aim to get it right, this time.

Energy Conservation

Energy conservation is an important theme in any game, so that’s not new. What I want to do in this game though, is make it very explicit that everything you do costs energy, except when you’re in the Energy state. (I’ll explain that shortly). Moving forwards costs energy. Rotation costs energy. Retreat costs energy. Climbing costs lots of energy.

You will get opportunities to replenish your energy when the game is in the Energy state.

Materialism vs Energy

I want there to be a constant interplay between the two states or phases of the game. On the one hand, when the blocks are solid and material (as are you), energy use is expensive, but material effects are higher. For example, if you trigger an explosion, it will cost you some energy, but it will also destroy blocks and therefore have a big material effect.

When the ship is in the Energy state on the other hand, you too are Energy and you can freely move into and out of form and merge with the objects of the game. You can then “possess” the objects (some of which will actually be characters, like robots) and do what you will with them. Be careful though, because although you don’t use energy in this state (in fact you recuperate), if the phase turns to material, you are destroyed if you are merged with another object.

Constant Feedback

I want the game to always make it very clear when you are doing well and when you’re doing badly. The game has an intrinsic rhythm of play, indicated by some kind of visual indicator (undetermined) and audio (probably the heartbeat from the C64 version or similar). If you play to the rhythm of the game, the scoring multipliers are massive. I want scores every time you spend any energy, every time there is a composite side effect, and negative scores every time something hurts you. On the other hand, in the Energy phase, things are a lot more chilled, and there is no scoring, only contemplation, recuperation, reconfiguration and reimagining.

What do you think of this?

(Oh, yes, I did a version of Chimera for the ill-fated SuperVision handheld in 1991 or thereabouts. Powerful, nice 6502, but bulky. And no, I didn’t have anything to do with that cover. Why do they all think it was a robot? It screamed! Robots don’t scream!)

 

 

 

 

How To Be Modern

orbital1.png

I managed to get a fair bit done last night, including a utility class for handling isometric projection that was more accurate than the hack I was using, and I also reorganised the test app so that the code was a lot cleaner, breaking everything up into helper functions that could be switched in and out. This meant taking all the crutches off and letting what I had stand up on the bare bones systems in place. The codebase is growing, but it is more organised and useful.

Yes, I did get a vector cube up, but it looks very plain and sad and distinctly unglowy. I did a really silly brute force method – I drew a cube, then drew it again adjacently with alpha. It looks boring. No glow. Perhaps I need more cubes.

I need to write an event manager too, that’s something I realised today.

As for gameplay, I’m continuing to shape my thinking on that and will write something up later today.

geometry-wars-re-vista-ss1.jpg

If anyone can advise me on a quick and dirty hack on how to get glowing vectors going, that’d be really helpful. My favourite examples of this effect are above. I didn’t play Geometry Wars much, but I played Orbital to death and loved it to bits, especially the over-the-top vector glow chic.

My quick and dirty method is shown below. It looks awful. It looked better with line smoothing, but believe it or not, that utterly destroyed the performance. It was stunningly slow.

chimera-vector-glow-example

I suppose I could really cheat and draw the cubes in a paint package and add glow. That’d be the old way. It’d look the same. Maybe even better. It just wouldn’t be very cool. I’m too old for that to matter now, surely?

New Vector Look

I totally adore the visuals for Pix ‘n Love Rush. I don’t think the game is suited to iPhone as much as it would to PSP, but I’m biased, and I also have a problem with abstracting buttons, which are in themselves an abstraction. The visuals are awesome though and the game is charming.

Pixn-Love-Rush-3.png

So I was thinking about how I’m going to represent the blocks when they’re in their energy state (as opposed to matter). And then someone mentioned this game to me at work today and of course, I pulled out my iPhone to show it sitting in my primary games folder, proudly.

I bought the game because of its look, first and foremost.

And then it struck me as I rode a Boris Bike from the office to Frampton Street – I could use vector outlines for the blocks in Chimera, a bit of alpha, and hey presto, energy blocks!

So I’m going to play with that look and see if I can get some blocks going using vectors. Having never done the “glow” look before, I’ll be working it out for myself, but my guess is I draw a solid line and the same line on either side, but with more alpha to get the glow. We’ll see.

I’m not getting much progress with the graphics for the game, so I might as well give vector a go in general while I work out what to do next.

Reprieve

This blog is ostensibly about the remake of Chimera, but the subtitle is just as important – a chance to reprieve past ambition.

Shahid’s recent burst of enthusiasm has even encouraged me to chip away at my pet project. I’m experimenting with an austere text and picture game that works in a small format. Its a space genre, developed with ruby shoes. I’m even using dropbox for access anywhere source control.

I have as much ennui as the next wage slave, but fewer reasons to not do stuff. But this is definitely the retro age, with a proliferation of devices that need content. So now is probably the time.

Wannabe Developer Diary 23-09-2010

xml-data-loading.png

I had to overcome some serious hurdles today. The biggest was my state of mind. Exhausted after a short bike ride and irritated at the new neighbours who are on the roof constantly and don’t care who they disturb, even at this hour, I sat down in front of the machine finally at around 8ish. I didn’t make any headway until 9 when I decided that I wasn’t going to play Call of Duty, I wasn’t going to mope, and despite feeling nauseous, I wasn’t going to take the easy option.

I knuckled down and I got stuck into the room loading XML code.

I had to learn quite a few little things today, and in aiming for full room-display using my Blocks class, I almost overshot. I should have been happy at getting the basic roomdata.xml file parsed correctly. That was a big achievement. I wanted more. So I went for Block storing (didn’t quite pull off the STL list, bodged it with the usual C array code nonsense) and then Block display.

As you can see from the extra blocks, some pink, some blue as well as grey, I’m now loading, parsing and displaying roomdata correctly. This is a breakthrough that I expected would take a few days. I’m very happy.

It’s late, I’ve been unwell all evening, I’m exhausted, but I’m exhilarated. That’s a lot of progress in one evening.

IsoTextPrinter Class – Done

isotextprinter.png

I’ve implemented a general purpose isometric text printing class called IsoTextPrinter. Very simple, inelegant, a singleton with public data members, but easy to use and it works. It allows me to print arbitrary text in any colour, using any TrueType font in isometric projection, either down the X axis, or up the Z axis. There is even a default fallback print case that prints without projection. That might be useful too, perhaps for modeless text. This class is going to be very useful for all the floating scores and text I use for cubes.

The implementation is straightforward. IsoTextPrinter is a singleton state machine. The only passed in parameter is the string itself. Everything else, including the isometric coordinates, colours, alpha etc. can be set by updating the public members. The only members I’ve protected are the instance pointer for the singleton and the orientation, set via a function. No, I don’t know why I made that an exception either.

That was my first singleton. Was it good for you?

Funny, back in ’85, the only Singleton I’d ever heard of was Mike Singleton, the man famous for the seminal Lords of Midnight.

I really enjoyed coding this evening.

One hiccup – I pressed backspace a couple of times over an error and Xcode freaked out and deleted my IsoTextPrinter implementation file. It didn’t just remove it from the Sources organiser, it deleted it off the hard disk. Permanently. It wasn’t even in the trash. A panic Spotlight search revealed nothing. Thank God then, for Time Machine, which had a working version of the file from a few minutes earlier.

Tomorrow, some more XML.

Back On The Chain Gang

nominal-chimera-text.png

I have been pretty unwell as you know. I accepted my lot. Most things in life you can do very little about. It’s shocking that so many things go as you might expect, or then again, maybe they go that way because you allow yourself to become accustomed to how things turn out, whether or not you wanted things that way.

So today, I got back to the office and coughed and spluttered my way through half a day of work. I had very little energy by the working day’s end and expected to get an early night.

I fired up Xcode anyhow and managed to get a fair bit done, of which I’m very pleased. I made progress in a number of areas.

First, I wrote a simple “Constrainer” class that given a point, limits it to a 3D block of variable size. Very simple really, but it stops my man from falling off the edge of the room or climbing above its given height.

You might be interested in where I got the dimensions from? Well they’re being read off an XML file and I’m now using the RapidXML library as recommended by Ricky. Wasn’t as difficult as I feared in the end.

I did have to write a simple File Loader class too, because openFrameworks doesn’t have any built-in file-loading abstraction and neither does RapidXML (it expects a character pointer)

And finally, I managed to get text printing isometrically, which made me very happy. I know this is no achievement for real programmers, but it was a nice, simple problem that nobody had a library for and I had to do it myself, so I was happy with that. Here’s some of the code:

Screen shot 2010-09-20 at 23.46.01.png

Really simple, just to get it working. I’ll turn this into an IsoTextPrinter class next, with the ability to isometrically print down the X axis (remember the Chimera axes, right?) and up the Z axis. the IsoTextPrinter class should also allow a bunch of state setting to allow text scaling, colour, alpha and rectangular background. Then of course, I want the text to behave like particles because it will be used in scores.

I’m looking forward to working out a rhythmic scoring system, but for now, I just wanted to print isometric text.

I’d like to leave you with one of my favourite songs of all time, from one of my favourite bands of all time.

Patience

I’m still very weak and have limited energy. I’ve slept most of the day and am still exhausted. Whilst many of the fly symptoms have subsided, I’m left with a chest infection and am pretty run down. I’ve been off work a week, but I’ve also been off pretty much everything else all week too, including reading, blackberry, TV, you name it. I’ve managed the odd tweet, but even using the iPad in bed has been knackering.

I was off sick from work during a week I should have been celebrating on two counts. I can’t share that with you, but if you know me from work, I can mention them in an IM.

I’m not going to be able to get on with Chimera for another week I don’t think, because as I get back to work, I suspect I’m going to be too exhausted in the evenings for at least a few days and I don’t want a further setback.

I’ll keep you posted. In the meantime, thanks for your kind wishes and prayers. Back soon – insha’Allah – with lots of ideas.

Slow Recovery

Still pretty sick. Having to rest pretty much constantly. Have had flu and I’m praying I’m on the mend. Looking forward to resuming normal activities, like walking to the bus stop and going to work. I am more patient than I used to be, but it is not fun being so useless when I am used to being so busy.

Still Ill

Sorry folks, no progress this weekend. I was just about OK on Eid and have been quite sick again with diabetes since, last night especially so. Don’t go away, normal service will be resumed soon. I’m still fired up about Chimera and have lots of plans for when I feel better.