Progress AI Update
It has been a few weeks since my last Devlog, so I figure I should let people know how the next update is coming.
The 1.6 update focuses on the games AI, and a big reason for this has to do with my philosophy regarding game design. That being that the most important goal for a game is to entertain the player, everything else comes second. To that end, making an AI that is fun to play against is more important to me than making an AI that is difficult to beat. With that being said I realize that challenge and overcoming a challenge is a big contributor to making a game fun, so these concepts are not completely separate. The AI in Chopper Tank Flak was particularly good a keeping its units out of harms way. In-fact, it was too good at it; and this results in an AI that kept its units just out of harms reach until it was cornered or the player made a mistake that could be exploited. Naturally, this made gameplay challenging in a way that was quite tedious. To avoid this issue I adjusted the constants that the AI used to judge decisions to make it more reckless in my released versions.
To give my AI a better sense of initiative I implemented a system that makes the AI consider its moves as a means towards its end goals. However, I discovered that this system produced a prohibitively high performance cost. It could take the AI over three minutes to complete a turn on the mission "operation Castle". This was just longer than a week ago when I started writing a rather somber draft for this devlog where I would announce that the update would either be delayed or cut back.
However, I am pleased to announce that I have made a breakthrough on the development and things are looking much more optimistic now. And all it took was a near complete re-write of how I was using pathfinding. Previously, I was using A* path searches to measure distances to determine directions. And since all these searches were costly, I would save the results to be used again if possible. This came at a very heavy cost, but offered very accurate pathfinding so long as player units weren't taken into account. The new system offers slightly less accurate navigation with superior performance. The game now takes about 1 second to move a unit. Additionally, the amount of total time it takes to move the units now scales much more linearly with the number of units the AI has; which means in the future I should be able to make levels with far more units.
Here's an example of the new navigation system at work:
The information displayed is either the tile coordinates in format (X, Y, Z) or the AI's analysis of where it can move its tank divided into three values: G, R & T
"G" is the geographic rating for moving to the hex, "R" represents the risk to the unit's safety, and finally, "T" is the total of these values and others I wasn't concerned with at the time.
The new navigation system works by choosing a goal for each unit based on the unit type suitability and as the crow flies distances. Then the AI tries to make plot a path to the chosen goal of the objective, such as the unit it wants to destroy or building it wants to capture. Along the way it takes note of other goals it could reach. It then chooses the most fitting objective of the objectives that it found during the pathfinding, and if it then tries pathfinding to one of the objectives that were found. When plotting this path the AI marks a waypoint at the edge of its range. The Geography rating of a move is based on the proximity to this waypoint.
The geography rating resembles a wedge shape opening towards the way point, and tiles within this wedge are weighted by distance to the waypoint. The AI finishes its move by choosing one of the tiles with the highest total rating.
In order to make the AI take more initiative I need to make it less afraid to make the first move, or dull its survival instinct, depending on how you want to look at it. To keep the game challenging, the best way to go about this is to provide the AI with more advanced means of risk assessment.
To start I gave my AI an "Understanding" of target saturation, which is pretty well demonstrated by image below.
Here the AI is in the process of capturing my base in the bottom left, a process that is threatened by my tank. What the Infantry should do here is obvious, the flak car however, not so much. My current algorithm applies a maximum -7 risk modifier to the final rating of move for an outright kill, like my tank attacking the flak car or infantry. So you might wonder why the highest(or lowest depending on how you want look at it) rating for risk is -4.
That is because of target saturation; the AI "knows" that my tank can only destroy one unit on the next turn. So the tank doesn't pose a risk of destroying both the infantry or the flak car. The more accurate way to look at it would be that the my tank poses a 50% risk to both units. 50% of -7 is -3.5 which rounds to -4, thus the final multiplier. This leads the AI to the completely valid assessment that since the flak car can't protect its infantry from my tank, it may as well try to go after my attack helicopter near the right.
Anyway, that's what I've been up to lately, but where does this leave the next update? Well, it is my sad duty to report that despite my progress, I will likely need to scale back the 1.6 update. I will probably still have an improved version of the AI ready by my deadline at the end of the month; but it won't be as extensive as I initially planned. Additionally, there is still a chance that I will need to postpone my update until the first week of November, at the very least for QA purposes. I have received feedback during a game jam that I recently attended that my game would benefit from an interactive tutorial, and I don't want to delay action on my first bit of genuine feedback longer than I have to.
Speaking of which, feel free to leave some feedback in the comments section if you have any.
Chopper Tank Flak
A turn based strategy game with rock paper scissors combat mechanics.
Status | In development |
Author | CameronJung |
Genre | Strategy |
Tags | 2D, Hex Based, military-strategy, Mouse only, rock-paper-scissors, Singleplayer, Turn-based Strategy, Unity, War |
Languages | English |
More posts
- Chopper Tank Flak 1.6.0 AI Update19 days ago
- The Road Ahead, AI Update67 days ago
- Chopper Tank Flak Artillery Update78 days ago
- Artillery Delays89 days ago
- Artillery ProgressAug 08, 2024
- The road ahead, artilleryJul 31, 2024
- Itch.io Debut of Chopper Tank FlakJul 24, 2024
Leave a comment
Log in with itch.io to leave a comment.