Kingdom Rush development questions!

For the King!

Kingdom Rush development questions!

by dimumurray » Thu Sep 01, 2011 12:08 am

Have a few questions for you:

  1. How many custom classes did you end up writing to put this beast of a game together?

  2. Would you call yourself a procedural or object-oriented programmer?

  3. Did you employ an open-source framework/toolkit like PBE(Push Button Engine) or did you roll your own?

  4. I noticed that the game employs a mixture of vector and bitmap elements; why not go bitmap all the way?

  5. Have you ever tried forgoing the Display List in favor of using a rendering system that refreshes a BitmapData instance instead?

  6. Is the code structured so that graphic elements and game logic can be easily swapped?
User avatar
User
 
Posts: 348
Joined: Wed Aug 31, 2011 6:11 pm

Re: FAQ: Kingdom Rush Development

by MaGnUs » Thu Sep 01, 2011 12:48 pm

42.
Writer and letterer for hire!
Clockwork Chap
User avatar
User
 
Posts: 186
Joined: Thu Aug 11, 2011 12:47 pm
Location: Montevideo, Uruguay

Re: FAQ: Kingdom Rush Development

by Quest » Thu Sep 01, 2011 1:54 pm

dimumurray wrote:Have a few questions for you:

  1. How many custom classes did you end up writing to put this beast of a game together?

  2. Would you call yourself a procedural or object-oriented programmer?

  3. Did you employ an open-source framework/toolkit like PBE(Push Button Engine) or did you roll your own?

  4. I noticed that the game employs a mixture of vector and bitmap elements; why not go bitmap all the way?

  5. Have you ever tried forgoing the Display List in favor of using a rendering system that refreshes a BitmapData instance instead?

  6. Is the code structured so that graphic elements and game logic can be easily swapped?


^ its a headhunter!
User avatar
User
 
Posts: 97
Joined: Fri Aug 19, 2011 5:54 pm

Re: FAQ: Kingdom Rush Development

by dimumurray » Thu Sep 01, 2011 2:13 pm

Quest wrote:
^ its a headhunter!


Nope. Just a fledgling game developer looking for insight into the process. :D
User avatar
User
 
Posts: 348
Joined: Wed Aug 31, 2011 6:11 pm

Re: Kingdom Rush development questions!

by Vanzen » Thu Sep 01, 2011 4:39 pm

I splitted the message cuz i thought it needed a topic of its own.
About the questions i'll let Pablo answer them :)
User avatar
Ironhide Developer
 
Posts: 351
Joined: Tue Aug 09, 2011 7:53 pm

Re: Kingdom Rush development questions!

by lito88 » Thu Sep 01, 2011 6:28 pm

Hi

How many custom classes did you end up writing to put this beast of a game together?
We wrote more than 500 custom classes.

Would you call yourself a procedural or object-oriented programmer?
It depends on the situation, for this game we use OO programing.

Did you employ an open-source framework/toolkit like PBE(Push Button Engine) or did you roll your own?
Nope, we create our custom tower defense engine, we use only 2 or 3 classes , one for Ellipse calculations, a singleton for Sound Management (we modified this class a bit) and a really great class for PNG transparency called interactivePNG

I noticed that the game employs a mixture of vector and bitmap elements; why not go bitmap all the way?
Because sometimes the vectors don't decrease the performance(considerable), and Bitmaps always increase the size in bytes of the swf. So it depends on the situation, want to keep the game under 20 MB.

Have you ever tried forgoing the Display List in favor of using a rendering system that refreshes a BitmapData instance instead?
Yes, but sometimes the improve you gain in performance is not worth it.

Our suggestion: Read a lot and test, test and TEST different solutions to see what works in every situation, like when to use Object Pooling, when bitmaps, when vectors, etc...etc etc.
User avatar
Ironhide Developer
 
Posts: 700
Joined: Tue Aug 09, 2011 7:20 pm

Re: Kingdom Rush development questions!

by Barrotes » Sat Sep 03, 2011 8:24 am

I think they are speaking English...not sure...
I'm a Donkey, what's your excuse ?
User avatar
User
 
Posts: 69
Joined: Wed Aug 10, 2011 9:54 am
Location: Portugal

Re: Kingdom Rush development questions!

by Earendel » Mon Sep 05, 2011 4:36 pm

Have you tried using Flash Develop? I've found it much better for managing lots of classes.
User avatar
User
 
