With the theory done and a solid prototype, it was time to implement the more advanced level creation into the main engine. I started by implementing the 6 tiles I needed, a vertical, horizontal, and the 4 turn pieces. I considered refactoring the pieces so that there were just two tiles and then rotate them to fit, but I realized it would be better to create the extra variation. Here is a screenshot all 12 tiles available now:
I moved my prototype code over to the main engine, replaced a few lines of code that were specific to the console app and generated my first dynamic level with a river.
With that working, I brought in the rest of the tiles (the previous screenshot was just river and a blank tile). The following two screenshots show two random maps with more of the pieces.
I can't begin to explain what a giant leap forward this is for me.
After scaling up my levels and populating them with the new assets, I went to work creating randomized levels. The original xcom had 10x10 tiles that were randomly added to a level to create a 100x100 sized level. This worked very well to create a new experience in every level, even though the buildings were often recognizable.
I've only created four 10x10 tiles so far, but I've made them all prefabs. In the screenshots below, you can see two of the prefabs highlighted. Note that this is only a 20x20 level, with only 4 tiles of 10x10 each.
Now when I load a level I am able to randomly choose, arrange and rotate these tiles to create a random level. This is a huge step forward for my project. By creating 10x10 prefabs with content in the center, I can really create some interesting levels. Here are a few more samples:
This last sample is a 30x30 sample (9 tiles total) from a five tile set (one of the tiles is blank):
I finally have my characters moving. If you know me and have talked to me about this project, this has been a significant barrier for the duration of the project to date. I've tried multiple path finding algorithms and methods to move my characters, mostly with pretty horrific (lack of) results.
Today that changed.
It's simple, but it involves two pretty important mechanics.
- A simple tile based system that highlights possible moves. This creates the 'sectors' my game needs, but still gives me the flexibility to not be tied to these tiles.
- The ability for me to click on the highlighted tile and actually move the current character to that position.
The test level below shows both mechanics at work, but in the final game, the red grid will not be visible.
You can download the Alpha 1.5 version here: http://www.samsmithnz.com/content/tbe/tbe_alpha1.5.zip. Also included in this build are links to some of my test levels, where I develop and validate mechanics in isolation, the explosions from 1.45 and some more bug fixes.
As well as this, I'm still continuing to improve dynamically exploding walls, setting up the final milestones for the complete Alpha demo, starting to develop a theme/story and finalizing a few other details. So what is left? I have 5 items that I'm currently working through in various stages, and 8 more items that I have not yet started. (This neat chart was produced by Visual Studio's free and online version of Team Foundation Server).