You are on page 1of 46

Kamil Czajko

Choices
Let you play the game in a style that you want Effect the world in real ways including minor and major story outcomes Give you different choices based on the choices you made earlier

Always take screen shots


You cant see incremental improvement when you are looking at your game every day

Canvas engine ~ March 2011

Performance
200+ onscreen objects + shadows Map 400 times larger than screen 8000 world objects in total 60 FPS on HTC Desire Add 100 moving objects such as in AOE FPS ~ 20 Z Sort taking 80% of CPU time during a frame render.

MS PAINT MOCKUP

First problem
Canvas ran at 20FPS on Samsung Galaxy tab Add sort overhead and game was completely unplayable Canvas is frame buffer limited, tablets have higher resolutions but not necessarily better 2D graphics capabilities Simply clearing canvas can take 12-20% of CPU for a frame

Options:
Push ahead and make game anyway?

Options:
Push ahead and make game anyway? Give up?

Options:
Push ahead and make game anyway? Give up? Save what you can and start over in OpenGL?

Options:
Push ahead and make game anyway? Give up? Save what you can and start over in OpenGL?
OpenGL can do Z buffering in hardware! How hard could it be to port?

OpenGL Path test October 12 2011 (6 months later)

Why 6 months?
That sounds crazy

Why so long:
Straight backend change not so trivial, had been written in a particular way Lots of custom code to get around limitations in Java and canvas now needed porting

Editor needed extensive work too, no long WYSIWYG

New problems with OpenGL


Each discrete call to OpenGL is slow. Much quicker to use one call to send a mesh with 100 triangles than 10 calls to send a triangle each. Earlier choices made with graphics and engine limited how we could develop the game further Optimizations developed while working on Canvas, caused issues in OpenGL

Example?
Drawing text was done as drawing images of each character in a way to avoid GC Overhead of drawing quads for text greater than drawing the game

Other Issues?
When using alpha blending with Z buffer, blend occurs with images already in buffer, so Z order still important

Should we have shipped the first one and gone OpenGL for sequel?
Maybe but it turns out there was a third brick wall we didnt notice ahead of us and it turned out to be reinforced concrete.

3rd Problem Maximum per app memory


Low density devices 16MB or more High density devices 24 - 48 MB or more Test map filled with NPCs and monsters for prologue hit the limit :(

Solutions?
Reduce quality of images? Have less variety on a map? Less animations? Make a smaller game?

BUT
With OpenGL. Textures use main memory and only 2D images have memory limit.

October 20 2011

October 20 2011 + Filter

Best of both worlds?


Canvas for text, menus and blending, OpenGL for drawing the game.

Novermber 30 2011

Turns out
Implicit overhead simply running two buffers Despite every pixel in Canvas taking cpu, and every blend being slow in both Canvas and OpenGL Sending Canvas with alpha values to graphics system, blending is effectively free. Each layer can run happily at different speeds and sub Canvas changes

April 22 2012

Then and now?

Fireball with lighting October 30 2011

Rain of Fireballs August 2012

So you want to make your first game? (advice you wont heed)
Before you make your first game, you must first make a game.

Your first game


Keep a notebook Work out what kind of game you want to make Keep your first game small in scope

Now scale it back

Make your

th 0

game instead

Acknowledge that you are learning

Create a complete game that:


Has all the bases that you want to cover. Includes all the mechanics you want to use Has menus and a UI Includes Saving/highscores Everything a game needs to have except

No Assets
Populate with creative commons art, sound, meshes, text

Make sure the game you want to make is actually feasible


Since there is few things more heartbreaking than working on a title for 9 months and having to throw out mountains of work.

You will hit brick walls

And then?
If it works? Congratulations you havent lost any time anyways, your proper assets can slot straight in and you can extend your game If not? Rethink how you are using your assets, perhaps you need to do something differently. In any case you dont have the situation of assets made for one purpose that now need to be redone for another.

Tips for working with Android and Java?


Garbage Collection will cause framerate jitter (esp on pre 2.3 devices) much worse that low framerate Avoid creating objects in loops Use method profiling and DDMS Test before and after making changes to see what works

Rules that you should also follow


Take screen shots Let lots of people play your game and take their criticism on board. Story board and bounce ideas off people Use the tools available to you, DDMS, method profiling etc. Fake what you can get away with faking Have fun

And finally?

TAKE BACKUPS
USB, phone, dropbox, R-Sync, SVN

Future for Kactus Games?


Polish and release open beta once world 1 complete. Release this year. Take a break Start porting to OpenGL ES 2.0 and upgrading for the OUYA for a March release.

THANK YOU

Questions? kactusgames@gmail.com blog.kactusgames.com.au forum.kactusgames.com.au

You might also like