Archive for the ‘Developer Diary’ Category

Titan Attacks mobile – Developer Diary #5

Tuesday, May 21st, 2013

Basically I’ve mostly been doing one thing since the last update. It’s just that it’s quite a complicated thing :-)

Here’s what I’ve done:

- Read in the xml animation file for Earth and got it working. The original game has a complex animation system that can handle way more than most normal animation systems. I’ve had to write code to read and interpret the xml file and make it work with my sprite engine. This was not easy and there’s still a lot to do.

- Read in the xml sprite files for Earth and got it working. Each sprite, which I’m calling a “game object”, can be made up of several animated sprites, or even several other game objects. This was also pretty complex especially when some parts of a game object control other parts of a game object!

- I made a test screen to show the animations and sprites that I’ve read in. This has proved very useful and I’ve made a video about it (see below).

- Finally I made code to create individual “instances” (that’s a programming term) of a game object using a template that has been read in from the sprite xml file. The in-game aliens are now instances based on a template and you can see that they animate and blink in the video I made.

Video!

This is my first developer video diary. In it I show of the game a little bit and then talk about the test screen I made to test animations and game objects (sprites).

I Hope you enjoy it!

Next up

- Keep going with the xml interpretation code. There’s still a lot to do such as making the aliens move around, making them fire, making the player ship animate as it moves, making particle effects for firing etc. All of this is controlled via the vast xml files that Cas and Chaz (the original developers) made. So I’ve got my work cut out for me!

Titan Attacks mobile – Developer Diary #4

Sunday, April 21st, 2013


game screen in iPad portrait mode

Once again, it’s been a while since my last Titan Attacks mobile developer diary – 3 months in fact! That’s due to a bunch of things such as:

- Re-launching Spring Bonus on mobile.
- Overseeing the mobile port of The Wonderful Wizard of Oz (it’s shipping soon.)
- Starting Techno Zombies as my January #onegameamonth but going way overboard and deciding to put it on the backburner for when Titan Attacks mobile is done.
- Making two other #onegameamonth games.
- Family illness (February was pretty much a write off due to colds/flus.)
- Going to GDC and having a week of unproductive jetlag when I got back.

At least when I was working on other games my Monkey game framework has improved a lot (Monkey is the programming language I use) as well as my knowledge of the language as a whole, which benefits Titan Attacks mobile.

Now I have an empty schedule, which feels nice, and have began working on Titan Attacks in earnest.

Here’s what I’ve been up to:

Controls

- Added a second finger to fire in easy mode but after showing it to Cas (designer of original Titan Attacks) we decided to make the alien parachute immune to your bullets so that we can stick with a single finger in “easy mode” instead.
- Tweaked the placement of the slider and fire button and their hit boxes to make it easier to move the ship right to the edge of the screen and to not clash with the fire button. This mode is still a bit awkward on iPhone so it’s likely that it’ll only be available on iPad, or if it is on iPhone, it will be an option only and “easy mode” will be the default.
- Fixed a bug where I couldn’t tap fire faster than the auto-fire. When I first saw this I got paranoid the game wasn’t receiving input fast enough and boosted the update rate to 120FPS instead of 60FPS, but was worried this could be really slow on old devices. Luckily now I’ve fixed it, I can safely go back to 60FPS.
- Had a meeting with Cas and decided to only support portrait on iPhone as there’s no where to put the slider under the game screen in landscape mode. iPad can support both orientations though.
- Made it so that you the slide range for easy mode (single finger) is smaller than the screen width so it’s easier to drag the tank right to the edge on phones.
- Made sure any finger can be used for positioning in easy mode and that the finger must be below the HUD to fire so it doesn’t clash with HUD button presses. Multi-touch controls are complex btw!
- Added device detection to framework and different default controls based on device.
- Added ability to flip the slider controls for left-handed people.

Testing

- Did a bunch of testing on iphone and verified that there’s no memory leak when changing screens. Pretty important as the iDevices have low memory and just bomb out if you use too much.
- Added an FPS Counter. Runs at 60FPS no problems at the moment, yay!
- Showed the game to some press and a bunch of indie friends at the Game Developer Conference in San Francisco. They seemed to agree with our control choices and commented that the game felt smooth.
- Looked into why touching a finger onto the iPhone doesn’t show the ship right above it. It goes to the right with a right hand finger and left with a left hand finger! Can’t do anything about it as it just seems to be the way iDevices detect your finger. It’s not a big deal though, I was just being perfectionist and wanted it to detect the exact middle of my finger.

GUI

- Added button hover and click sounds.
- Add clicked and mouse over graphic for buttons.
- Added the ability to transistion screens on/off in sequence or at the same time. The transition state is exposed to the screen to do whatever it wants with such as slide on/off, fade in/out, alpha fade over another screen, zoom in/out etc. It’s pretty cool.
- Added ability to slide screens on/off and used it on the in-game menu and options menu.
- Added screen fade out/in including the music.
- Added word-wrapping to my framework. Had to learn how Monkey handles string functions differently from BlitzMax.
- Made game detect device orientation change and reconfigure GUI to either portrait or landscape mode based on device size. This looks pretty cool and people seem to be impressed when they see it in action.
- Zoomed out the game screen for iPad Landscape mode and placed controls underneath. Works well, although we may have the game screen full size and integrate the controls with the ground somehow instead.
- Increased hit box for in-game buttons and title screen buttons/URL on iPhone.

