Tower Defense proyect

Hi guys, my name is Leonardo, I am from Argentina, I’m Spanish speaker so I apologize for my mistakes when putting my words into English.
I’ve started with jMe like two months ago and, to be honest, I didn’t have much game programming knowledge at that point, (well, I don’t think I do now lol), but with the great Wiki you guys have, and the really powerfull SDK, it wasn’t really hard for me to start understanding how the games ideas I had could become truth.

Since I was young, I really liked Tower Defense games, I spent many hours of my childhood trying not to get monsters into my base lol. So when I started reading the jMonkey Engine 3.0 Begginer’s Guide by Ruth Kusterer and I saw she suggested as an excercise a TD game, I knew I was in the right place.
I started making some tests, and this was what the v0.0 looked like:


v0.0

The only thing that remains from there belive it or not, is the great green rectangle :smiley:
So at that time I decided to start thinking about what should the game have. This is more or less what I thought:

A player, representing the person playing the game will have Helath Points and Experience points wich will the determine when the Level of this player will increase, and will be gained by killing Monsters.
Depending on the player’s lvl, Maps, Monsters, (from now on Creeps) and Towers available for the player to buy will change.

Some Towers will have special de-Buff skills, which will affect the targeted Creep when the Tower shoots at it.
These de-Buff skills can be anything, it can be a slow-type effect, that will reduce the creep current speed for some seconds; or a poison-type effect, that will reduce some amount of the creep’s health each x seconds; or a root-type effect, that won’t let the Creep move for some seconds, and many mores. Even combination of them, like a root-poison-type effect that won’t let the Creep move and will reduce some health points each x seconds.

Towers will also have different Shooting methods, these methods represents the way the Tower shoots and gets the current target. For example, a Tower with no debuffs will just reduce the Creep’s health at each shoot, and will keep shooting at this Creep until it dies, or it’s out of the tower’s range, this is the “SHOOT” Shooting method.
But, a Tower with a poison-type de-buff may have the Shooting method “SHOOTANDCHANGE”, wich means it will shoot at a Creep (apply the debuff) and then the tower will change it’s current target to another Creep different from the one it has just shooted, and that doesn’t have the current de-buff type this tower shoots. This allow Towers has de-buffs to be more effective, they can apply the debuff to a Creep, and while that debuff is still active on that Creep, they will apply the same debuff to another Creep, and so on.
Obviously Creeps CAN’T have two de-debuffs of the same type at the same time. No matter these de-buffs lvl, or name.

Towers also have the abilty to be upgraded, wich will increase the shoot damage, and reduce the fire rate at each upgrade (3 upgrades for now). While a Tower is being upgraded, it won’t be abble to shoot until the upgrade is over.
Creeps appear in Waves at the start of the path, wich will change its ammount and cooldown depending on the user’s lvl. Creeps will move closer to the user base position (for now the great Green Rectangle ) and when a creep reaches there, it will reduce the player’s health by the current Creep damage and dissapear. There must be a button that allows you to just make the Wave come, no waiting time.
At some lvls, there can appear special Creeps, called Boss, which will have high health points and damage. It’ll probably kill you if it get’s to your base… But, it will probabbly give you enough Exp points to increase your lvl!

As you continue protecting your great green rectangle, you will increase your level, get better towers, fight stronger creeps, and well… Maybe the game should have an story of somehow lol… Haven’t thought about it yet.
The thing is that Maps will be for different levels, and they will change when you reach certain levels.

All of those were the ideas I had for this game like a month ago…
Right now, they are all implemented. (Except for the maps thing)

Before you see the following video, you MUST be warned: I am NOT a graphic designer LOL.
All graphics in the following video are just to make the logics be visible. They WILL be improved… somehow…

[video]Tower Defense Preview v2.5 - YouTube
In the video, I’ve started at lvl 4 and with more money of normal just for show. I had all towers available, becouse the highest tower lvl is 4 right now. (on purpose)-
I am sorry that the current previews are in Spanish, I have plans for an English traslation, even the whole code is in English. Just the texts are in Spanish.

