© 2023 by Andrew Jonhardt. Proudly created with Wix.com

  • Andrew Jonhardt

Just an update

This is the furthest I've gotten with state machines at the moment:

extends Node

class_name StateMachine


var cur_state = null

var previous_state = null

var states = {}


onready var parent = get_parent()


func _physics_process(delta):

if cur_state != null:

state_logic(delta)

var transition = get_transition(delta)

if transition != null:

set_state(transition)


func state_logic(delta):

pass


func get_transition(delta):

return null


func enter_state(new_state, old_state):

pass


func exit_state(old_state, new_state):

pass


func set_state(new_state):

previous_state = cur_state

cur_state = new_state

if previous_state != null:

exit_state(previous_state, new_state)

if new_state != null:

enter_state(new_state, previous_state)


func add_state(state_name):

states[state_name] = states.size()


About the only thing that I understand of the above script is that it's supposed to be a state machine framework within which to set and move between states. I got it from here:


I don't know how each of the functions within the script works in the context of the whole script, I cannot currently make a script like this on my own, and my experiments ultimately resulted in frustration (I've learned almost nothing from this YouTuber, and I don't recommend him).


I searched for an alternative script, diving into the Unity forums for something in C# and checking for a Python solution, but I wasn't able to find anything that I could learn from. Under different conditions, I might be willing to take my time with learning state machines using my current knowledge. Instead, I feel like I'm under something of a time limit.


Here's the thing: I promised my employer I would get a Windows Server 2016 certification last year, with a deadline of January of this year. I haven't done this, and I can't make myself care. I know, all I'd have to do is power through it. However, over the past two months, it's finally hit me that I want absolutely nothing more to do with helpdesk or systems administration work.


Alot of people can't make a livable wage purely from developing games (I've been told). Even my college professors talked about taking side-jobs making applications for companies in town. In accordance with this, my previous plan was to keep working helpdesk/sys admin until I could make more money from games than from my current job. New plan: I'm going to change careers and see what happens.


I'm not jumping headfirst into Game Design. That would be dumb without at least a few real projects to my name. I'm going to study a few programming languages, take a few programming certification tests (still paid for by my current employer, thankfully), try and develop a few non-gaming applications or contribute to an open source project, and see if it all adds up to a programming position.


I've tried C++, Unity's version of C#, Lua, Java, Python, and Godot's Python-like GDScript. Java was actually the easiest to work with, imo, and I'm assuming the Java job market is still gigantic. However, Oracle, the company that owns Java, is a parasite. Installing Oracle-owned software and packages on my computer physically hurts me. So, instead of Java, I've already started trying to teach myself Python.


I'm not sure what the job market is like for Python. I'm choosing Python to start with for 2 reasons: Python is one of the easiest programming languages to learn, and it's similar to Godot's GDScript. The hope is that I'll be able to use Python to quickly and easily learn advanced programming concepts, like state machines, and then apply such techniques in GDScript while I'm still learning. Once I've finished a few Python certifications (I believe there's only 3 that anyone even remotely cares about), I'll start on another language.


Oh yeah, and I going to put out Mask of Undying before the end of this year. I'm going to try studying Python and re-building Mask in Godot version 3.2, at the same time. So far, I've created my best version of the character controller.


I've taken the opportunity to re-evaluate the game and cut some complexity. I managed to add a few additional traps/inanimate objects in the process, which in this case is a good thing. The previous versions didn't have enough dangerous inanimate objects for a game inspired by Splatterhouse. Splatterhouse has a boss that is literally a room, for crying out loud.


Updates are going to stay bimonthly, but I'm moving them to the 1st and 3rd Sunday of the month. This will give me time to actually finish these posts on time. Hypothetically.


Next post, I'll start covering the Mask of Undying dev process again.