Claytus Hood Tower Defense case study

I always loved games that revive an old concept with new features, and Claytus Hood Tower Defense is one of them.

Based on the old “tower defense” theme, it introduces new strategy options with large, scrollable maps and the capability to block some paths to make enemies take a larger route to attack you base.

Roux Raphaƫl, the author, shares with us his experience:

« Why did I decide to work on Claytus?

Before that, I used to be a developer for a web agency, coding online shops or institutional communication websites… not that fun!

After I lost my job at the end of 2009, I decided to increase my knowledges in AS3, to code funny stuff like games for example!

I always learnt programming by myself (the geekish way), with books, resources found on the web and personal experience…

I thus decided to read Keith Peters’ book “AS3 animation – Making Things Move” to fill my gaps in maths, and I saw lots of quite useful things to code games I had forgotten.

After reading this book, I managed to learn AI and Pathfinding, I thus studied A* algorithm.

Here are the examples I inspired myself of to learn A* :
http://www.remixtechnology.com/view/AStar-haXe.

Well, I reviewed trigonometry, I know A*, what can I do with it? A Tower Defense game! Let’s code!

Claytus is thus my very first game, and I learnt lots of things about AS3 best practices while developing it.

Here are a few technical informations about Claytus’ realization and technics I used for its design :

- it’s a full AS3 project developed with Flex Builder 3, a great software that allows to gain plenty of time as soon as you master it (spelling, auto import, debugging, profiling, etc.).

- I had to establish a good workflow between Flash for graphic assets and Flex for AS3 coding (do you Flax??). With the Embed tag, I succeeded into compiling the game in a single swf and I didn’t have to load external assets.

- Setting up the AS3 project in FlexBuilder 3 so that the MochiAds works well is really very tricky, with the add of a Preloader class before the Main class and compiler arguments (-frame 2 Main) so that the Main class is added to stage only on the second frame!

