Integrated onwall movements to multiplayer battle.

This commit is contained in:
genxium
2023-01-12 18:09:02 +08:00
parent b1e3d6525c
commit 29e402ea71
15 changed files with 435 additions and 6952 deletions

File diff suppressed because one or more lines are too long

View File

@@ -33,6 +33,8 @@ message PlayerDownsync {
int32 chCollisionTeamId = 25;
bool onWall = 26; // like "inAir", its by design a standalone field only inferred by the collision result of "applyInputFrameDownsyncDynamicsOnSingleRenderFrame" instead of "characterState", because we need check the transition for "characterState" from this field, i.e. "onWall (prev -> curr)"
int32 onWallNormX = 27;
int32 onWallNormY = 28;
string name = 997;
string displayName = 998;

View File

@@ -191,8 +191,8 @@
0,
0,
1,
1.5,
1.5,
1.2,
1.2,
1
]
},
@@ -234,6 +234,9 @@
"controlledCharacterPrefab": {
"__uuid__": "59bff7a2-23e1-4d69-bce7-afb37eae196a"
},
"fireballPrefab": {
"__uuid__": "d92d4831-cd65-4eb5-90bd-b77021aec35b"
},
"joystickInputControllerNode": {
"__id__": 6
},
@@ -268,6 +271,7 @@
"renderFrameIdLagTolerance": 4,
"jigglingEps1D": 0.001,
"bulletTriggerEnabled": true,
"closeOnForcedtoResyncNotSelf": true,
"_id": "d12gkAmppNlIzqcRDELa91"
},
{
@@ -453,7 +457,7 @@
"array": [
0,
0,
215.81269742929726,
216.50635094610968,
0,
0,
0,

View File

@@ -440,7 +440,7 @@
"array": [
0,
0,
209.57814771583418,
216.50635094610968,
0,
0,
0,

View File

@@ -91,10 +91,14 @@ cc.Class({
if (0 > rdfPlayer.DirX) {
this.animNode.scaleX = (-1.0);
} else if (0 < rdfPlayer.DirX) {
this.animNode.scaleX = (1.0);
this.animNode.scaleX = (+1.0);
}
if (ATK_CHARACTER_STATE.OnWall[0] == newCharacterState) {
this.animNode.scaleX *= (-1.0);
if (0 < rdfPlayer.OnWallNormX) {
this.animNode.scaleX = (-1.0);
} else {
this.animNode.scaleX = (+1.0);
}
}
}

View File

@@ -607,7 +607,7 @@ cc.Class({
const jsPlayersArr = new Array(pbRdf.playersArr.length).fill(null);
for (let k = 0; k < pbRdf.playersArr.length; ++k) {
const pbPlayer = pbRdf.playersArr[k];
const jsPlayer = gopkgs.NewPlayerDownsyncJs(pbPlayer.id, pbPlayer.virtualGridX, pbPlayer.virtualGridY, pbPlayer.dirX, pbPlayer.dirY, pbPlayer.velX, pbPlayer.velY, pbPlayer.framesToRecover, pbPlayer.framesInChState, pbPlayer.activeSkillId, pbPlayer.activeSkillHit, pbPlayer.framesInvinsible, pbPlayer.speed, pbPlayer.battleState, pbPlayer.characterState, pbPlayer.joinIndex, pbPlayer.hp, pbPlayer.maxHp, pbPlayer.colliderRadius, pbPlayer.inAir, pbPlayer.onWall, pbPlayer.bulletTeamId, pbPlayer.chCollisionTeamId);
const jsPlayer = gopkgs.NewPlayerDownsyncJs(pbPlayer.id, pbPlayer.virtualGridX, pbPlayer.virtualGridY, pbPlayer.dirX, pbPlayer.dirY, pbPlayer.velX, pbPlayer.velY, pbPlayer.framesToRecover, pbPlayer.framesInChState, pbPlayer.activeSkillId, pbPlayer.activeSkillHit, pbPlayer.framesInvinsible, pbPlayer.speed, pbPlayer.battleState, pbPlayer.characterState, pbPlayer.joinIndex, pbPlayer.hp, pbPlayer.maxHp, pbPlayer.colliderRadius, pbPlayer.inAir, pbPlayer.onWall, pbPlayer.onWallNormX, pbPlayer.onWallNormY, pbPlayer.bulletTeamId, pbPlayer.chCollisionTeamId);
jsPlayersArr[k] = jsPlayer;
}
const jsMeleeBulletsArr = new Array(pbRdf.meleeBullets.length).fill(null);

View File

@@ -29,7 +29,7 @@ cc.Class({
/** Init required prefab ended. */
self.inputFrameUpsyncDelayTolerance = 2;
self.collisionMinStep = 8;
self.collisionMinStep = 2;
self.renderCacheSize = 1024;
self.serverFps = 60;

View File

@@ -1217,6 +1217,8 @@ $root.protos = (function() {
* @property {number|null} [bulletTeamId] PlayerDownsync bulletTeamId
* @property {number|null} [chCollisionTeamId] PlayerDownsync chCollisionTeamId
* @property {boolean|null} [onWall] PlayerDownsync onWall
* @property {number|null} [onWallNormX] PlayerDownsync onWallNormX
* @property {number|null} [onWallNormY] PlayerDownsync onWallNormY
* @property {string|null} [name] PlayerDownsync name
* @property {string|null} [displayName] PlayerDownsync displayName
* @property {string|null} [avatar] PlayerDownsync avatar
@@ -1445,6 +1447,22 @@ $root.protos = (function() {
*/
PlayerDownsync.prototype.onWall = false;
/**
* PlayerDownsync onWallNormX.
* @member {number} onWallNormX
* @memberof protos.PlayerDownsync
* @instance
*/
PlayerDownsync.prototype.onWallNormX = 0;
/**
* PlayerDownsync onWallNormY.
* @member {number} onWallNormY
* @memberof protos.PlayerDownsync
* @instance
*/
PlayerDownsync.prototype.onWallNormY = 0;
/**
* PlayerDownsync name.
* @member {string} name
@@ -1545,6 +1563,10 @@ $root.protos = (function() {
writer.uint32(/* id 25, wireType 0 =*/200).int32(message.chCollisionTeamId);
if (message.onWall != null && Object.hasOwnProperty.call(message, "onWall"))
writer.uint32(/* id 26, wireType 0 =*/208).bool(message.onWall);
if (message.onWallNormX != null && Object.hasOwnProperty.call(message, "onWallNormX"))
writer.uint32(/* id 27, wireType 0 =*/216).int32(message.onWallNormX);
if (message.onWallNormY != null && Object.hasOwnProperty.call(message, "onWallNormY"))
writer.uint32(/* id 28, wireType 0 =*/224).int32(message.onWallNormY);
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
writer.uint32(/* id 997, wireType 2 =*/7978).string(message.name);
if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
@@ -1689,6 +1711,14 @@ $root.protos = (function() {
message.onWall = reader.bool();
break;
}
case 27: {
message.onWallNormX = reader.int32();
break;
}
case 28: {
message.onWallNormY = reader.int32();
break;
}
case 997: {
message.name = reader.string();
break;
@@ -1814,6 +1844,12 @@ $root.protos = (function() {
if (message.onWall != null && message.hasOwnProperty("onWall"))
if (typeof message.onWall !== "boolean")
return "onWall: boolean expected";
if (message.onWallNormX != null && message.hasOwnProperty("onWallNormX"))
if (!$util.isInteger(message.onWallNormX))
return "onWallNormX: integer expected";
if (message.onWallNormY != null && message.hasOwnProperty("onWallNormY"))
if (!$util.isInteger(message.onWallNormY))
return "onWallNormY: integer expected";
if (message.name != null && message.hasOwnProperty("name"))
if (!$util.isString(message.name))
return "name: string expected";
@@ -1890,6 +1926,10 @@ $root.protos = (function() {
message.chCollisionTeamId = object.chCollisionTeamId | 0;
if (object.onWall != null)
message.onWall = Boolean(object.onWall);
if (object.onWallNormX != null)
message.onWallNormX = object.onWallNormX | 0;
if (object.onWallNormY != null)
message.onWallNormY = object.onWallNormY | 0;
if (object.name != null)
message.name = String(object.name);
if (object.displayName != null)
@@ -1939,6 +1979,8 @@ $root.protos = (function() {
object.bulletTeamId = 0;
object.chCollisionTeamId = 0;
object.onWall = false;
object.onWallNormX = 0;
object.onWallNormY = 0;
object.name = "";
object.displayName = "";
object.avatar = "";
@@ -1995,6 +2037,10 @@ $root.protos = (function() {
object.chCollisionTeamId = message.chCollisionTeamId;
if (message.onWall != null && message.hasOwnProperty("onWall"))
object.onWall = message.onWall;
if (message.onWallNormX != null && message.hasOwnProperty("onWallNormX"))
object.onWallNormX = message.onWallNormX;
if (message.onWallNormY != null && message.hasOwnProperty("onWallNormY"))
object.onWallNormY = message.onWallNormY;
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.displayName != null && message.hasOwnProperty("displayName"))