Enhanced pre-battle start GUI.

This commit is contained in:
genxium 2023-02-13 10:34:56 +08:00
parent 2751569e0c
commit 62c51b1838
12 changed files with 528 additions and 222 deletions

View File

@ -25,19 +25,22 @@
}, },
{ {
"__id__": 68 "__id__": 68
},
{
"__id__": 76
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 76 "__id__": 79
}, },
{ {
"__id__": 77 "__id__": 80
} }
], ],
"_prefab": { "_prefab": {
"__id__": 78 "__id__": 81
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -2899,6 +2902,115 @@
"fileId": "c54lqSflFD8ogSYAhsAkKh", "fileId": "c54lqSflFD8ogSYAhsAkKh",
"sync": false "sync": false
}, },
{
"__type__": "cc.Node",
"_name": "Loading",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 77
}
],
"_prefab": {
"__id__": 78
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 42,
"height": 46
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-206.37,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 76
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "350fd890-3d28-4e53-9dfa-1bf00d857737"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109"
},
"fileId": "8d0LdBGuhBm5FVth4Dua8p",
"sync": false
},
{ {
"__type__": "dd92bKVy8FJY7uq3ieoNZCZ", "__type__": "dd92bKVy8FJY7uq3ieoNZCZ",
"_name": "", "_name": "",
@ -2923,6 +3035,9 @@
} }
], ],
"chosenSpeciesId": 0, "chosenSpeciesId": 0,
"loadingNode": {
"__id__": 76
},
"_id": "" "_id": ""
}, },
{ {

View File

@ -88,7 +88,7 @@
"__id__": 1 "__id__": 1
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 3 "__id__": 3

View File

@ -77,12 +77,6 @@
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 49
},
{
"__id__": 50
},
{ {
"__id__": 51 "__id__": 51
}, },
@ -91,6 +85,12 @@
}, },
{ {
"__id__": 53 "__id__": 53
},
{
"__id__": 54
},
{
"__id__": 55
} }
], ],
"_prefab": null, "_prefab": null,
@ -244,10 +244,10 @@
"__uuid__": "670b477e-61a1-4778-879b-35913f7c79d2" "__uuid__": "670b477e-61a1-4778-879b-35913f7c79d2"
}, },
"boundRoomIdLabel": { "boundRoomIdLabel": {
"__id__": 26 "__id__": 28
}, },
"countdownLabel": { "countdownLabel": {
"__id__": 33 "__id__": 35
}, },
"resultPanelPrefab": { "resultPanelPrefab": {
"__uuid__": "c4cfe3bd-c59e-4d5b-95cb-c933b120e184" "__uuid__": "c4cfe3bd-c59e-4d5b-95cb-c933b120e184"
@ -261,26 +261,26 @@
"countdownToBeginGamePrefab": { "countdownToBeginGamePrefab": {
"__uuid__": "230eeb1f-e0f9-4a41-ab6c-05b3771cbf3e" "__uuid__": "230eeb1f-e0f9-4a41-ab6c-05b3771cbf3e"
}, },
"playersInfoPrefab": {
"__uuid__": "b4e519f4-e698-4403-9ff2-47b8dacb077e"
},
"forceBigEndianFloatingNumDecoding": false, "forceBigEndianFloatingNumDecoding": false,
"renderFrameIdLagTolerance": 4, "renderFrameIdLagTolerance": 4,
"sendingQLabel": { "inputFrameFrontLabel": {
"__id__": 13 "__id__": 13
}, },
"inputFrameDownsyncQLabel": { "sendingQLabel": {
"__id__": 15 "__id__": 15
}, },
"peerInputFrameUpsyncQLabel": { "inputFrameDownsyncQLabel": {
"__id__": 17 "__id__": 17
}, },
"rollbackFramesLabel": { "peerInputFrameUpsyncQLabel": {
"__id__": 19 "__id__": 19
}, },
"skippedRenderFrameCntLabel": { "rollbackFramesLabel": {
"__id__": 21 "__id__": 21
}, },
"skippedRenderFrameCntLabel": {
"__id__": 23
},
"_id": "d12gkAmppNlIzqcRDELa91" "_id": "d12gkAmppNlIzqcRDELa91"
}, },
{ {
@ -292,13 +292,13 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 43 "__id__": 45
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 48 "__id__": 50
} }
], ],
"_prefab": null, "_prefab": null,
@ -360,20 +360,20 @@
{ {
"__id__": 6 "__id__": 6
}, },
{
"__id__": 32
},
{ {
"__id__": 34 "__id__": 34
}, },
{ {
"__id__": 38 "__id__": 36
},
{
"__id__": 40
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 42 "__id__": 44
} }
], ],
"_prefab": null, "_prefab": null,
@ -442,7 +442,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 31 "__id__": 33
} }
], ],
"_prefab": null, "_prefab": null,
@ -536,7 +536,7 @@
"array": [ "array": [
0, 0,
0, 0,
216.50635094610968, 216.65450766436658,
0, 0,
0, 0,
0, 0,
@ -620,15 +620,18 @@
}, },
{ {
"__id__": 22 "__id__": 22
},
{
"__id__": 24
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 29 "__id__": 31
}, },
{ {
"__id__": 30 "__id__": 32
} }
], ],
"_prefab": null, "_prefab": null,
@ -681,7 +684,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "sendingQ", "_name": "inputFrameFront",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 11 "__id__": 11
@ -739,7 +742,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "ack7XH+0lEj6chSUsKBLU5" "_id": "83n6IAj9tAkop6CA/MyM0A"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
@ -771,11 +774,11 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "deCJfLuoFO36c/O4lXWJ1N" "_id": "a4CfeVmexNm7nULcCRHcVl"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "inputFrameDownsyncQ", "_name": "sendingQ",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 11 "__id__": 11
@ -833,7 +836,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "d9n+NRm9pA0YtKxvy4bW+U" "_id": "ack7XH+0lEj6chSUsKBLU5"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
@ -865,11 +868,11 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "90NvjGFrpBFqqzl1WZczta" "_id": "deCJfLuoFO36c/O4lXWJ1N"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "peerInputFrameUpsyncQ", "_name": "inputFrameDownsyncQ",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 11 "__id__": 11
@ -927,7 +930,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "45FAmgRLZNNbLt/GcnTXVx" "_id": "d9n+NRm9pA0YtKxvy4bW+U"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
@ -959,11 +962,11 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "42PRTrjEpDw6Z8N5yWFTpd" "_id": "90NvjGFrpBFqqzl1WZczta"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "rollbackFrames", "_name": "peerInputFrameUpsyncQ",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 11 "__id__": 11
@ -1021,7 +1024,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "f5SBs3b1pPNbHbnqVLYsHp" "_id": "45FAmgRLZNNbLt/GcnTXVx"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
@ -1053,11 +1056,11 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "77aNARt1VATLsjIzwbqvkh" "_id": "42PRTrjEpDw6Z8N5yWFTpd"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "skippedCnt", "_name": "rollbackFrames",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 11 "__id__": 11
@ -1073,9 +1076,9 @@
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 243, "r": 255,
"g": 225, "g": 255,
"b": 11, "b": 255,
"a": 255 "a": 255
}, },
"_contentSize": { "_contentSize": {
@ -1115,7 +1118,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "cdlF8Z8TZEdLRHQQ8T8qX7" "_id": "f5SBs3b1pPNbHbnqVLYsHp"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
@ -1147,6 +1150,100 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "77aNARt1VATLsjIzwbqvkh"
},
{
"__type__": "cc.Node",
"_name": "skippedCnt",
"_objFlags": 0,
"_parent": {
"__id__": 11
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 243,
"g": 225,
"b": 11,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 18.33,
"height": 22.61
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-24.355000000000018,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "cdlF8Z8TZEdLRHQQ8T8qX7"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_useOriginalSize": false,
"_string": "0",
"_N$string": "0",
"_fontSize": 22,
"_lineHeight": 37,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "a564b3db-b8cb-48b4-952e-25bb56949116"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_N$horizontalAlign": 0,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "2flWrlaK1PeJMUB/in+S1W" "_id": "2flWrlaK1PeJMUB/in+S1W"
}, },
{ {
@ -1158,19 +1255,19 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 23 "__id__": 25
}, },
{ {
"__id__": 25 "__id__": 27
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 27 "__id__": 29
}, },
{ {
"__id__": 28 "__id__": 30
} }
], ],
"_prefab": null, "_prefab": null,
@ -1226,13 +1323,13 @@
"_name": "label", "_name": "label",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 22 "__id__": 24
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 24 "__id__": 26
} }
], ],
"_prefab": null, "_prefab": null,
@ -1288,7 +1385,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 23 "__id__": 25
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
@ -1316,13 +1413,13 @@
"_name": "BoundRoomIdLabel", "_name": "BoundRoomIdLabel",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 22 "__id__": 24
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 26 "__id__": 28
} }
], ],
"_prefab": null, "_prefab": null,
@ -1378,7 +1475,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 25 "__id__": 27
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
@ -1406,7 +1503,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 22 "__id__": 24
}, },
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
@ -1439,7 +1536,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 22 "__id__": 24
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
@ -1561,7 +1658,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 33 "__id__": 35
} }
], ],
"_prefab": null, "_prefab": null,
@ -1617,7 +1714,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 32 "__id__": 34
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1651,7 +1748,7 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 35 "__id__": 37
} }
], ],
"_active": true, "_active": true,
@ -1709,16 +1806,16 @@
"_name": "Background", "_name": "Background",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 34 "__id__": 36
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 36 "__id__": 38
}, },
{ {
"__id__": 37 "__id__": 39
} }
], ],
"_prefab": null, "_prefab": null,
@ -1774,7 +1871,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 35 "__id__": 37
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1808,7 +1905,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 35 "__id__": 37
}, },
"_enabled": true, "_enabled": true,
"alignMode": 0, "alignMode": 0,
@ -1839,7 +1936,7 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 39 "__id__": 41
} }
], ],
"_active": true, "_active": true,
@ -1897,16 +1994,16 @@
"_name": "Background", "_name": "Background",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 38 "__id__": 40
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 40 "__id__": 42
}, },
{ {
"__id__": 41 "__id__": 43
} }
], ],
"_prefab": null, "_prefab": null,
@ -1962,7 +2059,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 39 "__id__": 41
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1996,7 +2093,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 39 "__id__": 41
}, },
"_enabled": true, "_enabled": true,
"alignMode": 0, "alignMode": 0,
@ -2054,16 +2151,16 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 44 "__id__": 46
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 46 "__id__": 48
}, },
{ {
"__id__": 47 "__id__": 49
} }
], ],
"_prefab": null, "_prefab": null,
@ -2119,13 +2216,13 @@
"_name": "Joystick", "_name": "Joystick",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 43 "__id__": 45
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 45 "__id__": 47
} }
], ],
"_prefab": null, "_prefab": null,
@ -2181,7 +2278,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 44 "__id__": 46
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2215,7 +2312,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 43 "__id__": 45
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2249,7 +2346,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 43 "__id__": 45
}, },
"_enabled": true, "_enabled": true,
"alignMode": 0, "alignMode": 0,
@ -2384,10 +2481,10 @@
"__id__": 3 "__id__": 3
}, },
"stickhead": { "stickhead": {
"__id__": 44 "__id__": 46
}, },
"base": { "base": {
"__id__": 43 "__id__": 45
}, },
"joyStickEps": 0.1, "joyStickEps": 0.1,
"magicLeanLowerBound": 0.414, "magicLeanLowerBound": 0.414,
@ -2408,10 +2505,10 @@
"linearMovingEps": 0.1, "linearMovingEps": 0.1,
"scaleByEps": 0.0375, "scaleByEps": 0.0375,
"btnA": { "btnA": {
"__id__": 34 "__id__": 36
}, },
"btnB": { "btnB": {
"__id__": 38 "__id__": 40
}, },
"_id": "e9oVYTr7ROlpp/IrNjBUmR" "_id": "e9oVYTr7ROlpp/IrNjBUmR"
} }

