CometsAndCraters Project

To coincide with the release of CometsAndCraters I thought I would do a ‘look back’ at the project. CometsAndCraters has been around 9 months in the making and I have to say that at times it has seemed much longer. We created our first game for the Christmas market last year (JingleBalls) but in sales terms it was not a great success but we did make it primarily to understand the process of making an app from end-to-end so from that point-of-view it was very worthwhile although by the time we reached the end of CometsAndCraters we had forgotten most of what we had learned from the Apple process.

We are a team of two, Neil the Designer (Australia) and me the Dev (UK).

The Game

Comets and Craters is a Tower Defence meets RTS. It is a 2D game which can run well over 300 sprites at a time and the performance is very solid. There are no physics in the game and the only movement is a transform on enemy vehicle sprites. Tower movement is made by swapping out sprites as is the tower firing. Vehicles notify towers when they are in range by making a radial scan each time they move from one grid square to another. If a tower is in range and its not burned out and its not already firing at a weaker vehicle (health wise) it will fire at the vehicle that has notified it. The AI is A* which has been cut down to its bare bones and looking for a new path is only called upon when absolutely needed. Each vehicle passes its path to the one behind it unless a new tower is laid or a tower is sold. To get around constantly searching for a path the game goes into auto pause mode when dragging a tower. This means we only have to check for a new path when the tower is placed. Its also a nice feature which allows the player to move the tower around without panicking that the vehicles are going to overwhelm him. I would say the trickiest part was deleting sprites and destroying vehicles as it became a real timing issue. A vehicle could be killed which has a sprite attached to it which shows it firing and another sprite showing its health. The way around this was not to destroy the vehicle object but to move it out of sight then in between enemy phases to delete in a more controlled manner. This also had the benefit of moving a process out of ‘gameplay’ and into a dead time between phases.

Lessons Learned

We wasted the first month and a half believing that we could make a 3D Tower Defence game which ended up by us both realising the performance just was not there, especially with iPhone 1.0. We did get a lucky break at this point because Brady brought out SpriteManager and this firmly planted us into making a pseudo 2D game.

Neil must have made and remade the Atlases a hundred times. We went through the painful process again-and-again and it was not until the final couple of months we got it right. Tying up the Atlases with SpriteManager and DrawCalls is ultra important.

I would say never underestimate what even one extra DrawCall can do to your game.

In future I will start the Save and Resume game option early or at least put the framework in place to manage this and then just add to it as I go along. It took me three times longer than I budgeted to implement a Save and Resume.

Organise the hierarchy is another lesson I learned. In future I intend to suffix each GO with letters that mean something such as rp for runtime parent (a GO that is used as a parent for clones) and so on. My hierarchy got messy very quickly.

Centralise only when necessary. I am now a firm believer that you let objects take care of themselves. CometsAndCraters has a centralised touch class but very little else is centralised.

I probably have too many public vars linking to other scripts which I know will make maintaining this game difficult when I have not touched it for a while.

Copy and Pasting objects in the hierarchy is not your friend. Because of the linkages I messed up so many times with copy and paste and then picking the original to work on rather than the copy which was now sat is several other public vars on scripts (always make from scratch now)

I had to revisit code time and again and realised that tearing it down and remaking it is not a bad thing, sticking to the original code cos it took a while to code is not always the best option.

Test, test and keep testing all the time and I do this on the iPod as the results can be a real surprise you when compared against what you see using the remote.

Going back over old code was a smart thing to do as I developed my experience very quickly I noticed code that was only a couple of months old could be optimised. I would also say that its best to optimise all of the time and not think about it at the end.

Overall its been a great experience. Will it sell? who knows but for sure we are trying to follow all of the good options that have been proposed in here and other forums.

There is a whole set of tutorials on the site (link in sig) under the video tab so you can see how it all hangs together and how the gameplay works. If you have any questions at all on this type of game or any similar 2D game ask away and if I can I will be happy to answer them.

CometsAndCraters FTW :slight_smile:

Thanks for sharing Imparare.

I always find it insightful and educational to read up on other people’s development experiences. :smile:

Would love to check out your game when I find some time.

Many thanks for this great project account. I too love reading about other developers’ experiences, which always seem to mirror my own. Reading this will definitely help my future projects.