Engine

- Added floating text particle support to my framework and made aliens give out a floating “10″
- Made sure all images and sounds are properly discarded instead of relying on Garbage Collection. I did this because I read that GC can’t be trusted on all devices and I need to make sure I’m not wasting any previous Megabytes of memory on iDevices.
- Coded AnimdDef and Animator classes and applied to Sprite class. Supports Once, Loop (several or infinite), Ping Pong. Also supports reverse and a non-zero starting position (can be randomised).
- Coded Animation class which is an array of AnimFrames so that animations can come from a collection of randomly placed images on a texture atlas. This means I can use TexturePacker and create 2048×2048 optimised textures with whitespace (alpha) removed so that I consume as least memory as possible on iDevices.
- Coded AnimationBank class to hold animations.

Game

- Added in a wall of aliens to test collision, particle effects and animation.
- Added some placeholder particle effects for when the aliens explode.

Next Up

My framework is pretty much done now and I need to focus on getting the game content added and working. That’s quite a big task because there are 100 levels spread over 5 worlds with many different aliens (and bosses!) all with different behaviours and special effects. I also have to add a shop and do more GUI work. So there’s still a lot to do.

Here’s what I’m planning on doing next:

- Make a loader that works with TexturePacker’s output format. Should be easy.
- Read in the animation xml files from the original game and make sure they pick the correct images from the texture atlases.
- Animate tank when moving.
- Make all different tank sizes, add ons and bullet sizes work.
- Read in the level files and display the correct aliens. (They won’t be using their correct behaviours as that is a whole load more code to be done later.)

Well hopefully the next developer diary will be pretty soon as I need to get this game done and out by the summer.

Titan Attacks mobile – Developer Diary #3

Tuesday, January 15th, 2013

(click to enlarge)

It’s been a while since my last Titan Attacks developer diary and that’s due to two things:

1) I spent a couple of weeks banging out a new version of one of my games called Holiday Bonus GOLD and it launched on iPad/Android/PC/Mac in December. It was a spur of the moment thing to make that game but it should generate some good money (it got to no.2 on iWin.com!) and give me more indie “runway”, which is always a good thing.

2) I had a couple of weeks of lounging around, playing games and doing family stuff over Christmas

Anyway, here’s what’s new since the last update:

- I finished ripping out all old code and media from the project which I’d copied from another of my games. It always feels good to have this step done so that your new game is 100% “clean”.

- Added a tank that can fire multiple bullets and a basic background.

- Added a control method where you can move your finger anywhere to position the tank instantly and it autofires on finger down. However, it turns out this method won’t work because you sometimes need to be able to position the tank under a parachuting alien and catch it without shooting it. So I’m tweaking this control method to require a second finger to fire.

- I’ve been doing a ton of GUI code and that started with a new TVisualComponent class that I then extended other classes from. For some reason I never did this in previous frameworks (this one is technically my 5th framework and it’s shaping up to be the best one yet).

- Created a TSliderControl class and hooked it up to the player as another control method along with a fire button. See the image below (click to enlarge). As you slide your finger around in the rectangle the tank moves the full distance across the screen. This will be really useful on iPad. It feels smooth and good to use.

- Made an options screen so I could change control method on the device and then test it and get other people to test it. The final game will also allow you to change control method.

- Made the controls and buttons work with multi-touch on phone. This took quite a lot of fiddling to get right, but I properly understand the “problem space’ now.

- Got basic settings data saving/loading so that the game can remember the last control method you used.

- Improved my Screen Manager system to handle modal screens and multiple screens active and/or visible at once (e.g. show in-game menu over game-screen and call another dialog from that). I already had something basic that worked but this is a lot more flexible for the future and will require less code to add pop-up dialogs.

- Added a button down state and a bunch of other mini GUI tweaks/fixes that seemed to take forever as every time I changed something I spotted something else.

- Made mouse/finger up operate buttons instead of mouse/finger down. This turned out to be pretty complicated, especially on iOS as I’ve made it keep track of which finger first presses down on the button so that it can still activate it even when it moves away (but is not lifted up) and comes back to the button. In all my previous games the buttons activate on mouse/finger down which feels snappy but it’s not how OSes do it and nor how most decent games on iOS do it, so I changed my framework finally to handle this.

Next up

- Changing layout based on device orientation. Already components spread out and centre based on different aspect ratios but I want it to be dynamic.
- Tilt control method
- Finish tweaking/testing “easy” control method of placing finger where you want the tank to be.
- Add in first enemy.

OK that’s it for now. I’m going to meet Cas (from Puppy Games) and Cliffski (Positech games) on Wednesday, so I’m aiming to get more stuff to show them such as the game changing layout based on device orientation. All this GUI/framework stuff doesn’t move the game forward gameplay-wise but it’s a solid base for me to build this game, and future games, on.