Posts: 13
Joined: Wed Aug 10, 2011 8:38 pm

Re: Kingdom Rush development questions!

by dimumurray » Mon Sep 05, 2011 6:19 pm

Earendel wrote:Have you tried using Flash Develop? I've found it much better for managing lots of classes.


Vanzen stated in this thread ( http://www.ironhidegames.com/forums/viewtopic.php?f=5&t=1040 ) that they use Adobe Flash and FlashDevelop for development. As for myself I think FlashDevelop is cool (especially given that its free) but FlashBuilder 4.5, my IDE of choice, has a number of features I would hate to give up (more extensive project management and more powerful IDE features). If I uses Flash at all, its strictly for building SWC libraries where I store any graphical assets.
User avatar
User
 
Posts: 348
Joined: Wed Aug 31, 2011 6:11 pm

Re: Kingdom Rush development questions!

by dimumurray » Mon Sep 05, 2011 7:08 pm

lito88 wrote:Hi

How many custom classes did you end up writing to put this beast of a game together?
We wrote more than 500 custom classes.

Would you call yourself a procedural or object-oriented programmer?
It depends on the situation, for this game we use OO programing.

Did you employ an open-source framework/toolkit like PBE(Push Button Engine) or did you roll your own?
Nope, we create our custom tower defense engine, we use only 2 or 3 classes , one for Ellipse calculations, a singleton for Sound Management (we modified this class a bit) and a really great class for PNG transparency called interactivePNG

I noticed that the game employs a mixture of vector and bitmap elements; why not go bitmap all the way?
Because sometimes the vectors don't decrease the performance(considerable), and Bitmaps always increase the size in bytes of the swf. So it depends on the situation, want to keep the game under 20 MB.

Have you ever tried forgoing the Display List in favor of using a rendering system that refreshes a BitmapData instance instead?
Yes, but sometimes the improve you gain in performance is not worth it.

Our suggestion: Read a lot and test, test and TEST different solutions to see what works in every situation, like when to use Object Pooling, when bitmaps, when vectors, etc...etc etc.


Got some follow up questions for you. I hope you don't mind answering them.

1. 500 classes! That's sounds like a lot. What aspect of the project demanded the bulk of those classes? Game logic, asset management, or something else.

2. OOP. Cool. Aside from Singletons and Factories do you employ any other kinds of design patterns? And if so which ones have proven most useful to you in the course of game development.

3. So you rolled your own. Nice. I imagine that you start out with the basic mechanics of a TD game and build from there. However, do you spend a lot of time pre-planning your classes and their relationships before typing any code? If so, do you use UML or other diagrams.
User avatar
User
 
Posts: 348
Joined: Wed Aug 31, 2011 6:11 pm

Re: Kingdom Rush development questions!

by lito88 » Mon Sep 05, 2011 11:15 pm

Earendel: We use flash develop, its a great tool.

1) Its pretty balance, we use a lot of Inherits and polymorphism so some of those 500 classes only change a few methods from the Parent class.

2) Object Pooling: http://en.wikipedia.org/wiki/Object_pool_pattern
What we notice is this: because as3 use garbage collector, the memory management sometimes cause drops in fps, create and destroy lots of objects may cause this when the garbage collector does its job, we really gain a lot on performance allocating objects on a pool instead of creating and deleting objects constantly.

3) Yeah, its better to think before start coding, you can create big UMLs but we didn't do that in this game(Maybe some small parts only on paper).
Although we din't create UMls We spend some time planning the core of the game on paper.
User avatar
Ironhide Developer
 
Posts: 700
Joined: Tue Aug 09, 2011 7:20 pm

Re: Kingdom Rush development questions!

by dimumurray » Thu Sep 22, 2011 4:17 pm

One cool thing about Kingdom Rush is that enemy units move on curved paths. Its a subtle thing but it does a lot for the game, and its not a feature implemented in a lot of other TD games (if any). I think the game utilizes predefined paths constructed using Bezier curves (mostly likely quadratic). Not the typical approach, but given how smooth the enemy motions are, I don't think any of the usual path-finding algorithms were involved. If that's the case, it would be fair to guess that the game is not tile-based, which would mean that each map is a static image with path data overlaid.

Ironically I did something similar for a prototype a few years ago and tried using some custom Bezier code but ended up abandoning that in favor of some weird guide-based mechanism ( check out the prototype here ).

