Making of The Hidden Axis (6 hours of dev time)
Thanks for checking out The Hidden Axis. My goals where to test the effectiveness of an in-game report form, use fast design options, and test a new Finite State Machine.
The in-game bug form was a big success 12 entries! Repuci even advised me of a big game exploit, thanks Repuci!
Fast low code design:
I focused on Scriptable Objects (SO) so I could set up new levels quickly in the editor:
Unity Events:
Unity Events for easy method calls from other scripts. Declare a public UnityEvent and in the inspector drag and drop object.. select the method to be called in the dropdown https://docs.unity3d.com/Manual/UnityEvents.html!
Above you can see that when the Die method is called, the " onDeath " unity event is invoked to call the CheckBattleEnd method from the dropdown menu.
Scriptable Object Events:
SOs with a Monobehaviour (MB) and Unity Event as a listener, can provide an even more flexible and scalable event system. The listener waits for that specific game event SO to be raised and responds by invoking a Unity Event:
Above you can see that I declare a public GameEventFloat (inherits from the SO class). I then drag any GameEvent SO into the inspector (i.e. the EnemyHeal).
The SpecialAttack method for the priest class triggers the "healEvent" referenced.
The Game Event listener can be attached to ANY object. If the event is invoked all listeners referencing this event will call the method chosen.
Variables:
SOs also work as variable that can even persist across scenes.
Here is my GlobalInt SO class:
If you are interested in learning more about SO Architecture check out this video from Unite 2017 with Ryan Hipple from Schell Game Architecture with Scriptable Objects - YouTube
The Finite State Machine (FSM) :
The FSM is a design pattern made of one or more states. Only one single state of this AI can be active at the same time. The AI has to transition from one state to another. The AI only performs actions listed in the state. I used SOs for all of this.
This makes an AI structure that is modular, scalable, and easy to expand on without coding. For example, I have an action called move, the move action moves the unit (it is in normal state action list). If I took that same move action and added it to the Attack state actions list, the unit will move and attack... without adding any extra coding!
Reach out with any questions :) Thanks!
Lochraleon
Files
The Hidden Axis
Status | Released |
Author | Lochraleon |
Genre | Strategy |
Tags | Clicker, Management, Medieval, Short |
Comments
Log in with itch.io to leave a comment.
Took a big stone at the river, put it in the truck, bring it back to the garden.
Will make a statue of you with it.
Lol :D I'm humbled, thanks Manu!! ;)
Good stuff, love dev logs like this.
Thanks so much! It was my first time trying out a devlog :) I hope to do more of these in the future.