View File

@ -461,7 +461,7 @@
"array": [ "array": [
0, 0,
0, 0,
210.59754059453806, 216.65450766436658,
0, 0,
0, 0,
0, 0,

View File

@ -77,12 +77,6 @@
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 49
},
{
"__id__": 50
},
{ {
"__id__": 51 "__id__": 51
}, },
@ -91,6 +85,12 @@
}, },
{ {
"__id__": 53 "__id__": 53
},
{
"__id__": 54
},
{
"__id__": 55
} }
], ],
"_prefab": null, "_prefab": null,
@ -276,21 +276,23 @@
"gameRulePrefab": null, "gameRulePrefab": null,
"findingPlayerPrefab": null, "findingPlayerPrefab": null,
"countdownToBeginGamePrefab": null, "countdownToBeginGamePrefab": null,
"playersInfoPrefab": null,
"forceBigEndianFloatingNumDecoding": false, "forceBigEndianFloatingNumDecoding": false,
"renderFrameIdLagTolerance": 4, "renderFrameIdLagTolerance": 4,
"sendingQLabel": { "inputFrameFrontLabel": {
"__id__": 14 "__id__": 14
}, },
"inputFrameDownsyncQLabel": { "sendingQLabel": {
"__id__": 16 "__id__": 16
}, },
"peerInputFrameUpsyncQLabel": { "inputFrameDownsyncQLabel": {
"__id__": 18 "__id__": 18
}, },
"rollbackFramesLabel": { "peerInputFrameUpsyncQLabel": {
"__id__": 20 "__id__": 20
}, },
"rollbackFramesLabel": {
"__id__": 22
},
"skippedRenderFrameCntLabel": null, "skippedRenderFrameCntLabel": null,
"_id": "e5xQdv12xLoIRr0b36Pie+" "_id": "e5xQdv12xLoIRr0b36Pie+"
}, },
@ -303,13 +305,13 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 43 "__id__": 45
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 48 "__id__": 50
} }
], ],
"_prefab": null, "_prefab": null,
@ -371,20 +373,20 @@
{ {
"__id__": 7 "__id__": 7
}, },
{
"__id__": 32
},
{ {
"__id__": 34 "__id__": 34
}, },
{ {
"__id__": 38 "__id__": 36
},
{
"__id__": 40
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 42 "__id__": 44
} }
], ],
"_prefab": null, "_prefab": null,
@ -453,7 +455,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 31 "__id__": 33
} }
], ],
"_prefab": null, "_prefab": null,
@ -547,7 +549,7 @@
"array": [ "array": [
0, 0,
0, 0,
209.61049002258042, 216.65450766436658,
0, 0,
0, 0,
0, 0,
@ -631,12 +633,15 @@
}, },
{ {
"__id__": 23 "__id__": 23
},
{
"__id__": 25
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 30 "__id__": 32
} }
], ],
"_prefab": null, "_prefab": null,
@ -689,7 +694,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "sendingQ", "_name": "inputFrameFront",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 12 "__id__": 12
@ -725,7 +730,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
76.48, 79.66666666666667,
0, 0,
0, 0,
0, 0,
@ -747,7 +752,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "6fOGsdJxxKMLM7+K16V2wq" "_id": "16ecz642FAMIrtMtKWTI/3"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
@ -777,11 +782,11 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "38SxePoOdHT4wrqnMdR0ql" "_id": "e2W8Kja+VG7IEwuBQapscC"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "inputFrameDownsyncQ", "_name": "sendingQ",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 12 "__id__": 12
@ -817,7 +822,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
38.239999999999995, 47.8,
0, 0,
0, 0,
0, 0,
@ -839,7 +844,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "c7OaUtV+9JaL4UcCC0gp8r" "_id": "6fOGsdJxxKMLM7+K16V2wq"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
@ -869,11 +874,11 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "e22YW/mxlPRoYkJwMCezpE" "_id": "38SxePoOdHT4wrqnMdR0ql"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "peerInputFrameUpsyncQ", "_name": "inputFrameDownsyncQ",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 12 "__id__": 12
@ -909,7 +914,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
-7.105427357601002e-15, 15.933333333333325,
0, 0,
0, 0,
0, 0,
@ -931,7 +936,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "3fAMol6MJN+IHH1Ckh13wR" "_id": "c7OaUtV+9JaL4UcCC0gp8r"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
@ -961,11 +966,11 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "3dO5iM/4VHVb21M3X82p0z" "_id": "e22YW/mxlPRoYkJwMCezpE"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "rollbackFrames", "_name": "peerInputFrameUpsyncQ",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 12 "__id__": 12
@ -1001,7 +1006,99 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
-38.24000000000001, -15.933333333333346,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3fAMol6MJN+IHH1Ckh13wR"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 19
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_useOriginalSize": false,
"_string": "0",
"_N$string": "0",
"_fontSize": 22,
"_lineHeight": 23,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_N$horizontalAlign": 0,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "3dO5iM/4VHVb21M3X82p0z"
},
{
"__type__": "cc.Node",
"_name": "rollbackFrames",
"_objFlags": 0,
"_parent": {
"__id__": 12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 22
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 12.24,
"height": 28.98
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-47.80000000000002,
0, 0,
0, 0,
0, 0,
@ -1030,7 +1127,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 19 "__id__": 21
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1066,7 +1163,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 22 "__id__": 24
} }
], ],
"_prefab": null, "_prefab": null,
@ -1093,7 +1190,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
-76.48000000000002, -79.66666666666669,
0, 0,
0, 0,
0, 0,
@ -1122,7 +1219,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 21 "__id__": 23
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1158,19 +1255,19 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 24 "__id__": 26
}, },
{ {
"__id__": 26 "__id__": 28
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 28 "__id__": 30
}, },
{ {
"__id__": 29 "__id__": 31
} }
], ],
"_prefab": null, "_prefab": null,
@ -1226,13 +1323,13 @@
"_name": "label", "_name": "label",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 23 "__id__": 25
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 25 "__id__": 27
} }
], ],
"_prefab": null, "_prefab": null,
@ -1288,7 +1385,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 24 "__id__": 26
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
@ -1316,13 +1413,13 @@
"_name": "BoundRoomIdLabel", "_name": "BoundRoomIdLabel",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 23 "__id__": 25
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 27 "__id__": 29
} }
], ],
"_prefab": null, "_prefab": null,
@ -1378,7 +1475,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 26 "__id__": 28
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
@ -1406,7 +1503,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 23 "__id__": 25
}, },
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
@ -1439,7 +1536,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 23 "__id__": 25
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
@ -1535,7 +1632,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 33 "__id__": 35
} }
], ],
"_prefab": null, "_prefab": null,
@ -1591,7 +1688,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 32 "__id__": 34
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1625,7 +1722,7 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 35 "__id__": 37
} }
], ],
"_active": true, "_active": true,
@ -1683,16 +1780,16 @@
"_name": "Background", "_name": "Background",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 34 "__id__": 36
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 36 "__id__": 38
}, },
{ {
"__id__": 37 "__id__": 39
} }
], ],
"_prefab": null, "_prefab": null,
@ -1748,7 +1845,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 35 "__id__": 37
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1782,7 +1879,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 35 "__id__": 37
}, },
"_enabled": true, "_enabled": true,
"alignMode": 0, "alignMode": 0,
@ -1813,7 +1910,7 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 39 "__id__": 41
} }
], ],
"_active": true, "_active": true,
@ -1871,16 +1968,16 @@
"_name": "Background", "_name": "Background",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 38 "__id__": 40
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 40 "__id__": 42
}, },
{ {
"__id__": 41 "__id__": 43
} }
], ],
"_prefab": null, "_prefab": null,
@ -1936,7 +2033,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 39 "__id__": 41
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1970,7 +2067,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 39 "__id__": 41
}, },
"_enabled": true, "_enabled": true,
"alignMode": 0, "alignMode": 0,
@ -2028,16 +2125,16 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 44 "__id__": 46
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 46 "__id__": 48
}, },
{ {
"__id__": 47 "__id__": 49
} }
], ],
"_prefab": null, "_prefab": null,
@ -2093,13 +2190,13 @@
"_name": "Joystick", "_name": "Joystick",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 43 "__id__": 45
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 45 "__id__": 47
} }
], ],
"_prefab": null, "_prefab": null,
@ -2155,7 +2252,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 44 "__id__": 46
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2189,7 +2286,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 43 "__id__": 45
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2223,7 +2320,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 43 "__id__": 45
}, },
"_enabled": true, "_enabled": true,
"alignMode": 0, "alignMode": 0,
@ -2358,10 +2455,10 @@
"__id__": 3 "__id__": 3
}, },
"stickhead": { "stickhead": {
"__id__": 44 "__id__": 46
}, },
"base": { "base": {
"__id__": 43 "__id__": 45
}, },
"joyStickEps": 0.1, "joyStickEps": 0.1,
"magicLeanLowerBound": 0.414, "magicLeanLowerBound": 0.414,
@ -2382,10 +2479,10 @@
"linearMovingEps": 0.1, "linearMovingEps": 0.1,
"scaleByEps": 0.0375, "scaleByEps": 0.0375,
"btnA": { "btnA": {
"__id__": 34 "__id__": 36
}, },
"btnB": { "btnB": {
"__id__": 38 "__id__": 40
}, },
"_id": "e9oVYTr7ROlpp/IrNjBUmR" "_id": "e9oVYTr7ROlpp/IrNjBUmR"
} }

