somewhat better maybe?

This commit is contained in:
RandomityGuy 2024-05-26 20:52:40 +05:30
parent 0af37dbff8
commit d1dfc3efbd
2 changed files with 14 additions and 4 deletions

View file

@ -1793,6 +1793,10 @@ class Marble extends GameObject {
} else {
this.level.pickUpPowerUp(cast this, this.level.powerUps[p.powerUpId]);
}
if (p.moveQueueSize == 0 && this.connection != null) {
// Pad null move on client
this.connection.moveManager.duplicateLastMove();
}
// if (this.controllable && Net.isClient) {
// // We are client, need to do something about the queue

View file

@ -47,12 +47,12 @@ class MoveManager {
var maxMoves = 45;
var maxSendMoveListSize = 30;
var serverTargetMoveListSize = 3;
var serverMaxMoveListSize = 8;
var serverAvgMoveListSize = 3.0;
var serverTargetMoveListSize = 4;
var serverMaxMoveListSize = 16;
var serverAvgMoveListSize = 4.0;
var serverSmoothMoveAvg = 0.15;
var serverMoveListSizeSlack = 1.5;
var serverDefaultMinTargetMoveListSize = 3;
var serverDefaultMinTargetMoveListSize = 4;
var serverAbnormalMoveCount = 0;
var serverLastRecvMove = 0;
var serverLastAckMove = 0;
@ -144,6 +144,12 @@ class MoveManager {
queuedMoves[to].motionDir.load(queuedMoves[from].motionDir);
}
public inline function duplicateLastMove() {
if (queuedMoves.length == 0)
return;
queuedMoves.insert(0, queuedMoves[0]);
}
public static inline function packMove(m:NetMove, b:OutputBitStream) {
b.writeUInt16(m.id);
b.writeByte(Std.int((m.move.d.x * 16) + 16));