3D Tower Defense, Part 1
July 7th, 2008 | by phantom |Back in May I made a large fuss about how OpenGL was going no where and how I was going to do things with D3D10. Then, the dust settled and I realised that I didn’t know what I wanted to make.
I’ve spent the last few years mostly playing around with technology and making libraries, this is all very well and good but the reason I started down this road in the first place was to create games; ok at the time it was firstly on my father’s BBC Micro and then on my Atari ST but here I am some 15 years later with no games to show for it. Granted, my day job has me programming games but this isn’t really the same.
So I decided it was time to make something, however I wasn’t sure what to make nor was I sure what to make it in.
The latter of these two problems was simple in that it would either be C++ or C#, with the former being backed up by Lua. I’d like to use Lua with C# as well however there is currently a lack of bindings and right now I don’t want to go down that route.
So, next comes the ‘what to do’ problem and, like many others, I’m not without my own ideas.
- A top down shooter which is played on a randomly generated map as you go along from segments. There would be certain rules about how map segments would fit together and it would only generate a certain number of segments in front of you and remember a certain number behind.
- A variation on a tower defense game, which I’ve floated before over on Gamedev.Net, where instead of a fixed path the monsters/creatures roamed around and attacked a central town.
- A two player turn based game where by one player controls a group of creatures and the other controls a single character. The single character would have a high powered rifle of some sorts and would have good vision range (excellent while zoomed in but a restricted angle), the creatures would have poor visual range but there would be more of them. The idea is for the creature player to hunt down the single player while he tries to elimate all the creatures. It would probably be action point based for the various creatures and single player. When the single player shoots the creature controler knows where he is at that moment.
- A Ground Control-esque game with semi-futuristic weapons (so no energy weapons, just marines, snipers, tanks etc) with a focus on tactics with limited resources.
When considering my options I decided I probably couldn’t do 4 justice right now (plus Dawn of War 2 might well fill that gap for me) and that the concept behind 1 had been somewhat done before (maybe not real time level generation but close enough). The 3rd option is still fresh in my mind and is being worked over as a 2nd idea because, as should be obvious from the title, I went with the tower defense game.
One of the things I wanted to do with this game was check the concept would work, to that ends I decided to build a mock up of the game in 2D using Winform, GDI+ and C# in order to quickly judge how the game would work.
It should be noted at this point that I have next to no experiance with C# beyond the small Magic 8 Ball program I once wrote for my phone and no experiance with GDI+.
I say this because the whole experiance was very painless. I went in, I threw some code together and it all just worked. While it is still short AI and game concepts what I wanted to get done had been done; a GUI which would let me visualise the game state and try out various things.
The above image shows the program in it’s default state.
The red grid is the game world and the blue ellipese are the ‘creature’ in the world. The black and white square represents the town and the red area around it is an exclusion zone which is to prevent creatures from spawning too close to the town.
Currently everything but the ‘run update’ button works. Changes to the town details are reflected in immediate updates and “Start New Grid” regenerates the grid with new creatures based on the current town position and size as well as it’s exculsion zone.
In the name of convinance the town can also be dragged around to position it.
Right now the ‘creatures’ are just cell locations, my next task is to given them their own existance and begin their march towards the town to attack. This is where the “Run Update” button will come in as it will allow me to watch how the monsters progress and in future fine tune things easier for the inital game play aspect of things.
The current Alpha release source code can be downloaded : TowerDefConceptTesterAlpha1.zip (0 bytes)
You might need .Net 3.5 to compile it.



1 Trackback(s)
You must be logged in to post a comment.