As you can see I am using T0neg0dGUI, and I must say It works wonderfull, and it’s very easy to implement. I also want to take this opportunity to thank @t0neg0d for being so helpfull with doubts I had, and for suggesting me techniques to improve the game and pro tips.

Right now, the game is obviously a work in progress, but most of the game logic is working good, I’d say. Some things will change, like Tower’s damage, de-debuffs cooldowns and so on, I’ve not spent much time balancing things yet.
I don’t have a name for the game yet.
<span style=“text-decoration:line-through;”>I only have the lvl 1 map for now, wich obviously isn’t finished, it has just been for testing purposes for now… but I think it’ll stay.</span>
I’m storing towers, creeps, and maps data in JSON files, maybe if the game grows I’ll have to use a database.
I don’t have decided what sort of camera will the game have.
<span style=“text-decoration:underline;”>I didn’t make any Screens yet, like Intro, Menu or anything like that.</span>

I’ve taken this as a reminder-sheet too. Sorry for that.

I don’t have any intentions in selling this game. This is only for learning purposes, and mainly for fun.
The game is open source, and I’ve created a BitBucket repo for it. Link to the repo.
I must say I’m very proud of using jMe, the game will have some intro screen with the engine’s logo. And I’d also like to use the familiar Oto mesh at the first lvl, if that is ok.
Well, don’t think I’ve anything else to add for now…
Thanks for this great Engine and to the people who helped me and continues helping me in the forum.

Update 05-15-2014:
I have added a start screen, wich will hold the menu to create a new game, continue a saved game and change options like resolution, vSync, keys shortcuts etc.


I’ve also made a LoadingAppState, wich takes care of loading the world in a second thread, while it displays a loading screen.
I’ve created a new map, and implemented a the LoadingAppState to change between maps at certain levels.

I’ve added background ambience sound to the each map, for example the one shown in the first post now has a forest sounnd, and the one shown below has like a wind sound. I’ve also implemented an AuidoManager to load the necesary sounds for each map and towers. Towers will play a different shooting sound depending on their type and debuff.

I’ve set the camera at a fixed Y position, WASD keys makes it moves, and mouse Axis change rotation, but always with fixed Y. You can still Zoom In with the middle button wheel.

I’m thinking about making a World Map scene, that will show all maps in the game joined, (so that roads match) and you can get a view of what’s comming next, and also play an already played map… I’m still not sure how to achieve this.
That’s all for now !

6 Likes

Wow… this is really looking awesome! I’d like to take a crack at helping with a custom design for your ui once you feel like you have the interface squared away.

1 Like

For a first game, this is really well done! And don’t worry too much about the low-quality models, graphics don’t make the game good or bad, gameplay does :slight_smile: Suerte con su videojuego!

1 Like
@t0neg0d said: Wow... this is really looking awesome! I'd like to take a crack at helping with a custom design for your ui once you feel like you have the interface squared away.
Sure mate! I still haven't decided the exactly place for each thing in the gui yet, and I'm really open to changes!
@vinexgames said: For a first game, this is really well done! And don't worry too much about the low-quality models, graphics don't make the game good or bad, gameplay does :) Suerte con su videojuego!

Thanks!! It’s the first game I plan to finish, I did a couple of tests with jMe before starting with this game. Obviously I have programming knowledge, but not game specific. Gracias!!

1 Like
@turco.chaia said: Sure mate! I still haven't decided the exactly place for each thing in the gui yet, and I'm really open to changes!

Once all of the pieces are in the game, it will be much easier to decide on how you want them laid out, and once they are laid out where you want them it usually sparks a look & feel concept. I can help with the custom graphics for the ui components and modifying the style xml files and such.

