mirror of
https://github.com/genxium/DelayNoMore
synced 2025-10-09 08:36:52 +00:00
Added TurnAroundFramesToRecover.
This commit is contained in:
@@ -631,20 +631,34 @@ func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(inputsBuffer *RingBuffer
|
||||
}
|
||||
|
||||
if 0 == currPlayerDownsync.FramesToRecover {
|
||||
isWallJumping := (currPlayerDownsync.Speed < intAbs(currPlayerDownsync.VelX))
|
||||
/*
|
||||
if isWallJumping {
|
||||
fmt.Printf("joinIndex=%d is wall jumping\n{renderFrame.id: %d, currPlayerDownsync.Speed: %d, currPlayerDownsync.VelX: %d}\n", currPlayerDownsync.JoinIndex, currRenderFrame.Id, currPlayerDownsync.Speed, currPlayerDownsync.VelX)
|
||||
}
|
||||
*/
|
||||
if 0 != effDx {
|
||||
xfac := int32(1)
|
||||
if 0 > effDx {
|
||||
xfac = -xfac
|
||||
}
|
||||
thatPlayerInNextFrame.DirX = effDx
|
||||
thatPlayerInNextFrame.DirY = effDy
|
||||
if !isWallJumping && 0 > effDx*thatPlayerInNextFrame.DirX {
|
||||
// [WARNING] A "turn-around", or in more generic direction schema a "change in direction" is a hurdle for our current "prediction+rollback" approach, yet applying a "FramesToRecover" for "turn-around" can alleviate the graphical inconsistence to a huge extent! For better operational experience, this is intentionally NOT APPLIED TO WALL JUMPING!
|
||||
thatPlayerInNextFrame.DirX = effDx
|
||||
thatPlayerInNextFrame.VelX = 0
|
||||
thatPlayerInNextFrame.FramesToRecover = chConfig.TurnAroundFramesToRecover
|
||||
} else {
|
||||
xfac := int32(1)
|
||||
if 0 > effDx {
|
||||
xfac = -xfac
|
||||
}
|
||||
thatPlayerInNextFrame.DirX = effDx
|
||||
thatPlayerInNextFrame.DirY = effDy
|
||||
|
||||
thatPlayerInNextFrame.VelX = xfac * currPlayerDownsync.Speed
|
||||
if intAbs(thatPlayerInNextFrame.VelX) < intAbs(currPlayerDownsync.VelX) {
|
||||
// Wall jumping
|
||||
thatPlayerInNextFrame.VelX = xfac * intAbs(currPlayerDownsync.VelX)
|
||||
if isWallJumping {
|
||||
//fmt.Printf("joinIndex=%d is controlling while wall jumping\n{renderFrame.id: %d, currPlayerDownsync.Speed: %d, currPlayerDownsync.VelX: %d, effDx: %d}\n", currPlayerDownsync.JoinIndex, currRenderFrame.Id, currPlayerDownsync.Speed, currPlayerDownsync.VelX, effDx)
|
||||
thatPlayerInNextFrame.VelX = xfac * intAbs(currPlayerDownsync.VelX)
|
||||
} else {
|
||||
thatPlayerInNextFrame.VelX = xfac * currPlayerDownsync.Speed
|
||||
}
|
||||
thatPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_WALKING
|
||||
}
|
||||
thatPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_WALKING
|
||||
} else {
|
||||
thatPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_IDLE1
|
||||
thatPlayerInNextFrame.VelX = 0
|
||||
|
@@ -15,8 +15,9 @@ type CharacterConfig struct {
|
||||
GetUpInvinsibleFrames int32
|
||||
GetUpFramesToRecover int32
|
||||
|
||||
Speed int32
|
||||
JumpingInitVelY int32
|
||||
Speed int32
|
||||
JumpingInitVelY int32
|
||||
JumpingFramesToRecover int32 // Not used yet
|
||||
|
||||
DashingEnabled bool
|
||||
OnWallEnabled bool
|
||||
@@ -25,6 +26,8 @@ type CharacterConfig struct {
|
||||
WallJumpingInitVelY int32
|
||||
WallSlidingVelY int32
|
||||
|
||||
TurnAroundFramesToRecover int32
|
||||
|
||||
SkillMapper SkillMapperType
|
||||
}
|
||||
|
||||
@@ -42,8 +45,11 @@ var Characters = map[int]*CharacterConfig{
|
||||
GetUpInvinsibleFrames: int32(10),
|
||||
GetUpFramesToRecover: int32(27),
|
||||
|
||||
Speed: int32(float64(2.0) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
JumpingInitVelY: int32(float64(8) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
Speed: int32(float64(2.5) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
JumpingInitVelY: int32(float64(8) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
JumpingFramesToRecover: int32(2),
|
||||
|
||||
TurnAroundFramesToRecover: int32(4),
|
||||
|
||||
DashingEnabled: false,
|
||||
OnWallEnabled: false,
|
||||
@@ -88,13 +94,16 @@ var Characters = map[int]*CharacterConfig{
|
||||
GetUpInvinsibleFrames: int32(10),
|
||||
GetUpFramesToRecover: int32(27),
|
||||
|
||||
Speed: int32(float64(2.0) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
JumpingInitVelY: int32(float64(7.5) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
Speed: int32(float64(2.6) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
JumpingInitVelY: int32(float64(7.5) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
JumpingFramesToRecover: int32(2),
|
||||
|
||||
TurnAroundFramesToRecover: int32(4),
|
||||
|
||||
DashingEnabled: true,
|
||||
OnWallEnabled: true,
|
||||
WallJumpingFramesToRecover: int32(9), // 8 would be the minimum for an avg human
|
||||
WallJumpingInitVelX: int32(float64(2.5) * WORLD_TO_VIRTUAL_GRID_RATIO), // Default is "appeared facing right", but actually holding ctrl against left
|
||||
WallJumpingFramesToRecover: int32(8), // 8 would be the minimum for an avg human
|
||||
WallJumpingInitVelX: int32(float64(2.8) * WORLD_TO_VIRTUAL_GRID_RATIO), // Default is "appeared facing right", but actually holding ctrl against left
|
||||
WallJumpingInitVelY: int32(float64(7) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
WallSlidingVelY: int32(float64(-1) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
|
||||
@@ -138,8 +147,11 @@ var Characters = map[int]*CharacterConfig{
|
||||
GetUpInvinsibleFrames: int32(8),
|
||||
GetUpFramesToRecover: int32(30),
|
||||
|
||||
Speed: int32(float64(1.9) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
JumpingInitVelY: int32(float64(7.5) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
Speed: int32(float64(2.0) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
JumpingInitVelY: int32(float64(7.5) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
JumpingFramesToRecover: int32(2),
|
||||
|
||||
TurnAroundFramesToRecover: int32(4),
|
||||
|
||||
DashingEnabled: false,
|
||||
OnWallEnabled: false,
|
||||
|
Reference in New Issue
Block a user