- I managed to set up optimization strategies for AS3, thanks to G Skinner tricks and benchmarks. (http://gskinner.com/talks/quick/)

For the first level, the use of A* isn’t so blatant; it’s gonna be much more in the following levels where you can block your enemies’ way.

Today, my challenge is to avoid cheaters on my leader boards :’(

About the TD wannamake

I didn’t use the easiest way to code a TD game, it’s thus quite hard to give you basic tips. Here is a list of a few basics for coding TD :

- The game takes place on a Tilemap, with a Boolean for each tile which holds isWalkable for the A* and isBuildable for the turret build.

- When an Enemy spwans, it asks its path to A* and I put its reference on an Array (enemyArray).

- The turrets go through the enemyArray in search of an enemy on its range and then open fire if their Boolean isReloaded == true.

- To estimate the distances and so check the range, I use Manhattan distance formula, less accurate but faster than Euclidian distance.

- The non-reloaded turrets reload during a few frames to simulate the firerate and then start again to look for a potential target.

Of course the process is far more complex, if you need more information about a precise point, don’t hesitate to ask me!

Easier methods than A* exist to build a TD, if the level has only a single way, no need for A* but to give an information about the direction to take when going out of the tile, such as hard coded waypoints.

Claytus’ graphism

In the beginning, Claytus used to be quite ugly, as a game skeleton with circles for the turrets and triangles for enemies, as for any experimental game skeleton I guess!

I thus offered to friends of mine who are illustrators to work with me on the project, to give life to my circles and triangles ! They were just finishing their studies and I think Claytus has been a good opportunity for them to increase their knowledges in Flash and add a valuable project to their portfolio. They learnt a lot about technical constraints that represents the integration of a drawing into a video game.

All of the Claytus’ artworks were so designed on a graphics tablet coupled to Photoshop. I didn’t wanna use vectorial drawing to economize resources and keep an artistic look. Only using bitmaps, I get very good performances on an old computer on which Bloons TD 4 freezes =D.

Claytus’ music

The music for Claytus TD was exclusively composed by friends of mine! The musicians didn’t know video games field that well, and they brought their point of view and an acoustic soundtrack. I love it!

How to give freshness to an old concept

It’s true it’s difficult to create something new in TD game because lots of things have already been done.

Lots of TD only send lots of waves and lots of enemies with a huge arsenal…

Finally, this gameplay type is much more of a massacre timekiller that you win whatever you do!

I wanted to create a much more challenging game with Claytus TD. I agree it can raise an issue to some of the players, but the fact that is challenging makes others happy!

The game begins with a single way, and only three different turrets, which poses Claytus as a real strategy and positioning game, you have to think every move you make!

In the other levels, we bring each time a novelty in gameplay : stage with other possibilities as multiple ways possible, new turrets and new upgrades in addition to gameplay elements of the stage.

I wanted every turret unique with a precise goal, that’s why you can’t do anything if you wanna win.

About the funding

Claytus wasn’t made to raise money at first thought, it was more of a project to help me learning to code in AS3 and manage a project with high quality standards.

I’m thus just incoming into flash game field and Mochimedia helps broadcasting the game on tenths of the websites of their partners.

Website

Claytus TD have its own website at http://www.claytus-towerdefense.com.

I made it to showcase the game in a nice looking website with drawn background.

The website introduce the team, the French version have a forum (I will add an english forum asap), and people can mail me via the contact form.

I also upload preview pictures of the next levels and the next soundtracks because Claytus TD intend to have six levels and more, but its takes a lot of time to create all of this stuff!

To stay tuned, players can become fan on Facebook and subscribe to my
newsletter.

Level Editor

I have build a level editor to help me making level and learning tool programming, coded in Flex, MXML & AS3, great technology to deploy rich applications (RIA).

It’s not released for the public at this day, but if I have time i’ll code a friendly user version for the people can make their own level and why not create a level contest? »

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (19 votes, average: 4.32 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 18 comments

  1. Peter

    on July 27, 2010 at 9:48 am

    Amazing blog entry again! I love your page :)

  2. MC

    on July 27, 2010 at 10:39 am

    Thanks for sharing your experience, it was very interesting

  3. Pedro Canterini

    on July 27, 2010 at 1:46 pm

    Could you please share the revenue numbers on the adds you have running on the site or at least just the mochi adds generated one?

    Is it worth all the work? (I mean I know you must like making games but could this be your main revenue source or at least a big part of it?)

    Thanks for sharing!

  4. JoseDu

    on July 27, 2010 at 3:13 pm

    Great article! Thanks

  5. falleco

    on July 27, 2010 at 6:59 pm

    How much time you spent on it?
    Very interesting experience!

  6. Rafarel

    on July 27, 2010 at 9:17 pm

    @ALL
    Thanks to all of you for leaving such nice comments on this post!

    @falleco
    As I said, Claytus is my very first game, thus I spent a lot of time to learn how to build a robust game architecture in AS3.
    The game engine was made and remade several times! The biggest part took me 4 months to code the game and the level editor. I think if I have to redo it, I’ll do it faster! It takes me a lot of time to manage my team, take artistic decisions (art & game design), make the website, plan the communication… I’m not just the developer on this project, the hardest thing is not to scatter. Some stuff is in development, such as the future turrets, levels… I’m waiting for the art to balance the next levels.

    @Pedro Canterini
    The game distribution started a month ago, I think it’s too early to tell if it could be my main revenue source. The best I made is 60k plays a day with an eCPM at 0.30!
    I think I must make a lot of games if I want to earn enough money to live, I would love to do that! The question is, how to earn money during the development? A sponsor in this place? Maybe I should ask Mochi game developer fund?

    It was quite difficult for me to summarize this experience, don’t hesitate to ask questions, it’ll be my pleasure to answer you =D

    Today I’m working on a trailer, our team will participate to a trailer contest! You’ll see it in introduction of the game as soon as it’ll be ready.

    Many thanks to Emanuele, who gives me this sharing opportunity!

  7. MC

    on July 27, 2010 at 9:38 pm

    i have one question: since you used bitmaps instead of vectors, how did you handle the animations? are they imported PNG files into movieclips with frames, or did you use some special class to handle the animations? (blit?)…

  8. Rafarel

    on July 28, 2010 at 2:03 am

    @MC
    All of the animations are made frame by frame with PNG files into Movieclips. I use Flash flags to pilot the animations with the gotoAndPlay(“south”) or gotoAndPlay(“east”), etc… Each enemies have has a XML file with the number of frames for their loops (east, south, west, north), the Y position of their life bar and the Movieclip that handles the images… I had coded Class to manage the animations loops. I didn’t know the blitting techniques, so thank you because I discover this with this post on Adobe Developer Connection : http://www.adobe.com/devnet/flex/articles/actionscript_blitting.html

  9. BivisGames

    on July 28, 2010 at 2:13 am

    Gongratulations to Emanuele, and of course, to Roux Raphael for this nice game and nice interview.
    This level editor is very interesting… I’ll love to read more about this!
    Regards!

  10. Rafarel

    on July 28, 2010 at 2:44 am

    @BivisGames
    I plan to release six or more levels for Claytus TD, and after that, I’ll release the public version of the level Editor. I think I can’t release it tomorrow, so you can subscribe to my newsletter and become my facebook fan to stay tuned! You’ll be able to read more about this in few months , I promise!

  11. Vega

    on July 28, 2010 at 8:31 am

    @Rafarel Realy nice game and a great summary of your experience
    Those are the posts which push me more and more in the direction to try it myself too :D

    @Emanuele
    The link to claytus-towerdefense.com in the Website section isnt resolving correct (atleast for me)

  12. Pedro Canterini

    on July 28, 2010 at 4:02 pm

    Thank you for sharing your experience, it is much appreciated.
    I wish you good luck in this path that I aspire to follow in the future.

    Cheers!

  13. The fastest way to find the distance between two points - Emanuele Feronato

    on July 29, 2010 at 12:16 am

    [...] Claytus Hood Tower Defense case study [...]

  14. Luiz Fernando

    on July 29, 2010 at 5:35 pm

    Thansk for sharing that! Really nice interview

    I might take this opportunity to say how freaking hard that game is. And not in the sense of ‘challenging’, but in the sense of being a son of a bitch. really annoying to die on the first 5 waves because enemies seened like were made of titanium.

  15. Rafarel

    on July 29, 2010 at 7:49 pm

    @Luiz Fernando
    There is a difference between dying and loosing 10% of life! Lots of players made this mistake, you can finish the level and win with 5% of life, don’t try perfect game the first time you play it’s a misunderstanding of the rules!

  16. Flash Gamer

    on August 3, 2010 at 1:15 pm

    Thanks for the interview, an interesting read. Fun game too. I would also like to read more about the level editor.

  17. Stathis

    on November 18, 2010 at 5:03 pm

    Anyone knows when the next levels will be released? First three levels are about finding the right trick. Want to see something more challenging!

    Thanks to the programmer for this amazing game!

  18. Rafarel

    on June 24, 2011 at 8:36 pm

    Hello everyone !

    I’m here, bringing some fresh news about Claytus Hood TD.
    These days, I’m working on a Flex software : The Claytus Level Editor.

    I made a preview video available on YouTube :
    http://www.youtube.com/watch?v=umSA7aWIxww

    You can also stay tuned with the Facebook group :
    http://www.facebook.com/apps/application.php?id=127440047293807

    Thanks all !