Just let me know when you feel like you have all the needed components in the game and the gameplay is in a place where this is something you think is worth focusing on. Otherwise, it becomes more of a distraction than a benefit =)

1 Like
@t0neg0d said: Once all of the pieces are in the game, it will be much easier to decide on how you want them laid out, and once they are laid out where you want them it usually sparks a look & feel concept. I can help with the custom graphics for the ui components and modifying the style xml files and such.

Just let me know when you feel like you have all the needed components in the game and the gameplay is in a place where this is something you think is worth focusing on. Otherwise, it becomes more of a distraction than a benefit =)


Yep, I understand what you mean. Thank you very much for this, I’ll let you know when I reach to that point and we’ll se what we can work out!

1 Like

So fun seeing someone getting inspired by the humble beginnings in the book. I remember playtesting the tower defense game together with @zathras back when she was writing it :smiley:

See if you can get free Orc Tower to work (jME3 supports .OBJ):
http://shop.bitgem3d.com/collections/free-3d-low-poly-models/products/low-poly-rts-orc-tower

And there are a few towers on Blendswap that look okay, but be aware that not all models from there are optimised for game use.

And of course you can use Oto! He belongs to everyone.

1 Like

Hi Leonardo!

@turco.chaia said: Since I was young, I really liked Tower Defense games, I spent many hours of my childhood trying not to get monsters into my base lol. So when I started reading the jMonkey Engine 3.0 Begginer's Guide by Ruth Kusterer and I saw he suggested as an excercise a TD game, I knew I was in the right place.

Hah, this is great! I’m happy to see that what I wrote taught somebody to write a working game. :smiley: I hope you had fun and continue! Looking forward to the next version – and your next games. :slight_smile:

1 Like
@erlend_sh said: So fun seeing someone getting inspired by the humble beginnings in the book. I remember playtesting the tower defense game together with @zathras back when she was writing it :D

See if you can get free Orc Tower to work (jME3 supports .OBJ):
http://shop.bitgem3d.com/collections/free-3d-low-poly-models/products/low-poly-rts-orc-tower

And there are a few towers on Blendswap that look okay, but be aware that not all models from there are optimised for game use.

And of course you can use Oto! He belongs to everyone.


Cool!! I’ve checked up Blend Sawp, but I think I didnt see that “Orc Tower”. Thanks for the links mate!!

@zathras said: Hi Leonardo!

Hah, this is great! I’m happy to see that what I wrote taught somebody to write a working game. :smiley: I hope you had fun and continue! Looking forward to the next version – and your next games. :slight_smile:


:smiley: Thanks!! The book was great! I really learnt so many things. When I started reading the book, I already had the TD idea, but the fact that the books suggested one, and gave some tips about what classes, or files (dont remember exactly) you should create, and more or less it gave me an idea of how jMe could work. It really helped me a lot, so thank you very much @zathras

Well,as I don’t seem to be abble to edit the main post in this Thread ( I can edit the answers I made),I’ll just make a new answer to add some updates.
I have added a start screen, wich will hold the menu to create a new game, continue a saved game and change options like resolution, vSync, keys shortcuts etc.

I’ve also made a LoadingAppState, wich takes care of loading the world in a second thread, while it displays a loading screen.
I’ve created a new map, and implemented a the LoadingAppState to change between maps at certain levels.

I’ve added background ambience sound to the each map, for example the one shown in the first post now has a forest sounnd, and the one shown below has like a wind sound. I’ve also implemented an AuidoManager to load the necesary sounds for each map and towers. Towers will play a different shooting sound depending on their type and debuff.

I’ve set the camera at a fixed Y position, WASD keys makes it moves, and mouse Axis change rotation, but always with fixed Y. You can still Zoom In with the middle button wheel.

I’m thinking about making a World Map scene, that will show all maps in the game joined, (so that roads match) and you can get a view of what’s comming next, and also play an already played map… I’m still not sure how to achieve this.
That’s all for now !

2 Likes