itch.io is community of indie game creators and players

Devlogs

Making of The Hidden Axis (6 hours of dev time)

The Hidden Axis
A browser game made in HTML5

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

  • final1.4.zip 16 MB
    May 08, 2022
Read comments (4)