Good thing I could use my project’s gitlab wiki to write this down…
Also a good thing one can set a spoiler tag on it.
Concepts
We will (eventually) have a number of movement speeds:
- Normal movement (which for the enemies would be their patrolling speed)
- Chasing/Attacking
- Fleeing
- Slowed down? (Being injured, being encumbered, searching, …)
So the Mover
script would need to have some concept of what movement state a character is, and the speeds may be absolute numbers, or factors. For example “chasing” is 1.5x normal, “fleeing” might be 2x and being encumbered might be 0.75x or even 0.5x…
The Fighter
calls Move.MoveTo()
when going after an opponent, while regular movement for patrolling (or when returning to the guard post or patrolling path after suspicion runs off) is done by Mover.StartMovementAction()
(which then calls MoveTo()
internally).
So for now all we needed would be
-
StartMovementAction()
setting the base speed value - A wrapper around
MoveTo()
to call when chasing which would set the chasing speed and call the regularMoveTo()
- The
Fighter
calling the new chasing action instead ofMoveTo()
.