I am going to take another crack at using Bezier curves. So i'm putting together a little demo to see if this approach is actually feasible. Maybe I can capture some of that KR magic.

EDIT:

And here's the result of my efforts:
QUADRATIC BEZIER SPLINE TRACER
Last edited by dimumurray on Wed Oct 26, 2011 3:54 pm, edited 1 time in total.
User avatar
User
 
Posts: 348
Joined: Wed Aug 31, 2011 6:11 pm

Re: Kingdom Rush development questions!

by dimumurray » Sun Sep 25, 2011 12:27 am

lito88 wrote:Hi

How many custom classes did you end up writing to put this beast of a game together?
We wrote more than 500 custom classes.


Here's a follow up question I forgot to ask. How long did it take to write all those class? In other words how long was the development cycle for the game as far as coding is concerned?
User avatar
User
 
Posts: 348
Joined: Wed Aug 31, 2011 6:11 pm

Re: Kingdom Rush development questions!

by Asonero » Mon Oct 24, 2011 5:11 pm

wow. thanks for the answer in the other post.

I ve read carefully the forum, very interesting. ANd the game is wonderful, i love the graphics and also the game is very well coded i think (use small CPU and is very smooth and effective).

I can ask you what frame rate is used, in Kingdom Rush?

is always the same frame rate, or it change sometimes?

You prefer to use hard coding, or you use a lot of functions? (ps: is better to hardcode or to call everytime is possible functions? because i suspect that hardcoding use less CPU, is true?)
User
 
Posts: 4
Joined: Mon Oct 24, 2011 10:36 am

Re: Kingdom Rush development questions!

by lito88 » Tue Oct 25, 2011 12:50 am

Try to use good programing practices as mutch as you can, hard coding its not a good practice.

Kingdom rush run at 30 fps.
User avatar
Ironhide Developer
 
Posts: 700
Joined: Tue Aug 09, 2011 7:20 pm

Re: Kingdom Rush development questions!

by Craixis » Wed Oct 26, 2011 10:20 pm

30 fps? I take it that's with frame doubling correct? (Animation wise).



Also, how is it knowing that you're partly accomplished your goal of taking over the world one computer at a time :p ?
I r Flash doodler.
User avatar
User
 
Posts: 11
Joined: Wed Oct 26, 2011 10:09 pm
Location: Canada, Alberta

Re: Kingdom Rush development questions!

by DragonKnight » Thu Oct 27, 2011 12:10 am

Craixis wrote:30 fps? I take it that's with frame doubling correct? (Animation wise).



Also, how is it knowing that you're partly accomplished your goal of taking over the world one computer at a time :p ?

THATS BUNGIES JOB!!!!
User
 
Posts: 616
Joined: Mon Oct 17, 2011 11:35 pm
Location: United States of America,Michigan

Re: Kingdom Rush development questions!

by Asonero » Thu Oct 27, 2011 4:16 am

Thanks for the answers. I noticed that you used bitmap fills for animation, right? (u use sprites of bitmaps...)

What program u used to draw the soldiers/enemies? photoshop? SAI?

Why u didnt draw in Flash? this improve performances ? (bitmap fills)
User
 
Posts: 4
Joined: Mon Oct 24, 2011 10:36 am

Re: Kingdom Rush development questions!

by dimumurray » Thu Oct 27, 2011 12:47 pm

Asonero wrote:Thanks for the answers. I noticed that you used bitmap fills for animation, right? (u use sprites of bitmaps...)

What program u used to draw the soldiers/enemies? photoshop? SAI?

Why u didnt draw in Flash? this improve performances ? (bitmap fills)


For answers to those questions check out the following thread:

Kingdom Rush Art style

And say kudos Gonzasan when you get there. He's IronHide's artiste extraordinaire.
User avatar
User
 
Posts: 348
Joined: Wed Aug 31, 2011 6:11 pm

Re: Kingdom Rush development questions!

by kilele » Sun Oct 30, 2011 11:09 am

Does KR make use of some kind of artificial intelligence ?
Does the game release waves based on how towers are arranged ?
KR1 Fanmade Challenges
At the end of the experiment, you will be baked and then there will be cake.
User avatar
User
 
Posts: 999
Joined: Sun Aug 14, 2011 5:58 pm

Next

Who is online
Users browsing this forum: No registered users and 85 guests