You know, I often get asked questions like “What the hell are you doing over there, typing into your weird Notepad-looking thing with strange text highlights and brackets all over the place?” In answer to those queries, and because I’ll spend a bit of time explaining what I’m working on at the moment.

What I’ve been doing over the past month or so since the direction shift has been modifying the engine and game code for the new style of game. While I first thought there wouldn’t be all that much to do, I quickly found that if I wanted to do it properly, it would have to be a bit more involved. If you’re curious about the process of converting a tower defense game to an action-oriented isometric shooter with physics and collision, then this is for you!

Refocusing Input


Stay on target -- stay on target!

Stay on target -- stay on target!

Initially the input was focused on building, with character movement and control being secondary – naturally that needed to change with the new focus, and so the first thing I did was to refocus the input and player system to be character movement- and control-centric. I took this opportunity to make the player’s controls work off a state machine, which allows the input code to be a lot more modular and self contained.


Universe Get!


Not quite like this.

Not quite like this.

While polishing off the new player input, I spent a lot of time changing around the layout of the engine to allow for multiple levels. This was a fundamental and wide-reaching change to the engine, as the majority of classes assumed that only one level existed – I think I touched at least every single class in order to fully make this change.

It’s interesting – the evolution to the new paradigm (a WorldManager has a list of Worlds, each of which has a CollisionLevel, which that World’s objects are attached to) took a few iterations, as I started working on a paradigm and then realised that I wanted to make the system more modular and portable. That’s a big reason why this element took a lot of time, but I believe it’s worth it, as now potentially we can have as many levels or worlds as the iPhone’s RAM allows; I’m not promising this feature will make it into the current game though, as it all depends on the time we have to make resources and the effect that multiple underground areas would have on game flow.

Scaling the Engine


XKCD FTW

XKCD FTW

I thought I was home free and ready to work on the new collision/physics systems, but a little snag popped up along the way – previously all of the movement in the game was static, and mostly happened in graphics space – a pixel on the screen was a “unit” or meter in the game world. Of course, I didn’t want my characters to be thirty two meters wide, and for them to have to run at a hundred kilometers per hour to get from one side of the screen to the other in a decent amount of time, so I decided to separate the game’s scale from the render scale.

I won’t bore you with the details, but this was another icky problem where a lot of objects assumed that things were happening on the screen – some of which should (UI objects and etc), the rest of which shouldn’t. Needless to say, this took over a week of part-time work to resolve, and there are still a few issues hanging around.

Collidomatron


Most exciting picture yet?

Most exciting picture yet?

Finally, last weekend I was actually ready to start work on the collision system – the foundation that the new gameplay would rely on. I decided to roll my own as opposed to using Chipmunk or whatever because I’ve got a decent amount of experience with collision and physics systems, and I don’t intend to do anything too difficult (springs, complex shapes, etc). It took a relatively short amount of time to get the core physics up and running, and then during the Sunday workLAN I got both rudimentary object-to-object collision (so people don’t walk through each other) and object-to-world collision (so people don’t walk through walls) working, both of which came together with surprisingly few hiccups.

Tada!


So that’s where I’m at right now. The next thing on my list code-wise are the two checks we need for the characters to be able to shoot – LineInObject (which will cast a ray into the world and see what it collides with) and DoSphereTest (do a sphere check in a position with a radius and return all mobs that are within that sphere). The former will be used for pistol- and sniper-type weapons, and the latter I’ll be using for shotgun-type weapons. I also need to do some more work on player movement – at the moment it feels a bit sluggish and slidey, but I think I’ve figured out the forces to apply for it to feel right.

- Jason

One of the important elements of the new design focus is your base of operations – the Wright Mobile Labs. It’s a custom aeroplane, designed to fit somewhere between a jet and a spacecraft, and  it is the characters safe haven against the dangers outside. It was in the original tower defense design mostly just as a story element, but now it will be fully playable and explorable, and will serve an important function as the part of the game where you upgrade your equipment and research new technology.

However, in order for the base to be explorable, it needs some collision made up for it, so that the characters can walk around without walking through walls or other obstacles (or outside the ship).

To show how incredibly high tech and not quickly-thrown-together our systems are, here’s a screenshot of me mapping the collision file that gets exported into the game to a diagram of the ship.

No, I'm not playing a 16x16 game of naughts and crosses. But if I was, crosses win!

You may need to click through to see the parity between the two images.

Warning: the next paragraph may contain technobabble.

The “x”s in the table on the left are grid positions that are “blocked” – the characters can’t walk to them or through them, and the “o”s are traversable terrain. Once you’ve seen the similarity between the two, you may note that the diagram is upside down – this is because the iPhone (or cocos2d, I’m not really sure which) sets up its grid +x right +y up, instead of the more common +x right +y down. Therefore, if I want the table to read from bottom to top, it needs to be reversed, as does the diagram!

Anyway, once the file on the left is exported and compiled into the engine, it will read each entry in the table and set the collision node to blocked or unblocked depending on what’s in that cell. And voila! A world* is born.

