Friday, April 17, 2026
April 2026 TBS Update
Thursday, October 7, 2021
My development workflow
Today, I'm going to demonstrate my developer workflow and architecture for my game, with Unity3D, GitHub, and Visual Studio. I've created a workflow that allows me to verify any change with a rich set of automated tests, and automatically load those changes into my Unity project, reducing the time to resolve bugs, and giving me confidence that my code is robust.
Architecture
At the top level, I have my Unity project (in green), a private project stored in GitHub. This has an attached .NET project, (named the default "Assembly-CSharp"), that references a .NET standard dependency "Battle.Logic", a public project in GitHub. Attached to the Battle.Logic project, is a unit test project that currently has ~97% code coverage - and leverages over 200 tests that run in just a few seconds - giving me almost instant feedback that the project is in good shape.
The bug
Wrap up
Sunday, August 1, 2021
Reorganizing, again.
Every couple of years I end up in the same spot, lost, overwhelmed, unmotivated. 6-12 months later I repeat the cycle, rebooting and starting again. I've done this for roughly ten years...
This round is different. This one is powered by DevOps and GitHub.
Why is this one so different?
First, I've separated the logic into a separate project, and it's open source and on GitHub for anyone to use. Using .NET Standard 2.0, and C#, I'm able to write unit tests that validate that this project is working as expected. As it's all just C#, no graphics are being rendered, the tests run extremely fast, nearly 200 tests in less than half a second. I calculate paths, chance to hit, field of view, etc, without a graphics engine. These automated tests are a crutch when I walk away for a day, week, or several months. I know that when I return, I have a series of tests to tell me when I break something else.
Additionally, I can visually see my maps and situations in 2D using ASCII. I can render these data structures in 3D with Unity3D relatively easily, but seeing it in 2D gives me an easy debug mechanism.
I also have a detailed log to help me with debugging. Human readable, important as I am a human.
More is coming, I've just started to integrate this in Unity3D, and I know there will be more breaks in development, but now I know I'm chipping away at a system I can always pick back up again. I start a turn by calling my battle logic, all of the movement calls return a list of moves and if their are any interrupts - and in general, it's making the 3D part of this, much, much easier to manage
Tuesday, September 26, 2017
Update 51: Emerging AI
- Find all possible tiles the character can move to, initializing them with a score of 0.
- Assign points to any tiles that are in cover (+10). If the character is currently not in cover, give all of those positions an extra boost to encourage the character to move into cover. (+10)
- Add points for tiles that are in range for the character to shoot at the opponent. (+10)
- Add points for tiles that close the gap between the AI and opponent. (+5)
- Add points for positions in cover that flank the opponent (+20)
- Add points if the opponent is within range and has more than a 50% chance to hit. (+10)
- Add even more points if the chance to hit is 80% or more. (+20)
- Add even more points if the chance to hit is 95% or higher. (+30)
- Order the list by total score, descending order (highest first)
- Pick the top score from the list.
Thursday, September 14, 2017
Update 50: Combat and 50!!
However, the combat is proceeding along nicely. I've added projectiles and the destructive terrain back. I've added back the shoulder cam when you are aiming and choosing your target. The enemy and player are now dealing (and receiving) damage. I almost have a quasi game here.
Here you can see the setup of the level, with the second (shoulder) camera ready
The view from the shoulder cam. The models really look low res here!
Boom!
Before the shot...
"Missed", that is the end of that wall!
Here you can see the ray-cast passing through the enemy, it was a hit!
Thursday, August 31, 2017
Update 49: Added weapons to the characters
I also added a muzzle flash when the gun shoots (it shows for just a fraction of a second).
Next I will add projectiles and add back in the destructive environment that I started with, all those years ago.
Sunday, August 27, 2017
Update 48: Implementing the turn state diagrams
When a player has finished all of their moves, it switches to the enemy turn, where the (overly simplified AI) decides to just pass ("Patrol"), and switch back to the player. Since the player still can't attack, I think this is fair.
Next we need to add AI to the player to move into cover and shooting between the two teams...
Tuesday, August 22, 2017
Update 47: Cover and Flanking
Here my player is in cover (the enemy has a lower chance of hitting the player and dealing damage):
Here my player is flanked and not in cover (the enemy has a much higher chance of hitting the player and dealing critical damage):
There was actually quite a lot of rework involved in the code and corresponding systems to get the enemy soldier to (re-)appear and have everything work. The next update will be even more involved as I refactor the code into more systems and add more players and enemies - adding turns that switch back and forth after movement.
Monday, August 14, 2017
Update 46: OpenTile
One of those mini projects I've been working on is very relevant for this project. About a year and a half ago, I started a GitHub project I've called OpenTile. OpenTile is an opensource solution to create the building blocks and data structures for a tile based game. There is no UI, apart from the ASCII files, but it's being built in C#, with a branch for Unity3d. There is currently functionality for basic path finding, possible available tiles (for movement), cover, as well as a number of utility functions.
I've found this framework really helpful for building a game. I'm able to focus on fundamental functionality such as path finding or cover in a simple ASCII UI, and then it's much easier to integrate the changes into a full 3d engine - with the confidence that it works.
In the screenshots below you can see two simple examples that show the output of path finding on a large map with varied obstacles.
In Unity3D, this is what the result looks like on a small test map:
Friday, October 16, 2015
Update 45: Rebuilding random levels
Next is path-finding!
Friday, October 9, 2015
Update 44: Splitting the Engine
For example: A player decides to move to another location. The interactions engine figures out along the players path if anything will happen (enemy overwatch) and predetermines all results. (perhaps in this case, an enemy will have an overwatch event, shoot at the player and kill them mid path). This information is all passed to the Cinematics engine which controls the result. The camera would start by showing the players movement until it reaches the point of the overwatch event, where it would move the camera to show the enemy firing and then move again to show the player dying.
I really like this idea and think there are a lot of benefits in implementing it. You are essentially making it easier to test, (as you can setup the same set of events and reply them in the cinematic engine), as well as really separating the core mechanics of the game from the visual representation.
I'm really leaning towards trying to implement my own version of this, and this is the perfect time to integrate it in. Anyone else thought of an idea like this before?
Monday, October 5, 2015
Update 43: Rebooting again
Today, I'm back with a new reboot, using some assets from a "Simple Military" unity package, made by a New Zealand company called Synty Studios.
This in combination with a new design idea, (Hovertank Wars is dead again), still based on turn based combat (and XCOM), but set in a new environment that drastically reduces the scope of the project. and I think makes it all possible. Over the past three (!!!) years I've now created a turn based system with pathfinding, a UI, a dynamic camera system with killcam, loading/saving, destructive environments, random levels and even a basic AI.
It's time to take all of this and create a complete game. I look forward to (re-) starting this journey again!
Friday, April 3, 2015
Update 42: Unity 5 and Unity Cloud Builds
Along with this was a new cloud build system that works with GitHub.
Friday, November 14, 2014
Update 41: Code Reorganization
Characters
--Actions
--Pathfinding
--UI
Common
LevelEnvironment
Main
--UI
I debated having UI at the root level with "Main" and "Character" children, but ultimately decided that these UI elements would be completely different. The diagram below should what the code map looks like after the new reorganization:
I've also developed a process to implement new features in a safe and comprehensive way, using several levels of prototyping. This is similar to branching, which many software development processes use (but I do not). My process usually starts with an almost blank level. Once the feature has been implemented, I usually integrate my new feature up to one of my intermediate test levels, testing in a controlled environment with a few buttons to test movement and shooting. This is typically my 'tank test' level which has a few static objects and buttons to constrict movement, almost in a unit test sort of way for regression testing. The final step of my process is to integrate in the feature with my actual game levels. This means it can take a while for a new feature to make it into the game, but it's also a comfortable way for me to test new features and not put them into the main game until I am ready.
Thursday, October 30, 2014
Update 40: Dynamic Pathfinding
The first screenshot shows where I've been up until today. The path finding is 'baked' into the screen and there is a path from the beginning (green gate) to end (red gate).
The ultimate test of this is to move the end gate to the other end of the screen.
Friday, October 17, 2014
Update 39: Exploring Pathfinding
- Added some basic sounds for explosions and shooting
- Fixed some bugs around shooting when I missed. The bullet would stop at the target, instead of continuing into the sunset.
- Upgraded the shooting range modifier using the formula:
- RangeModifier = 50 - ([tiles between source & target * 5)
- Upgraded the AI to choose the best target based on the difficulty, instead of taking the first enemy off the list
- Started work on creating a path finding solution. I'm using the Aron A* Pathfinding Project. You can see an early prototype below. The first screenshot shows no smoothing, the second with smoothing.
Friday, October 10, 2014
Update 38: Adding messages and more polish
I also have a few bloopers. This is a result of my very simple movement AI. When two tanks get close to one another, the physics pushes one of top of another, in a manner very similar to a tectonic plate in the earth's crust, but creating some humorous situations.
Next week I'll have some initial path finding results, after having some success this week using Aron's path finding plugin.













































