mirror of
https://github.com/genxium/DelayNoMore
synced 2025-10-09 08:36:52 +00:00
Initial attempt integrating online battle.
This commit is contained in:
@@ -25,6 +25,8 @@ const (
|
||||
INPUT_SCALE_FRAMES = uint32(2) // inputDelayedAndScaledFrameId = ((originalFrameId - InputDelayFrames) >> InputScaleFrames)
|
||||
NST_DELAY_FRAMES = int32(16) // network-single-trip delay in the count of render frames, proposed to be (InputDelayFrames >> 1) because we expect a round-trip delay to be exactly "InputDelayFrames"
|
||||
|
||||
SP_ATK_LOOKUP_FRAMES = int32(5)
|
||||
|
||||
SNAP_INTO_PLATFORM_OVERLAP = float64(0.1)
|
||||
SNAP_INTO_PLATFORM_THRESHOLD = float64(0.5)
|
||||
|
||||
@@ -96,7 +98,7 @@ func ShouldPrefabInputFrameDownsync(prevRenderFrameId int32, renderFrameId int32
|
||||
}
|
||||
|
||||
func ShouldGenerateInputFrameUpsync(renderFrameId int32) bool {
|
||||
return ((renderFrameId & ((1 << INPUT_SCALE_FRAMES) - 1)) == 0)
|
||||
return ((renderFrameId & ((1 << INPUT_SCALE_FRAMES) - 1)) == 0)
|
||||
}
|
||||
|
||||
func ConvertToDelayedInputFrameId(renderFrameId int32) int32 {
|
||||
@@ -371,7 +373,7 @@ func calcHardPushbacksNorms(joinIndex int32, playerCollider *resolv.Object, play
|
||||
func deriveOpPattern(currPlayerDownsync, thatPlayerInNextFrame *PlayerDownsync, currRenderFrame *RoomDownsyncFrame, inputsBuffer *RingBuffer) (int, bool, int32, int32) {
|
||||
// returns (patternId, jumpedOrNot, effectiveDx, effectiveDy)
|
||||
delayedInputFrameId := ConvertToDelayedInputFrameId(currRenderFrame.Id)
|
||||
delayedInputFrameIdForPrevRdf := ConvertToDelayedInputFrameId(currRenderFrame.Id-1)
|
||||
delayedInputFrameIdForPrevRdf := ConvertToDelayedInputFrameId(currRenderFrame.Id - 1)
|
||||
|
||||
if 0 >= delayedInputFrameId {
|
||||
return PATTERN_ID_UNABLE_TO_OP, false, 0, 0
|
||||
|
@@ -15,6 +15,7 @@ type CharacterConfig struct {
|
||||
GetUpFrames int32
|
||||
GetUpFramesToRecover int32
|
||||
|
||||
Speed int32
|
||||
JumpingInitVelY int32
|
||||
|
||||
SkillMapper SkillMapperType
|
||||
@@ -34,6 +35,7 @@ var Characters = map[int]*CharacterConfig{
|
||||
GetUpFrames: int32(33),
|
||||
GetUpFramesToRecover: int32(30), // 3 invinsible frames for just-blown-up character to make a comeback
|
||||
|
||||
Speed: int32(float64(1.2) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
JumpingInitVelY: int32(float64(8) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
|
||||
SkillMapper: func(patternId int, currPlayerDownsync *PlayerDownsync) int {
|
||||
@@ -76,6 +78,7 @@ var Characters = map[int]*CharacterConfig{
|
||||
GetUpFrames: int32(30),
|
||||
GetUpFramesToRecover: int32(27), // 3 invinsible frames for just-blown-up character to make a comeback
|
||||
|
||||
Speed: int32(float64(1.4) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
JumpingInitVelY: int32(float64(7.5) * WORLD_TO_VIRTUAL_GRID_RATIO),
|
||||
|
||||
SkillMapper: func(patternId int, currPlayerDownsync *PlayerDownsync) int {
|
||||
|
Reference in New Issue
Block a user