Tactics Movement Tutorial (Cont.) – Jumping and State Machines

December 23rd, 2018

Tactics Movement (Cont.) – Jump State Machine

Jumping in Tactics Game

Unity Tutorial – Tactics Movement – Part 4

By: Game Programming Academy

This part of the tutorial focused a lot on the jumping aspects of the player movement. The movement when the unit jumps up or down to different elevation tiles should operate differently than when it just moves around on equal elevation tiles. A state machine is created to deal with all the various aspects of a jump, as well as the possibility of jumping upward or downward. The state machine however appears to have significant bugs in it that will need to be worked out.

Terms

  • Stack: Pop, Peek
  • Protected class

Problems

This part of the tutorial had several bugs that could possibly occur, which the creator of the videos also encounters. The tutorial video showed an issue where the unit would just float in a straight line when it should come down, but I have yet to have that occur. Most bugs I saw had the unit not perform a jumping action, such as just instantly teleporting onto the top of a block instead of performing its slow jump animation. My errors seem to come from the jump state machine not updating properly consistently, where the tutorial video errors seemed to be coming from an issue with the forward-facing vector of the unit not being perfectly lined up at all times (the floating issue might also just be a strange state machine update issue).

Lessons Learned

Locomotion is a good term to use as a commenting term in coding to determine where movement of an element is truly occurring. Can be helpful for figuring out timing for adding animations.

State machines can require a lot of debugging. This will just require consistently calling out what state the object is in at what times, and checking if all of the flag changes are occurring properly.