View File

@ -47,7 +47,7 @@ cc.Class({
}, },
hideExitButton() { hideExitButton() {
if (null == this.exitBtnNode != null) { if (null == this.exitBtnNode) {
return; return;
} }
this.exitBtnNode.active = false; this.exitBtnNode.active = false;

View File

@ -18,10 +18,15 @@ cc.Class({
type: cc.Integer, type: cc.Integer,
default: 0 default: 0
}, },
loadingNode: {
default: null,
type: cc.Node
},
}, },
// LIFE-CYCLE CALLBACKS: // LIFE-CYCLE CALLBACKS:
onLoad() {}, onLoad() {
},
onSpeciesSelected(evt, val) { onSpeciesSelected(evt, val) {
for (let cell of this.characterSelectCells) { for (let cell of this.characterSelectCells) {
@ -36,6 +41,15 @@ cc.Class({
}, },
onModeButtonClicked(evt) { onModeButtonClicked(evt) {
for (let cell of this.characterSelectCells) {
const comp = cell.getComponent("CharacterSelectCell");
comp.setInteractable(false);
}
this.modeButton.node.active = false;
this.loadingNode.active = true;
this.loadingNode.runAction(
cc.repeatForever(cc.rotateBy(1.0, 360))
);
this.mapNode.getComponent("Map").onGameRule1v1ModeClicked(this.chosenSpeciesId); this.mapNode.getComponent("Map").onGameRule1v1ModeClicked(this.chosenSpeciesId);
}, },
}); });

