-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sliding NPCs by adding a replay cache for animations
Having a single `LatestAction` wasn't enough to bring Actors into a correct animation state. Now non-cell-owners (aka party members) will replay recent actions when an Actor is spawned in their world
- Loading branch information
Showing
8 changed files
with
325 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
#include <Game/AnimationEventLists.h> | ||
|
||
/* | ||
/* The lists here may not contain all relevant animation events, so extend as necessary | ||
*/ | ||
|
||
const Set<String> AnimationEventLists::g_actionsStart = { | ||
{"moveStart"}, | ||
{"bowAttackStart"}, | ||
{"blockStart"}, | ||
{"staggerStart"}, | ||
{"staggerIdleStart"}, | ||
{"shoutStart"}, | ||
{"SwimStart"}, | ||
{"SneakStart"}, | ||
{"torchEquip"}, | ||
{"blockHitStart"}, | ||
{"bleedOutStart"}, | ||
{"blockAnticipateStart"}, | ||
{"HorseEnter"}, | ||
{"HorseEnterInstant"}, | ||
{"HorseEnterSwim"}, | ||
{"MountedSwimStart"}, | ||
{"ChairLookDownEnterInstant"}, | ||
{"RagdollInstant"}, | ||
// Idle animations | ||
{"IdleAlchemyEnter"}, | ||
{"IdleBarDrinkingStart"}, | ||
{"IdleBedEnterInstant"}, | ||
{"IdleBedEnterStart"}, | ||
{"IdleBedLeftEnterInstant"}, | ||
{"IdleBedLeftEnterStart"}, | ||
{"IdleBedRightEnterInstant"}, | ||
{"IdleBedRightEnterStart"}, | ||
{"IdleBedRollFrontEnterInstant"}, | ||
{"IdleBedRollFrontEnterStart"}, | ||
{"IdleBedRollLeftEnterInstant"}, | ||
{"IdleBedRollLeftEnterStart"}, | ||
{"IdleBedRollRightEnterInstant"}, | ||
{"IdleBedRollRightEnterStart"}, | ||
{"IdleBeggar"}, | ||
{"IdleBlacksmithForgeEnter"}, | ||
{"IdleBlackSmithingEnterInstant"}, | ||
{"IdleBlackSmithingEnterStart"}, | ||
{"IdleBoundKneesStart"}, | ||
{"IdleCarryBucketFillEnter"}, | ||
{"IdleCarryBucketPourEnter"}, | ||
{"IdleCartBenchEnter"}, | ||
{"IdleCartBenchEnterInstant"}, | ||
{"IdleChairEnterInstant"}, | ||
{"IdleChairEnterStart"}, | ||
{"IdleChairEnterToSit"}, | ||
{"IdleChairFrontEnter"}, | ||
{"IdleChairLeftEnter"}, | ||
{"IdleChairRightEnter"}, | ||
{"IdleCombatShieldStart"}, | ||
{"IdleCombatStart"}, | ||
{"IdleCookingSpitEnter"}, | ||
{"IdleCounterStart"}, | ||
{"IdleDialogueAngryStart"}, | ||
{"IdleDialogueExpressiveStart"}, | ||
{"IdleDialogueHappyStart"}, | ||
{"idleDrinkingStandingStart"}, | ||
{"IdleDrumStart"}, | ||
{"idleEatingStandingStart"}, | ||
{"IdleEnchantingEnter"}, | ||
{"IdleFluteStart"}, | ||
{"IdleFurnitureStart"}, | ||
{"IdleGetAttention"}, | ||
{"IdleHammerTableEnter"}, | ||
{"IdleHammerTableEnterInstant"}, | ||
{"IdleHammerWallEnter"}, | ||
{"IdleHammerWallEnterInstant"}, | ||
{"IdleHideLEnter"}, | ||
{"IdleHideREnter"}, | ||
{"IdleJarlChairEnter"}, | ||
{"IdleJarlChairEnterInstant"}, | ||
{"IdleLadderEnter"}, | ||
{"IdleLadderEnterInstant"}, | ||
{"IdleLayDownEnter"}, | ||
{"IdleLayDownEnterInstant"}, | ||
{"IdleLeanTable"}, | ||
{"IdleLeanTableEnter"}, | ||
{"IdleLeanTableEnterInstant"}, | ||
{"IdleLeftChairEnterStart"}, | ||
{"IdleLeverPushStart"}, | ||
{"idleLooseSweepingStart"}, | ||
{"IdleLuteStart"}, | ||
{"IdleMillLoadStart"}, | ||
{"IdlePickaxeEnter"}, | ||
{"IdlePickaxeEnterInstant"}, | ||
{"IdlePickaxeFloorEnter"}, | ||
{"IdlePickaxeTableEnter"}, | ||
{"IdleReadElderScrollStart"}, | ||
{"IdleRightChairEnterStart"}, | ||
{"IdleSearchingChest"}, | ||
{"IdleSearchingTable"}, | ||
{"IdleSharpeningWheelStart"}, | ||
{"IdleSitCrossLeggedEnter"}, | ||
{"IdleSitCrossLeggedEnterInstant"}, | ||
{"IdleSitLedge"}, | ||
{"IdleSitLedge_Enter"}, | ||
{"IdleSitLedgeEnter"}, | ||
{"IdleSitLedgeEnterInstant"}, | ||
{"IdleStoolEnter"}, | ||
{"IdleStoolEnterInstant"}, | ||
{"IdleTableEnter"}, | ||
{"IdleTableEnterInstant"}, | ||
{"IdleTanningEnter"}, | ||
{"IdleWallLeanStart"}, | ||
{"IdleWarmHands"}, | ||
{"IdleWebEnterInstant"}, | ||
{"IdleWoodChopStart"}, | ||
{"IdleWoodPickUpEnter"}, | ||
{"IdleWoodPickUpEnterInstant"}, | ||
{"IdleChairCHILDEnterInstant"}, | ||
{"IdleChairCHILDFrontEnter"}, | ||
{"IdleChairCHILDLeftEnter"}, | ||
{"IdleChairCHILDRightEnter"}, | ||
}; | ||
|
||
const Set<String> AnimationEventLists::g_actionsExit = { | ||
{"IdleForceDefaultState"}, // Belongs here too | ||
{"BleedOutEarlyExit"}, | ||
{"HorseExit"}, | ||
{"IdleChairExitToStand"}, | ||
{"IdleChairFrontExit"}, | ||
{"idleChairLeftExit"}, | ||
{"idleChairRightExit"}, | ||
{"IdleBedExitToStand"}, | ||
{"IdleCartPrisonerAExit"}, | ||
{"IdleFurnitureExit"}, | ||
{"IdleLaydown_Exit"}, | ||
{"IdleLounge_Exit"}, | ||
{"IdleRailLeanExit"}, | ||
{"IdleSitLedge_Exit"}, | ||
{"IdleStoolBackExit"}, | ||
{"IdleTableBackExit"}, | ||
{"IdleWebExit"}, | ||
{"IdleChairExitStart"}, | ||
{"IdleBedExitStart"}, | ||
{"IdleBedLeftExitStart"}, | ||
{"IdleBedRightExitStart"}, | ||
{"IdleBedRollFrontExitStart"}, | ||
{"IdleBedRollLeftExitStart"}, | ||
{"IdleBedRollRightExitStart"}, | ||
{"IdleChairCHILDFrontExit"}, | ||
{"IdleChairCHILDLeftExit"}, | ||
{"IdleChairCHILDRightExit"}, | ||
}; | ||
|
||
// Skip these in the loop when searching for a valid animation chain start | ||
const Set<String> AnimationEventLists::g_actionsSkipIntermediate = { | ||
{"attackStart"}, | ||
{"turnStop"}, | ||
{"moveStop"}, | ||
{"WeapEquip"}, | ||
{"SprintStart"}, | ||
{"SprintStop"}, | ||
{"CyclicFreeze"}, | ||
{"CyclicCrossBlend"}, | ||
{"IdleStop"}, | ||
{"IdleStopInstant"}, | ||
{"IdleHDLeft"}, | ||
{"IdleHDLeftAngry"}, | ||
{"IdleHDRight"}, | ||
{"IdleHDRightAngry"}, | ||
{"MotionDrivenIdle"}, | ||
{"torchUnequip"}, | ||
}; | ||
|
||
const Set<String> AnimationEventLists::g_actionsIgnore = { | ||
// Animation events with empty names don't carry anything useful besides | ||
// various animvars updates and state changes to the running animations. | ||
// Ignored because there is too many of them on each frame | ||
{""}, | ||
{"TurnLeft"}, | ||
{"TurnRight"}, | ||
{"NPC_TurnLeft180"}, | ||
{"NPC_TurnLeft90"}, | ||
{"NPC_TurnRight180"}, | ||
{"NPC_TurnRight90"}, | ||
{"NPC_TurnToWalkLeft180"}, | ||
{"NPC_TurnToWalkLeft90"}, | ||
{"NPC_TurnToWalkRight180"}, | ||
{"NPC_TurnToWalkRight90"}, | ||
// There's an elusive bug on the client where it would spam "Unequip" | ||
// and "combatStanceStop" a lot after changing cells | ||
{"Unequip"}, | ||
{"combatStanceStop"}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
#include <TiltedCore/Stl.hpp> | ||
|
||
using TiltedPhoques::Set, TiltedPhoques::String; | ||
|
||
namespace AnimationEventLists | ||
{ | ||
extern const Set<String> g_actionsStart; | ||
|
||
extern const Set<String> g_actionsExit; | ||
|
||
extern const Set<String> g_actionsSkipIntermediate; | ||
|
||
extern const Set<String> g_actionsIgnore; | ||
} // namespace |
Oops, something went wrong.