Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This is the design that outlines page details what needs to be scripted to make a working Player movement controller for this project.

Overview

The player movement controller is the first and most important piece of custom scripting needed for the project. With player movement in place a lot of other design aspects can be prototyped and refined.

There’s going to be two methods of movement. Although for now only one needs to be implemented.

  • Dungeon Movement: Input-Timed movement based on 1 input = 1 unit of movement.

  • Town Movement: Free movement based on momentum over time. (Not relevant to this page.)

How it should play

Movement Basics:

  • The dungeon is presented from a top down 2D perspective and the floor is broken up into square spaces.

  • Each of these square spaces is measured at 1 unity unit squared.

  • The player character navigates by moving in 4 directions from one space to another space: They move UP, DOWN, LEFT, RIGHT.

  • If the player character encounters collision in the direction they wish to move: No movement is made.

Rhythm Timing:

Like in the game Crypt of the Necrodancer, this game has a rhythm timing aspect to it.

However: Our game is going to be more forgiving then Necrodancer in that:

  • Failing to match the beat to movement input incurs no penalties.

  • Successfully match the beat to movement input rewards a bonus.

    • That bonus will be determined through other scripts / state machines.

Similar Examples from other games

Crypt of the Necrodancer

In this game there are four movement inputs that equate to UP, DOWN, LEFT, RIGHT, and each press of the input moves the character one space.

The player controller for Dungeon Movement in this game is almost identical. The differences lay in what happens when the player moves to the beat.

VIdeo Link

Widget Connector
overlayyoutube
_templatecom/atlassian/confluence/extra/widgetconnector/templates/youtube.vm
width400px
urlhttps://www.youtube.com/watch?v=R5198bVlANY&ab_channel=Gellot
height300px

Deliverables

Component Script:

  • This script should work as a “Component” in unity. Meaning it’ll be attached to an Object in the Hierarchy. Most likely somewhere in the player character object.

  • Similar to Unity's “Character Controller” Component.

Script Integrations:

  • Integration with Playmaker: The Unity Package “Playmaker” has its own “Global Variables” list that’s used across making state machines. These will be used as triggers for matching up the beat of the music to the players input.

    • Example: There may be a global variable bool called “On Beat” - If the player moves while the variable is set to true then it’s considered a successful rhythm timing.

  • Integration with Unity animator variables: Unity can use “Animation variables” for Int, Float, Bool, & Trigger - This player movement script should be able to communicate with them.

How Collision works

Exposed Variables

The following variables should be exposed in the Inspector window to allow some customization and design tuning.