Week 32: New character-behavior and spawn-position systems

A collection of descriptive icons representing some of the new character behaviors
I made editor icons for the behavior nodes:
follow, collide, run-away,
climb-adjacent-surfaces, move-back-and-forth, jump-back-and-forth, wander

tl;dr: Last week I implemented a new character-behavior system, and a new character-spawn-position system.

What happened last week?


  • I implemented the new character-behavior system.
  • I created a new character-spawn-position system.

Laundry list

  • Implement character-behavior system:
    • Add a new standard _on_navigation_ended method to BehaviorControllers.
    • Implement a lot more navigation-related logic in BehaviorControllers.
    • Add BehaviorController logic for triggering, pausing, and transitioning-to-the-next-behavior-controller.
    • Update behavior-controller finish and pause logic.
    • Refactor MoveBackAndForthBehaviorController and UserNavigationBehaviorController to fit the new patterns.
    • Remove Behavior._on_player_ready event.
    • Update behavior-controller logic relating to returning-to-starting-surface and first-surface-attachment.
    • Add a new ChoreographyBehaviorController.
    • Remove the separate concept of PlayerBehaviorType.
    • Add standard error-handling for failing navigation in BehaviorControllers.
    • Add support for querying BehaviorControllers by name.
    • Add support for configuring whether to return to the original start position or just the position before this behavior.
    • Rename "behavior controller" to "behavior".
    • Fix issues relating to the setup of ReturnBehavior.
    • Fix issues relating to the setup of RunAwayBehavior and CollideBehavior.
    • Update behavior-controllers to consider current and behavior-start surfaces/positions rather than player-start surfaces/positions.
    • Fix issues with ReturnBehavior position.
    • Fix an issue with when the default behavior is activated.
    • Add support for continuing to run after first nav in run-away-behavior.
    • Update Behaviors to update start position/surface during each move, and to use these more-accurate values instead of other state from the player instance.
    • Implement FollowBehavior.
    • Add support for distinguishing between max-distance-from-player-start-position vs max-distance-from-behavior-start-position.
    • Add support for handling reached-max-distance events differently than navigation-failed events.
    • Update duckling to use new FollowBehavior.
    • Fixed some bugs in CollideBehavior.

    • Fixed a bug with initially activating the default behavior.

  • Create and use a standard SpawnPosition system.
    • Update level-logic to use default player creation according to SpawnPositions.
    • Add support for configuring surface-side attachment with SpawnPosition.
    • Add support for configuring surface-attachment when adding players to a level.
    • Add initial-surface-attachment calculations for SurfacerPlayer.
    • Add a hacky work-around in SpawnPosition, so that it doesn’t reference MovementParameters.
      • SpawnPosition is in Scaffolder.
      • Scaffolder shouldn’t reference anything in Surfacer.
      • SpawnPosition supports optionally specifying the surface-attachment direction, which depends on surfacey stuff.
      • I should probably instead sub-class SpawnPosition in Surfacer and only include the surfacey bits in that sub-class, but I don’t have the time at the moment.
    • Rename MovementParams to MovementParameters.
    • Move Time inner-classes out into separate files.
    • Add support for excluding or exclusively-including each SpawnPosition.

      • This makes quick debugging much easier!
A screenshot of the Godot scene editor showing a level with a bunch of different character spawn positions.
Now each player is configured in a level with the new SpawnPosition.
SpawnPosition shows information like the character's initial surface-attachment direction, or whether the player should temporarily be excluded or exclusively included.
  • Brainstorm better approaches to finding a path to a given point.
    • I used to just care about finding the nearest position-along-a-surface.
    • I now care about finding the nearest position-along-a-surface that is also reachable.
    • And I also now care about whether the character would be able to return back to their starting position.
  • Refactor squirrel-away to run as an addon.
    • This means that Squirrel Away can no longer run on its own.
    • It instead must be run within the addons/ folder of a separate project.
    • This makes it a little more convoluted to run on its own.
    • But this makes it easy to also update Squirrel Away source code when making framework changes from another project.
    • But this will make it a lot easier to keep Squirrel Away up-to-date with the latest framework changes!
    • Update READMEs.
    • Update export configurations.
    • Rename some common file/class names, so they don't conflict with those in other apps.
  • Refactor player event-logging.
    • Standardize pre-existing logging statements, so that they go through the standard player log system, and are easily configurable.
    • Add export-property grouping for player logs properties.
    • Use more warning logs.
    • Add support for configuring whether additional types of framework events are logged.
    • Add more timestamps to logs.
    • Create a utility for padding a string with spaces.
    • Add log statements when entering/exiting proximity/collision.
  • Rename things:
    • Rename “player” to “character” throughout the codebase.
    • Rename "computer character" to "npc" throughout the codebase.
    • Rename "human character" to "player character" throughout the codebase.
    • Rename "user" to "player" in some places.
  • Miscellaneous:
    • Create and use a new utility for translating vectors to strings with a given number of significant decimal places.
    • Move some additional navigation state into PlayerNavigationState.
    • Add some additional navigation-state logic for tracking when a state flag just changed.
    • Add support for seeding the random number generator.
    • Add support for configuring a base_path value for file paths across the app.
    • Fix recent-movement-setting save-state.
    • Add support for toggling NPC navigation annotations in settings.
    • Remove support for auto-exclamation-marks on each new nav.
    • Lost almost an entire day dealing with Google bricking my Pixel 3 phone with their latest OS update.

What's next?

  • This week I'll spend most of my time finishing the behavior controller system.
    • There are still a lot of little things to add!

🎉 Cheers!

This is a simple icon representing my sabbatical.