Blueprints #5 - Finite-State Machines
Hello everyone! Welcome back to Blueprints, where I explain some of the design decisions of Aerostrike. In this issue, I will explain another method used to make each ship behave in its own way.
Aerostrike's AI is built as a finite-state machine. To oversimplify what a finite-state machine is, the AI will change what it does depending on a given state. Each state in Aerostrike is set by a number. The AI will check what state number it currently has, and then run a code assigned to that state. If the current state is "Idle", then the AI will run the "Idle" code. It is that simple. The best part is that each state can be customized to work off each AI's set of variables to create different behaviors.
The most basic set of states would be "Idle", "Attacking", and "Chasing". In "Idle" state, the AI will simply be waiting until the player comes close enough so it can see them. Once that happens, the state will change into "Attacking". Here, the AI will aim at the player and fire until either of them explodes into tiny bits. However, if the player flies too far away, the state will change into "Chasing". In this state, the AI will fly towards the player until it is close enough, switching back into "Attacking" state. Now let's customize these behaviors a bit.
Through the use of variables we can change how the AI understands these states and their rules. Long-range ships like the Javelin can see and fire from further away. This means that they will mostly spend their time aiming and sitting still. Meanwhile, short-range ships like the Scout will have to get much closer to the player. This makes the player move away and out of the range of the Scout. This causes the AI to chase the player around as they try to get close once more. If we make the weapon range be zero, then the AI will quite literally crash into the player, something that the Stinger is well-known for. With this knowledge, we can adjust each ship's variables and behaviors to fit their intended roles.
Combining the design ideas of each ship, the use of variables, and multiple behavior states, it is now possible to create the various enemies of Aerostrike. Wait... am I forgetting something? Join me next issue to find out. Stay safe, Pilots!
Get MF-01 Aerostrike
MF-01 Aerostrike
A Tactical Shmuplovania.
Status | Released |
Author | LMG3864 Games |
Genre | Action, Shooter |
Tags | 2D, Bullet Hell, Exploration, Metroidvania, Pixel Art, Sci-fi, Shoot 'Em Up, Singleplayer |
Languages | English, Spanish; Latin America |
Accessibility | Configurable controls |
More posts
- Patch Notes - Hotfix 2.0.120 days ago
- Patch Notes - Version 2.0.027 days ago
- Plans of the Month - September 10th, 202496 days ago
- Plans of the Month - July 30th, 2024Jul 31, 2024
- Plans of the Month - July, 2024Jul 03, 2024
- Patch Notes - Hotfix 1.5.3Feb 15, 2024
- Plans for the FutureDec 19, 2023
- Patch Notes - Version 1.5.2Dec 11, 2023
- Plans of the Week - December 4th, 2023Dec 05, 2023
- Plans of the Week - November 27th, 2023Nov 28, 2023
Leave a comment
Log in with itch.io to leave a comment.