View File

@ -354,6 +354,7 @@ cc.Class({
self.loadingNode.getChildByName('loadingSprite').runAction( self.loadingNode.getChildByName('loadingSprite').runAction(
cc.repeatForever(cc.rotateBy(1.0, 360)) cc.repeatForever(cc.rotateBy(1.0, 360))
); );
self.loadingNode.getChildByName('loadingLabel').active = true;
cc.director.loadScene('default_map'); cc.director.loadScene('default_map');
} else { } else {
console.log("OnLoggedIn failed, about to remove `selfPlayer` in local cache.") console.log("OnLoggedIn failed, about to remove `selfPlayer` in local cache.")

View File

@ -103,10 +103,6 @@ cc.Class({
type: cc.Prefab, type: cc.Prefab,
default: null default: null
}, },
playersInfoPrefab: {
type: cc.Prefab,
default: null
},
forceBigEndianFloatingNumDecoding: { forceBigEndianFloatingNumDecoding: {
default: false, default: false,
}, },
@ -114,6 +110,10 @@ cc.Class({
type: cc.Integer, type: cc.Integer,
default: 4 // implies (renderFrameIdLagTolerance >> inputScaleFrames) count of inputFrameIds default: 4 // implies (renderFrameIdLagTolerance >> inputScaleFrames) count of inputFrameIds
}, },
inputFrameFrontLabel: {
type: cc.Label,
default: null
},
sendingQLabel: { sendingQLabel: {
type: cc.Label, type: cc.Label,
default: null default: null
@ -280,13 +280,6 @@ cc.Class({
} }
}, },
onManualRejoinRequired(labelString) {
const self = this;
self.battleState = ALL_BATTLE_STATES.NONE; // Effectively stops "update(dt)"
self.showPopupInCanvas(self.gameRuleNode);
self.popupSimplePressToGo(labelString, false);
},
popupSimplePressToGo(labelString, hideYesButton) { popupSimplePressToGo(labelString, hideYesButton) {
const self = this; const self = this;
self.state = ALL_MAP_STATES.SHOWING_MODAL_POPUP; self.state = ALL_MAP_STATES.SHOWING_MODAL_POPUP;
@ -397,15 +390,6 @@ cc.Class({
self.allowRollbackOnPeerUpsync = true; self.allowRollbackOnPeerUpsync = true;
self.countdownNanos = null; self.countdownNanos = null;
if (self.countdownLabel) {
self.countdownLabel.string = "";
}
if (self.playersInfoNode) {
safelyAddChild(self.widgetsAboveAllNode, self.playersInfoNode);
}
if (self.findingPlayerNode) {
safelyAddChild(self.widgetsAboveAllNode, self.findingPlayerNode);
}
}, },
initDebugDrawers() { initDebugDrawers() {
@ -459,7 +443,7 @@ cc.Class({
}, },
onLoad() { onLoad() {
cc.game.setFrameRate(60); cc.game.setFrameRate(59);
cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE); cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE);
cc.view.enableAutoFullScreen(true); cc.view.enableAutoFullScreen(true);
@ -508,8 +492,6 @@ cc.Class({
const findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer"); const findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer");
findingPlayerScriptIns.init(self); findingPlayerScriptIns.init(self);
self.playersInfoNode = cc.instantiate(self.playersInfoPrefab);
self.countdownToBeginGameNode = cc.instantiate(self.countdownToBeginGamePrefab); self.countdownToBeginGameNode = cc.instantiate(self.countdownToBeginGamePrefab);
self.countdownToBeginGameNode.width = self.canvasNode.width; self.countdownToBeginGameNode.width = self.canvasNode.width;
self.countdownToBeginGameNode.height = self.canvasNode.height; self.countdownToBeginGameNode.height = self.canvasNode.height;
@ -551,6 +533,11 @@ cc.Class({
tiledMapIns.tmxAsset = null; tiledMapIns.tmxAsset = null;
mapNode.removeAllChildren(); mapNode.removeAllChildren();
self._resetCurrentMatch(); self._resetCurrentMatch();
if (self.countdownLabel) {
self.countdownLabel.string = "";
}
self.hideGameRuleNode();
self.showFindingPlayerGUI(null);
tiledMapIns.tmxAsset = tmxAsset; tiledMapIns.tmxAsset = tmxAsset;
const newMapSize = tiledMapIns.getMapSize(); const newMapSize = tiledMapIns.getMapSize();
@ -597,7 +584,6 @@ cc.Class({
self.initAfterWSConnected = () => { self.initAfterWSConnected = () => {
const self = window.mapIns; const self = window.mapIns;
self.hideGameRuleNode();
self.transitToState(ALL_MAP_STATES.WAITING); self.transitToState(ALL_MAP_STATES.WAITING);
self._inputControlEnabled = false; self._inputControlEnabled = false;
} }
@ -643,7 +629,8 @@ cc.Class({
if (null == self.gameRuleNode) { if (null == self.gameRuleNode) {
return; return;
} }
self.gameRuleNode.active = false; //self.gameRuleNode.active = false;
self.gameRuleNode.setPosition(cc.v2(Number.MAX_VALUE, Number.MAX_VALUE));
}, },
enableInputControls() { enableInputControls() {
@ -718,14 +705,6 @@ cc.Class({
self.chConfigsOrderedByJoinIndex = gopkgs.GetCharacterConfigsOrderedByJoinIndex(pbRdf.speciesIdList); self.chConfigsOrderedByJoinIndex = gopkgs.GetCharacterConfigsOrderedByJoinIndex(pbRdf.speciesIdList);
self._initPlayerRichInfoDict(rdf.PlayersArr); self._initPlayerRichInfoDict(rdf.PlayersArr);
// Show the top status indicators for IN_BATTLE
if (self.playersInfoNode) {
const playersInfoScriptIns = self.playersInfoNode.getComponent("PlayersInfo");
for (let i in pbRdf.playersArr) {
playersInfoScriptIns.updateData(pbRdf.playersArr[i]);
}
}
if (shouldForceDumping1 || shouldForceDumping2 || shouldForceResync) { if (shouldForceDumping1 || shouldForceDumping2 || shouldForceResync) {
// In fact, not having "window.RING_BUFF_CONSECUTIVE_SET == dumpRenderCacheRet" should already imply that "self.renderFrameId <= rdf.id", but here we double check and log the anomaly // In fact, not having "window.RING_BUFF_CONSECUTIVE_SET == dumpRenderCacheRet" should already imply that "self.renderFrameId <= rdf.id", but here we double check and log the anomaly
@ -1009,12 +988,7 @@ fromUDP=${fromUDP}`);
onPlayerAdded(rdf /* pb.RoomDownsyncFrame */ ) { onPlayerAdded(rdf /* pb.RoomDownsyncFrame */ ) {
const self = this; const self = this;
// Update the "finding player" GUI and show it if not previously present self.showFindingPlayerGUI(rdf);
if (!self.findingPlayerNode.parent) {
self.showPopupInCanvas(self.findingPlayerNode);
}
let findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer");
findingPlayerScriptIns.updatePlayersInfo(rdf.playersArr);
}, },
onBattleStopped() { onBattleStopped() {
@ -1034,9 +1008,6 @@ fromUDP=${fromUDP}`);
resultPanelScriptIns.showPlayerInfo(self.playerRichInfoDict); resultPanelScriptIns.showPlayerInfo(self.playerRichInfoDict);
window.clearBoundRoomIdInBothVolatileAndPersistentStorage(); window.clearBoundRoomIdInBothVolatileAndPersistentStorage();
self.showPopupInCanvas(resultPanelNode); self.showPopupInCanvas(resultPanelNode);
// Clear player info
self.playersInfoNode.getComponent("PlayersInfo").clearInfo();
}, },
spawnPlayerNode(joinIndex, vx, vy, playerDownsyncInfo) { spawnPlayerNode(joinIndex, vx, vy, playerDownsyncInfo) {
@ -1092,6 +1063,7 @@ fromUDP=${fromUDP}`);
currSelfInput = null; currSelfInput = null;
if (gopkgs.ShouldGenerateInputFrameUpsync(self.renderFrameId)) { if (gopkgs.ShouldGenerateInputFrameUpsync(self.renderFrameId)) {
[prevSelfInput, currSelfInput] = self.getOrPrefabInputFrameUpsync(noDelayInputFrameId, true); [prevSelfInput, currSelfInput] = self.getOrPrefabInputFrameUpsync(noDelayInputFrameId, true);
self.networkDoctor.logInputFrameIdFront(noDelayInputFrameId);
} }
const delayedInputFrameId = gopkgs.ConvertToDelayedInputFrameId(self.renderFrameId); const delayedInputFrameId = gopkgs.ConvertToDelayedInputFrameId(self.renderFrameId);
@ -1143,8 +1115,6 @@ fromUDP=${fromUDP}`);
console.warn(`Mismatched render frame@rdf.id=${rdf.Id} w/ inputFrameId=${delayedInputFrameId}: console.warn(`Mismatched render frame@rdf.id=${rdf.Id} w/ inputFrameId=${delayedInputFrameId}:
rdf=${JSON.stringify(rdf)} rdf=${JSON.stringify(rdf)}
othersForcedDownsyncRenderFrame=${JSON.stringify(othersForcedDownsyncRenderFrame)}`); othersForcedDownsyncRenderFrame=${JSON.stringify(othersForcedDownsyncRenderFrame)}`);
// closeWSConnection(constants.RET_CODE.CLIENT_MISMATCHED_RENDER_FRAME, "");
// self.onManualRejoinRequired("[DEBUG] CLIENT_MISMATCHED_RENDER_FRAME");
rdf = othersForcedDownsyncRenderFrame; rdf = othersForcedDownsyncRenderFrame;
self.othersForcedDownsyncRenderFrameDict.delete(rdf.Id); self.othersForcedDownsyncRenderFrameDict.delete(rdf.Id);
} }
@ -1235,7 +1205,6 @@ othersForcedDownsyncRenderFrame=${JSON.stringify(othersForcedDownsyncRenderFrame
self.battleState = ALL_BATTLE_STATES.WAITING; self.battleState = ALL_BATTLE_STATES.WAITING;
window.chosenSpeciesId = chosenSpeciesId; // TODO: Find a better way to pass it into "self.initAfterWSConnected"! window.chosenSpeciesId = chosenSpeciesId; // TODO: Find a better way to pass it into "self.initAfterWSConnected"!
window.initPersistentSessionClient(self.initAfterWSConnected, null /* Deliberately NOT passing in any `expectedRoomId`. -- YFLu */ ); window.initPersistentSessionClient(self.initAfterWSConnected, null /* Deliberately NOT passing in any `expectedRoomId`. -- YFLu */ );
self.hideGameRuleNode();
}, },
showPopupInCanvas(toShowNode) { showPopupInCanvas(toShowNode) {
@ -1247,6 +1216,18 @@ othersForcedDownsyncRenderFrame=${JSON.stringify(othersForcedDownsyncRenderFrame
setLocalZOrder(toShowNode, 10); setLocalZOrder(toShowNode, 10);
}, },
showFindingPlayerGUI(rdf) {
const self = this;
// Update the "finding player" GUI and show it if not previously present
if (!self.findingPlayerNode.parent) {
self.showPopupInCanvas(self.findingPlayerNode);
}
if (null != rdf) {
const findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer");
findingPlayerScriptIns.updatePlayersInfo(rdf.playersArr);
}
},
hideFindingPlayersGUI(rdf) { hideFindingPlayersGUI(rdf) {
const self = this; const self = this;
// [WARNING] "cc.Node.removeChild" would trigger massive update of rendering nodes, thus a performance impact at the beginning of battle, avoid it by just moving the widget to infinitely far away! // [WARNING] "cc.Node.removeChild" would trigger massive update of rendering nodes, thus a performance impact at the beginning of battle, avoid it by just moving the widget to infinitely far away!
@ -1259,13 +1240,6 @@ othersForcedDownsyncRenderFrame=${JSON.stringify(othersForcedDownsyncRenderFrame
const self = this; const self = this;
const players = rdf.playersArr; const players = rdf.playersArr;
// Show the top status indicators for IN_BATTLE
if (self.playersInfoNode) {
const playersInfoScriptIns = self.playersInfoNode.getComponent("PlayersInfo");
for (let i in players) {
playersInfoScriptIns.updateData(players[i]);
}
}
console.log("Calling `onBattleReadyToStart` with:", players); console.log("Calling `onBattleReadyToStart` with:", players);
if (self.findingPlayerNode) { if (self.findingPlayerNode) {
const findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer"); const findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer");
@ -1654,7 +1628,10 @@ actuallyUsedinputList:{${self.inputFrameDownsyncStr(actuallyUsedInputClone)}}`);
showNetworkDoctorLabels() { showNetworkDoctorLabels() {
const self = this; const self = this;
const [sendingFps, srvDownsyncFps, peerUpsyncFps, rollbackFrames, skippedRenderFrameCnt] = self.networkDoctor.stats(); const [inputFrameFront, sendingFps, srvDownsyncFps, peerUpsyncFps, rollbackFrames, skippedRenderFrameCnt] = self.networkDoctor.stats();
if (self.inputFrameFrontLabel) {
self.inputFrameFrontLabel.string = `${inputFrameFront} inputFrameId front`;
}
if (self.sendingQLabel) { if (self.sendingQLabel) {
self.sendingQLabel.string = `${sendingFps} fps sending`; self.sendingQLabel.string = `${sendingFps} fps sending`;
if (sendingFps < self.networkDoctor.inputRateThreshold) { if (sendingFps < self.networkDoctor.inputRateThreshold) {

View File

@ -5,6 +5,7 @@ var NetworkDoctor = function(capacity) {
}; };
NetworkDoctor.prototype.reset = function(capacity) { NetworkDoctor.prototype.reset = function(capacity) {
this.inputFrameIdFront = 0;
this.sendingQ = new RingBuffer(capacity); this.sendingQ = new RingBuffer(capacity);
this.inputFrameDownsyncQ = new RingBuffer(capacity); this.inputFrameDownsyncQ = new RingBuffer(capacity);
this.peerInputFrameUpsyncQ = new RingBuffer(capacity); this.peerInputFrameUpsyncQ = new RingBuffer(capacity);
@ -17,6 +18,10 @@ NetworkDoctor.prototype.reset = function(capacity) {
this.rollbackFramesThreshold = 8; // Roughly the minimum "TurnAroundFramesToRecover". this.rollbackFramesThreshold = 8; // Roughly the minimum "TurnAroundFramesToRecover".
}; };
NetworkDoctor.prototype.logInputFrameIdFront = function(inputFrameId) {
this.inputFrameIdFront = inputFrameId;
};
NetworkDoctor.prototype.logSending = function(stFrameId, edFrameId) { NetworkDoctor.prototype.logSending = function(stFrameId, edFrameId) {
this.sendingQ.put({ this.sendingQ.put({
i: stFrameId, i: stFrameId,
@ -72,7 +77,7 @@ NetworkDoctor.prototype.stats = function() {
const elapsedMillis = ed.t - st.t; const elapsedMillis = ed.t - st.t;
peerUpsyncFps = Math.round(this.peerInputFrameUpsyncCnt * 1000 / elapsedMillis); peerUpsyncFps = Math.round(this.peerInputFrameUpsyncCnt * 1000 / elapsedMillis);
} }
return [sendingFps, srvDownsyncFps, peerUpsyncFps, rollbackFrames, this.skippedRenderFrameCnt]; return [this.inputFrameIdFront, sendingFps, srvDownsyncFps, peerUpsyncFps, rollbackFrames, this.skippedRenderFrameCnt];
}; };
NetworkDoctor.prototype.logSkippedRenderFrameCnt = function() { NetworkDoctor.prototype.logSkippedRenderFrameCnt = function() {

File diff suppressed because one or more lines are too long

View File

@ -22,7 +22,7 @@ const (
GRAVITY_X = int32(0) GRAVITY_X = int32(0)
GRAVITY_Y = -int32(float64(0.5) * WORLD_TO_VIRTUAL_GRID_RATIO) // makes all "playerCollider.Y" a multiple of 0.5 in all cases GRAVITY_Y = -int32(float64(0.5) * WORLD_TO_VIRTUAL_GRID_RATIO) // makes all "playerCollider.Y" a multiple of 0.5 in all cases
INPUT_DELAY_FRAMES = int32(5) // in the count of render frames INPUT_DELAY_FRAMES = int32(6) // in the count of render frames
/* /*
[WARNING] [WARNING]