Matthew M Langer
  Game and Level Designer
  • Home
  • Professional Work
    • The Callisto Protocol
    • Days Gone - Main Game
    • Days Gone - Dead Don't Ride DLC
    • UntitledArenaGame
  • Older Work
    • Solo Projects >
      • Face-Off at the Frozen Throne
      • Spaceport Defense
      • Crystal Mines: Thesis Artifact
      • Phantasmagoria: Gears of War Level
    • Team Projects >
      • From The Ashes
      • Identity
      • Skyscrappers
      • Ethereality
    • Scripting >
      • Blueprint Scripting: A.I. Instructor in From The Ashes
      • Entity Scripting: Boss Battle in Crystal Mines
      • Entity Scripting: Custom Gibs in Crystal Mines
      • Entity Scripting: Melee and Ranged Combat in Crystal Mines
      • Kismet Scripting: Contextual Interaction in Phantasmagoria
      • Kismet Scripting: Stun Gun in Phantasmagoria
      • Lua Scripting: Bat A.I. in Ethereality
  • Resume

Blueprint Scripting: Instructor A.I.

Picture
Design Goal: Script an instructor A.I., Marcus, to show his younger brother Arlo, the player character, how to move through the level and instruct him in the basic mechanics of the game.
Picture
Description: Early in the development of From The Ashes, I wanted to focus my design on accessibility.  Platforming itself can be challenging enough for players, let alone first person platforming, grappling hooks and wall running.  I thought it would be best if players had the chance to see someone else moving through the level to have a better idea on how to use their abilities correctly.
Picture
Picture
Picture
An overview of the entire Instructor A.I. script.
Picture
The script starts whenever an actor collides with  a collision box attached to Marcus.  Then the actor is checked to see if it is Arlo or not.  If it is Arlo, then the current stage in the tutorial is triggered by the switch statement.
Picture
The beginning of the Instructor A.I. script.
Picture
Once the tutorial stage starts, the collision box around Marcus is immediately disabled to prevent the script from being triggered while executing.  Marcus then performs the given action which generally includes a mix of talking, moving to points, jumping and shooting a grapple.
Picture
A typical script for any single tutorial stage.
Picture
At the end of each tutorial stage script the new tutorial stage value is set and the collision box around Marcus is reactivated, allowing the player to progress to the next stage.
Picture
The ending statements to each tutorial stage script.
Picture
Design Challenge: There were several challenges with scripting the A.I., the most frequent issue is how delicate the code is.  Marcus linearly moves to specific points or moves relative to the direction he is facing.  This meant even the slightest geometry changes would often break the A.I. and require rework.
Picture
The nodes used to craft the A.I.
The second and more difficult challenge was a combination of the above manual requirements and a taste of chaos theory in action.  One section of the level features moving islands that rotate in a circular fashion.  Because the A.I. only moves after the player finishes reading his text, the game doesn't control the orientation of the islands when the A.I. attempts to attach to them.  As a result, even small differences in the initial state of the islands caused large differences in the final position of the A.I., oftentimes resulting in his death.  A lot of effort was needed to normalize this chaotic system because testing is by definition inconsistent.  After a lot of back and forth with the programmer to help with this issue, I had to tell the A.I. to apply movement input behind him, normalizing the chaos of his swinging motion and creating a consistently functioning A.I.