Cheers,
Matt.

Glad you enjoyed Steve’s account of our journey.

It has been a huge learning curve, especially since we only bought Mac’s last year just so we could use Unity. Believe me, Steve was a big Windows WPF/xaml fan. I still can’t believe he bought a Mac (which I am sure he now sleeps with at night and Unity).

Having spent 2 years working on WPF/XAML3D scenes with Steve I then spent 6 months creating scenes for Papervision3D however seeing the upcoming Unity 2.0 video interview previewing Unity I had to have it.

I purchased Unity 2.0 to use for interactive Product and Archviz work, but after doing my first Archviz test scene with Unity I showed Steve the first ever Unity Unite video’s. The Unity Tech founders talked so openly and enthusiastic about Unity and where it was headed, Steve jumped on the Unity train and delved into C# to help add interaction to my scenes.

Unity then announced they were to enable iPhone publishing… well, that was just far too much candy for two middle aged software junkies to pass up and so we entered the gaming zone. So Steve went MIA in his C# code and me knee deep in Game Texturing books re-learning a different way to model/texure and we were on our way.

As Steve mentioned we did put a simple and quick game together to first so we could test the end to end iPhone game dev process. This proved an invaluable experience. Hopefully we have come a lot further with Comets and Craters and it does well enough for us to produce our 3rd game which we are itching do once Comets and Craters updates are completed.

As a Designer, I have also gained a good understanding of what Steve’s code does and how to read it. I still can’t write code from scratch, nor have I tried to learn to with Unity. My focus is with design and graphics, but having that understanding of what the code is doing makes for a more efficient dialog between us for ideas and problem solving.

Also a massive thanks as Steve mentioned to Brady for making his Spritemanager code available to the community.

Great work, and thanks very much for the kind words! It’s interesting that game saving/resuming was a big time consumer for you, as I’m about to finish up a set of classes that should make pretty much ANY game saving/resuming task brain-dead simple and without you having to write a single line of code! Saving/resuming has always been a huge pain in the butt, so I decided to do something to fix that.

I’ve played the game a bit and you guys did a great job on everything. You really got it running smooth, despite lots of objects (and that’s on a iTouch 1st Gen). And you got the zooming in/out right too. Good work.

Hey that’s brilliant news about the Save/Resume Brady and glad to hear the game ran nicely on your iTouch.

If you get stuck on anything be sure to check out the Video and Gameplay pages on the game website. We cover all aspects of the gameplay.

You mention atlas creation being a painful process, I’m just starting to discover this as well. Being in the prototype phase sizes of our characters are changing, as are animations/animation lengths.

It seems something like a texture atlas maker would help but i am unsure at the moment.

Did you arrive at any methods to reduce the leg work?

Haha, that’s another thing on my wish-list for the next revision of SpriteManager - automatic atlas generation. So the idea is you just drag in a bunch of meshes, and it’ll pull all the textures together, build an atlas, and rewrite the UVs to match.

It’s a bit ambitious, but perhaps one day I’ll get it done.

The issues I faced with creating the Atlases was that originally we had created for 3D, so my Atlases were UV’d for 3D geometry. We then decided to adopt Brady’s Spritemanager so I had to start from scratch and render off 2D images (sprites) and create new Atlases for that.

The time consuming part of making the 2D sprite Atlases is inputting all the coordinates as a reference for the programmer, particularly if you have to rearrange the Atlases due to Spritemanager rearrangement or feature changes (project creep) along the way as we often did. Other than that the sprite Atlases are far easier to work with than the ones used for 3D geometry.

Thanks Brady,

I am really pleased that the performance is there for a 1st Gen iTouch as it was not something we tested on.

Being able to run a huge amount of sprites with the performance we get is great testimony to SpriteManager and I think it also shows that Unity can handle a pseudo 2D game where so much is happening.

Our expertise is in this type of game and we have been discussing that it may not be worthwhile even trying to compete with 3D now the big boys have moved in and players expectations are so high. We do however feel we can more than hold our own with 2D even against the GameLoft’s of this world (on gameplay and graphics/art but not on marketing).

thanks again

I’d be interested in talking to you guys more about workflow in dealing with sprites. I’d like your thoughts on how to make this faster and easier in the future.