Skip to content

Commit

Permalink
Add documentation, remove player component
Browse files Browse the repository at this point in the history
  • Loading branch information
JerritEic committed Jan 23, 2024
1 parent 2f93b2c commit bd82e66
Show file tree
Hide file tree
Showing 44 changed files with 3,561 additions and 117 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 3 additions & 12 deletions Extensions/NetcodeForEntities/NetCodeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,27 +211,18 @@ public void OnCreate(ref SystemState state)
++ClientServerBootstrap.WorldCounts.Data.serverWorlds;
}

if (state.World.IsClient() && !state.World.IsSimulatedClient())
if (state.World.IsClient())
{
var simulationGroup = state.World.GetExistingSystemManaged<SimulationSystemGroup>();
simulationGroup.RateManager = new NetcodeClientRateManager(simulationGroup);

var predictionGroup = state.World.GetExistingSystemManaged<PredictedSimulationSystemGroup>();
predictionGroup.SetRateManagerCreateAllocator(new NetcodeClientPredictionRateManager(predictionGroup));


++ClientServerBootstrap.WorldCounts.Data.clientWorlds;
}

if (state.World.IsSimulatedClient())
{
var simulationGroup = state.World.GetExistingSystemManaged<SimulationSystemGroup>();
simulationGroup.RateManager = new NetcodeClientRateManager(simulationGroup);

var predictionGroup = state.World.GetExistingSystemManaged<PredictedSimulationSystemGroup>();
predictionGroup.SetRateManagerCreateAllocator(new NetcodeClientPredictionRateManager(predictionGroup));

++ClientServerBootstrap.WorldCounts.Data.clientWorlds;
}
state.Enabled = false;
}

Expand Down
3 changes: 3 additions & 0 deletions Prefabs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Prefabs/Bootstrap.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions Prefabs/Bootstrap/GameBootstrap.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8602242385816674794
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4500616911380405583}
- component: {fileID: 3243556258562715456}
- component: {fileID: 9077543739387041978}
m_Layer: 0
m_Name: GameBootstrap
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4500616911380405583
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8602242385816674794}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3243556258562715456
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8602242385816674794}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7670ed7fdc2d435abe14606c6942102a, type: 3}
m_Name:
m_EditorClassIdentifier:
editorArgs:
useDeploymentConfig: 0
deploymentConfig: "{\n\t\"nodes\":[\n\t\t{\n\t\t\t\"nodeID\":0,\n\t\t\t\"nodeIP\":\"\",\n\t\t\t\"worldConfigs\":[\n\t\t\t\t{\n\t\t\t\t\t\"worldName\":
\"GameServer\",\n\t\t\t\t\t\"worldType\":\"Server\",\n\t\t\t\t\t\"initializationMode\":\"Connect\",\n\t\t\t\t\t\"multiplayStreamingRoles\":\"Disabled\",\n\t\t\t\t\t\"serverNodeID\":0,\n\t\t\t\t\t\"streamingNodeID\":-1,\n\t\t\t\t\t\"numThinClients\":0,\n\t\t\t\t\t\"services\":[],\n\t\t\t\t\t\"serviceFilterType\":\"Includes\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"worldName\":
\"CloudHostClient\",\n\t\t\t\t\t\"worldType\":\"Client\",\n\t\t\t\t\t\"initializationMode\":\"Start\",\n\t\t\t\t\t\"multiplayStreamingRoles\":\"CloudHost\",\n\t\t\t\t\t\"serverNodeID\":0,\n\t\t\t\t\t\"streamingNodeID\":0,\n\t\t\t\t\t\"numThinClients\":0,\n\t\t\t\t\t\"services\":[],\n\t\t\t\t\t\"serviceFilterType\":\"Includes\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"nodeID\":1,\n\t\t\t\"nodeIP\":\"\",\n\t\t\t\"worldConfigs\":[\n\t\t\t\t{\n\t\t\t\t\t\"worldName\":
\"GameClient\",\n\t\t\t\t\t\"worldType\":\"Client\",\n\t\t\t\t\t\"initializationMode\":\"Connect\",\n\t\t\t\t\t\"multiplayStreamingRoles\":\"Disabled\",\n\t\t\t\t\t\"serverNodeID\":0,\n\t\t\t\t\t\"streamingNodeID\":-1,\n\t\t\t\t\t\"numThinClients\":0,\n\t\t\t\t\t\"services\":[],\n\t\t\t\t\t\"serviceFilterType\":\"Includes\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"worldName\":
\"StreamedClient\",\n\t\t\t\t\t\"worldType\":\"Client\",\n\t\t\t\t\t\"initializationMode\":\"Create\",\n\t\t\t\t\t\"multiplayStreamingRoles\":\"Guest\",\n\t\t\t\t\t\"serverNodeID\":-1,\n\t\t\t\t\t\"streamingNodeID\":0,\n\t\t\t\t\t\"numThinClients\":0,\n\t\t\t\t\t\"services\":[],\n\t\t\t\t\t\"serviceFilterType\":\"Includes\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"experimentActions\":[\n\t\t{\n\t\t\t\"delay\":
15,\n\t\t\t\"actions\": [\n\t\t\t\t{\n\t\t\t\t\t\"nodeID\": 1,\n\t\t\t\t\t\"worldNames\":
[\"GameClient\", \"StreamedClient\"],\n\t\t\t\t\t\"actions\": [\"Stop\", \"Connect\"]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"nodeID\":
0,\n\t\t\t\t\t\"worldNames\": [\"CloudHostClient\"],\n\t\t\t\t\t\"actions\":
[\"Connect\"]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}"
--- !u!114 &9077543739387041978
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8602242385816674794}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f24193842324400097dc31e8a94f65b4, type: 3}
m_Name:
m_EditorClassIdentifier:
7 changes: 7 additions & 0 deletions Prefabs/Bootstrap/GameBootstrap.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Prefabs/Player.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 82 additions & 0 deletions Prefabs/Player/MultiplayGuest.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3194879136077857405
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5635330251713189791}
- component: {fileID: -8347971977946656872}
- component: {fileID: -4434060309359839410}
- component: {fileID: 8072465814999522723}
m_Layer: 0
m_Name: MultiplayGuest
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5635330251713189791
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3194879136077857405}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &-8347971977946656872
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3194879136077857405}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4ae253ffca93b1b44a471a07cde60141, type: 3}
m_Name:
m_EditorClassIdentifier:
streams:
- {fileID: 8072465814999522723}
- {fileID: -4434060309359839410}
--- !u!114 &-4434060309359839410
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3194879136077857405}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e6d9188eb6318c488077f3c88318a65, type: 3}
m_Name:
m_EditorClassIdentifier:
local: 1
label:
--- !u!114 &8072465814999522723
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3194879136077857405}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4872c2e12a0e07b498876d68f1e51143, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Codec:
m_MimeType: video/H264
m_SdpFmtpLine: implementation_name=NvCodec;level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640033
m_RenderMode: 1
m_TargetTexture: {fileID: 0}
7 changes: 7 additions & 0 deletions Prefabs/Player/MultiplayGuest.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bd82e66

Please sign in to comment.