That’s it for this peek into the development of Shadow Field – I’ll be back with more as I tweak the systems for the new gameplay!

Cheers,

- Jason

* or at least the inside of a plane…

Just three weeks until IGF Mobile submissions end, and we’re frantically trying to get stuff done.

As you’ve probably seen from the videos, a few of the systems are in place, but the game isn’t really balanced yet, and doesn’t really have a narrative or game flow. So that is what I’ll be working on this week! That, and a save manager, because we don’t want to inflict a non-saving iPhone game on our poor judges.

While initially I was hoping to just throw the player into the world and do a slow reveal of what is going on, I think that requires a bit more subtlety and nuance than we can conjure up in three weeks, so (on the helpful advice of some friends) I’ll probably set up an initial text crawl that roughly explains the events that have gone on leading up to where the game starts. We may remove it again before final release depending on how it feels, but at least at this point I feel like there is (read: will be) enough mystery and interesting events within the game itself, without having to resort to the “unfolding the backstory” method of storytelling.

This act of forcing at least an iteration of the game’s narrative to get done is really the reason why we’re submitting to the IGF – progress has been good, but we need (or at least I need) a motivator to stop working on the small picture, and start doing some big picture laying out of the game flow, just so that there’s an initial version in there that we can then critique, analyse, and then iterate upon.

The good progress mentioned earlier has been work on the UI.

DF UI Update

There are a few elements in play here:

- The grey gradient box on the bottom of the screen is a speech box for the characters – this week the temp graphic there will be swapped for something more resembling the rest of the style. Also, Ban’s begun work on some portraits for the characters – the one in the green box is a work-in-progress Dr. Akira.

- The panel labeled “Akira” is the “command panel” – each character has one. The command panel is how you control the characters, and it extends and retracts depending on which character you currently have selected. The buttons on there are Build, Walk, Repair, Upgrade and Cancel.

- The red outline tower  in the top right of the screenshot is displaying where your current tower will be placed – it snaps to the grid of the gameplay.

- On the top and bottom edges of the screen we’ve done a bit of nudging to allow some space for various UI elements – along the top bar will be your current game stats (at the moment there’s Light Capacity, Health and Wave No.), and along the bottom will be some system buttons (pause, menu, volume, etc).

If you’re a discerning and good-looking person you may have noticed that the red outline tower is actually quite a ways above the mouse pointer in the emulator. While playtesting yesterday something wasn’t feeling right about the outline display, but I couldn’t put my finger (hah!) on exactly what it was – it just felt wrong.  So I did what all game developers secretly do when they’re stumped on an interface problem – I loaded up a good game in the genre (in this case, Fieldrunners), and checked to see how they do it!

Of course, if your finger is on the iPhone screen, it obscures your view of where you’re about to build – so what Fieldrunners defaults to (and what we’ll most likely default to) is to place the outline around 32 pixels above the finger’s “point of contact”. After implementation it felt blindingly obvious, but that’s often how these things go. Anyway, cheers, Subatomic Studios!

Back to work now! I’ll try to keep this updated with some smaller updates with how we’re going as we near the deadline.

- Jason

Been working on implementing a particle/emitter system recently. Finally got some working:

(They’re the little bits floating up from the beams.)

Also played around with the beam a little bit, made it shoot (close to) proper from the lil’ towers.

Next up, making the fog!

- Jason

Darkness Falls Screenshot

Screenshot of the current build of Darkness Falls

Darkness Falls is a story-infused take on the tower defense genre for the iPhone.

The functionality that the player is presented with involves killing waves of enemies with light that is blasted out of towers that the workmen build. (The four workmen are in the top right corner – only one has graphics as of yet though.)

The base that you’re defending is in the middle of a large, deserted area – waves attack from all sides, so you need to build your defenses with that in mind. And because the game is set under the cover of darkness, each light tower you build pushes back the encroaching night.

The team includes myself doing the programming, and two artists, Ban and Alex, doing the art. We’ve been developing the game since the start of June (a bit over three months), and we’re aiming to be ready for IGF Mobile in November-ish. As you can see, we’ve got a lot of work ahead of us ;)

We’ve just recently nailed down an outline for the plot/setting/characters that we’re happy with, and have two functional tower types in the game, and one generic enemy. I’ve recently set up a few game flow systems (WaveManager, StoryEventManager, DialogueManager), and the current focus is to get the game playable and fun with the current features, and start an initial pass on the story, dialogue and game flow.

All graphics are either temporary or in progress at the moment (such as my wonderful rainbow base), but the rotating directional tower (the one near the bottom with three legs) is probably the closest to final art.

If anyone’s interested in the technical side of things, we’re running on top of cocos2d, which handles rendering, image loading, and a few other handy things for us.

We’ll be keeping this site updated with our progress, and will be able to release a bit more information about the game, such as main characters, gameplay features, etc. throughout the rest of development. Be prepared!

- Jason

© 2010 Shadow Field Suffusion theme by Sayontan Sinha