Skip to content
This repository was archived by the owner on Oct 20, 2021. It is now read-only.

Commit c5392ed

Browse files
authored
Release 0.1.4 prep (#97)
* updating entity templates * defaulting to receptionist * adding ticket number * updating pinned & spatial version * using empty constructor instead * upgrading to 2018.3 * updating change log * updating sdk version * finalizing release
1 parent 9525dd6 commit c5392ed

File tree

21 files changed

+197
-193
lines changed

21 files changed

+197
-193
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
## `0.1.4` - 2019-01-28
6+
57
### Added
68

79
- Added mobile support for local deployments.
@@ -10,6 +12,11 @@
1012

1113
- Updated all the launch configs to better match the world sizes and to use the new Runtime.
1214
- `MapBuilder.cs` performance and visual improvements, now generates worlds around the GameObject's position rather than at origin.
15+
- Upgraded the Worker SDK version to `13.5.1`. This is a stable Worker SDK release! :tada:
16+
- Upgraded the project to be compatible with `2018.3.2f1`.
17+
- Upgraded the postprocessing package to `2.1.2`.
18+
- Upgraded the package manager package to `2.0.3`.
19+
- Upgraded to GDK for Unity version `0.1.4`.
1320

1421
### Fixed
1522

gdk.pinned

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
afa93bc4b0a96b49bbb844be5ed7d1c88d4d87a7
1+
a518da67ab9e0c87a4f44ceed6b072416688e529

spatialos.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "unity_gdk",
33
"project_version": "0.0.1",
4-
"sdk_version": "14.0-b6841-3d544-WORKER-SNAPSHOT",
4+
"sdk_version": "13.5.1-gdk-for-unity",
55
"dependencies": [
6-
{"name": "standard_library", "version": "14.0-b6841-3d544-WORKER-SNAPSHOT"}
6+
{"name": "standard_library", "version": "13.5.1-gdk-for-unity"}
77
]
88
}

workers/unity/Assets/Fps/Art/Materials/Source_Shaders/LowHealthPostProcess.shader

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Shader "FPS/LowHealthVignette"
33
{
44
HLSLINCLUDE
55

6-
#include "PostProcessing/Shaders/StdLib.hlsl"
6+
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
77

88
TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex);
99
TEXTURE2D_SAMPLER2D(_VignetteMaterial, sampler_VignetteMaterial);
@@ -18,7 +18,7 @@ Shader "FPS/LowHealthVignette"
1818
float4 maskValue = SAMPLE_TEXTURE2D(_VignetteMask, sampler_VignetteMask, i.texcoord);
1919
float4 vignetteValue = SAMPLE_TEXTURE2D(_VignetteMaterial, sampler_VignetteMaterial, i.texcoord);
2020
float4 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord);
21-
21+
2222
float vignetteColour = pow((((vignetteValue.r+color.g)+color.b)*0.3),1.25);
2323
float health_saturation = pow(saturate(_HEALTH_VALUE),4.0);
2424
float angle = (fmod(_DAMAGE_YAW,360.0)/360.0);

workers/unity/Assets/Fps/Scenes/FPS-SimulatedPlayerCoordinator.unity

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RenderSettings:
3838
m_ReflectionIntensity: 0
3939
m_CustomReflection: {fileID: 0}
4040
m_Sun: {fileID: 0}
41-
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 0}
41+
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
4242
m_UseRadianceAmbientProbe: 0
4343
--- !u!157 &3
4444
LightmapSettings:
@@ -50,7 +50,6 @@ LightmapSettings:
5050
m_BounceScale: 1
5151
m_IndirectOutputScale: 1
5252
m_AlbedoBoost: 1
53-
m_TemporalCoherenceThreshold: 1
5453
m_EnvironmentLightingMode: 0
5554
m_EnableBakedLightmaps: 0
5655
m_EnableRealtimeLightmaps: 0
@@ -114,132 +113,129 @@ NavMeshSettings:
114113
m_Flags: 0
115114
m_NavMeshData: {fileID: 23800000, guid: 3daa9e7d489573e4daebd2ed80d44aa6, type: 2}
116115
--- !u!1001 &762447397
117-
Prefab:
116+
PrefabInstance:
118117
m_ObjectHideFlags: 0
119118
serializedVersion: 2
120119
m_Modification:
121120
m_TransformParent: {fileID: 0}
122121
m_Modifications:
123-
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 2}
122+
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 3}
124123
propertyPath: m_LocalPosition.x
125124
value: 0
126125
objectReference: {fileID: 0}
127-
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 2}
126+
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 3}
128127
propertyPath: m_LocalPosition.y
129128
value: 0
130129
objectReference: {fileID: 0}
131-
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 2}
130+
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 3}
132131
propertyPath: m_LocalPosition.z
133132
value: 0
134133
objectReference: {fileID: 0}
135-
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 2}
134+
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 3}
136135
propertyPath: m_LocalRotation.x
137136
value: 0
138137
objectReference: {fileID: 0}
139-
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 2}
138+
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 3}
140139
propertyPath: m_LocalRotation.y
141140
value: 0
142141
objectReference: {fileID: 0}
143-
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 2}
142+
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 3}
144143
propertyPath: m_LocalRotation.z
145144
value: 0
146145
objectReference: {fileID: 0}
147-
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 2}
146+
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 3}
148147
propertyPath: m_LocalRotation.w
149148
value: 1
150149
objectReference: {fileID: 0}
151-
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 2}
150+
- target: {fileID: 4599106417802648, guid: de9de090270a7f64b91c24e64242f1aa, type: 3}
152151
propertyPath: m_RootOrder
153152
value: 0
154153
objectReference: {fileID: 0}
155154
m_RemovedComponents: []
156-
m_SourcePrefab: {fileID: 100100000, guid: de9de090270a7f64b91c24e64242f1aa, type: 2}
157-
m_IsPrefabAsset: 0
155+
m_SourcePrefab: {fileID: 100100000, guid: de9de090270a7f64b91c24e64242f1aa, type: 3}
158156
--- !u!1001 &1413886359
159-
Prefab:
157+
PrefabInstance:
160158
m_ObjectHideFlags: 0
161159
serializedVersion: 2
162160
m_Modification:
163161
m_TransformParent: {fileID: 0}
164162
m_Modifications:
165-
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 2}
163+
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 3}
166164
propertyPath: m_LocalPosition.x
167165
value: 0
168166
objectReference: {fileID: 0}
169-
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 2}
167+
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 3}
170168
propertyPath: m_LocalPosition.y
171169
value: 0
172170
objectReference: {fileID: 0}
173-
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 2}
171+
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 3}
174172
propertyPath: m_LocalPosition.z
175173
value: 0
176174
objectReference: {fileID: 0}
177-
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 2}
175+
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 3}
178176
propertyPath: m_LocalRotation.x
179177
value: 0
180178
objectReference: {fileID: 0}
181-
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 2}
179+
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 3}
182180
propertyPath: m_LocalRotation.y
183181
value: 0
184182
objectReference: {fileID: 0}
185-
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 2}
183+
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 3}
186184
propertyPath: m_LocalRotation.z
187185
value: 0
188186
objectReference: {fileID: 0}
189-
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 2}
187+
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 3}
190188
propertyPath: m_LocalRotation.w
191189
value: 1
192190
objectReference: {fileID: 0}
193-
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 2}
191+
- target: {fileID: 4527984774241536, guid: a18c738cbcda9914591d9af24a618907, type: 3}
194192
propertyPath: m_RootOrder
195193
value: 1
196194
objectReference: {fileID: 0}
197195
m_RemovedComponents: []
198-
m_SourcePrefab: {fileID: 100100000, guid: a18c738cbcda9914591d9af24a618907, type: 2}
199-
m_IsPrefabAsset: 0
196+
m_SourcePrefab: {fileID: 100100000, guid: a18c738cbcda9914591d9af24a618907, type: 3}
200197
--- !u!1001 &1860465035
201-
Prefab:
198+
PrefabInstance:
202199
m_ObjectHideFlags: 0
203200
serializedVersion: 2
204201
m_Modification:
205202
m_TransformParent: {fileID: 0}
206203
m_Modifications:
207-
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 2}
204+
- target: {fileID: 1620385508151754, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 3}
205+
propertyPath: m_IsActive
206+
value: 0
207+
objectReference: {fileID: 0}
208+
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 3}
208209
propertyPath: m_LocalPosition.x
209210
value: 0
210211
objectReference: {fileID: 0}
211-
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 2}
212+
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 3}
212213
propertyPath: m_LocalPosition.y
213214
value: 0
214215
objectReference: {fileID: 0}
215-
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 2}
216+
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 3}
216217
propertyPath: m_LocalPosition.z
217218
value: 0
218219
objectReference: {fileID: 0}
219-
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 2}
220+
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 3}
220221
propertyPath: m_LocalRotation.x
221222
value: 0
222223
objectReference: {fileID: 0}
223-
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 2}
224+
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 3}
224225
propertyPath: m_LocalRotation.y
225226
value: 0
226227
objectReference: {fileID: 0}
227-
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 2}
228+
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 3}
228229
propertyPath: m_LocalRotation.z
229230
value: 0
230231
objectReference: {fileID: 0}
231-
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 2}
232+
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 3}
232233
propertyPath: m_LocalRotation.w
233234
value: 1
234235
objectReference: {fileID: 0}
235-
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 2}
236+
- target: {fileID: 4977616286773460, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 3}
236237
propertyPath: m_RootOrder
237238
value: 2
238239
objectReference: {fileID: 0}
239-
- target: {fileID: 1620385508151754, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 2}
240-
propertyPath: m_IsActive
241-
value: 0
242-
objectReference: {fileID: 0}
243240
m_RemovedComponents: []
244-
m_SourcePrefab: {fileID: 100100000, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 2}
245-
m_IsPrefabAsset: 0
241+
m_SourcePrefab: {fileID: 100100000, guid: 1d177d0ca1e95c646a6a7b9b84364f9b, type: 3}
Binary file not shown.

workers/unity/Assets/Fps/Scripts/Config/FpsEntityTemplates.cs

Lines changed: 66 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,46 @@
77
using Improbable.Gdk.PlayerLifecycle;
88
using Improbable.Gdk.StandardTypes;
99
using Improbable.PlayerLifecycle;
10+
using UnityEngine;
1011

1112
namespace Fps
1213
{
1314
public static class FpsEntityTemplates
1415
{
15-
private static readonly List<string> AllWorkerAttributes =
16-
new List<string> { WorkerUtils.UnityGameLogic, WorkerUtils.UnityClient, WorkerUtils.SimulatedPlayer, WorkerUtils.AndroidClient, WorkerUtils.iOSClient };
17-
1816
public static EntityTemplate Spawner()
1917
{
20-
const string gameLogic = WorkerUtils.UnityGameLogic;
21-
22-
return EntityBuilder.Begin()
23-
.AddPosition(0, 0, 0, gameLogic)
24-
.AddMetadata("PlayerCreator", gameLogic)
25-
.SetPersistence(true)
26-
.SetReadAcl(gameLogic)
27-
.AddComponent(PlayerCreator.Component.CreateSchemaComponentData(), gameLogic)
28-
.Build();
18+
var position = new Position.Snapshot { Coords = new Vector3().ToSpatialCoordinates() };
19+
var metadata = new Metadata.Snapshot { EntityType = "PlayerCreator" };
20+
21+
var template = new EntityTemplate();
22+
template.AddComponent(position, WorkerUtils.UnityGameLogic);
23+
template.AddComponent(metadata, WorkerUtils.UnityGameLogic);
24+
template.AddComponent(new Persistence.Snapshot(), WorkerUtils.UnityGameLogic);
25+
template.AddComponent(new PlayerCreator.Snapshot(), WorkerUtils.UnityGameLogic);
26+
27+
template.SetReadAccess(WorkerUtils.UnityGameLogic);
28+
template.SetComponentWriteAccess(EntityAcl.ComponentId, WorkerUtils.UnityGameLogic);
29+
30+
return template;
2931
}
3032

3133
public static EntityTemplate SimulatedPlayerCoordinatorTrigger()
3234
{
33-
return EntityBuilder.Begin()
34-
.AddPosition(0, 0, 0, WorkerUtils.SimulatedPlayerCoorindator)
35-
.AddMetadata("SimulatedPlayerCoordinatorTrigger", WorkerUtils.SimulatedPlayerCoorindator)
36-
.SetPersistence(true)
37-
.SetReadAcl(WorkerUtils.SimulatedPlayerCoorindator)
38-
.Build();
35+
var metadata = new Metadata.Snapshot { EntityType = "SimulatedPlayerCoordinatorTrigger" };
36+
37+
var template = new EntityTemplate();
38+
template.AddComponent(new Position.Snapshot(), WorkerUtils.SimulatedPlayerCoorindator);
39+
template.AddComponent(metadata, WorkerUtils.SimulatedPlayerCoorindator);
40+
template.AddComponent(new Persistence.Snapshot(), WorkerUtils.SimulatedPlayerCoorindator);
41+
42+
template.SetReadAccess(WorkerUtils.SimulatedPlayerCoorindator);
43+
template.SetComponentWriteAccess(EntityAcl.ComponentId, WorkerUtils.SimulatedPlayerCoorindator);
44+
45+
return template;
3946
}
4047

4148
public static EntityTemplate Player(string workerId, Vector3f position)
4249
{
43-
const string gameLogic = WorkerUtils.UnityGameLogic;
4450
var client = $"workerId:{workerId}";
4551

4652
var (spawnPosition, spawnYaw, spawnPitch) = SpawnPoints.GetRandomSpawnPoint();
@@ -50,43 +56,52 @@ public static EntityTemplate Player(string workerId, Vector3f position)
5056
Position = spawnPosition.ToIntAbsolute()
5157
};
5258

53-
var serverMovement = ServerMovement.Component.CreateSchemaComponentData(serverResponse);
54-
var clientMovementData = new ClientRequest();
5559
var rotationUpdate = new RotationUpdate
5660
{
5761
Yaw = spawnYaw.ToInt1k(),
5862
Pitch = spawnPitch.ToInt1k()
5963
};
60-
var clientMovement = ClientMovement.Component.CreateSchemaComponentData(clientMovementData);
61-
var clientRotation = ClientRotation.Component.CreateSchemaComponentData(rotationUpdate);
62-
var shootingComponent = ShootingComponent.Component.CreateSchemaComponentData();
63-
var gunStateComponent = GunStateComponent.Component.CreateSchemaComponentData(false);
64-
var gunComponent = GunComponent.Component.CreateSchemaComponentData(PlayerGunSettings.DefaultGunIndex);
65-
var maxHealth = PlayerHealthSettings.MaxHealth;
66-
67-
var healthComponent = HealthComponent.Component.CreateSchemaComponentData(maxHealth, maxHealth);
68-
var healthRegenComponent = HealthRegenComponent.Component.CreateSchemaComponentData(false,
69-
0,
70-
PlayerHealthSettings.SpatialCooldownSyncInterval,
71-
PlayerHealthSettings.RegenAfterDamageCooldown,
72-
PlayerHealthSettings.RegenInterval,
73-
PlayerHealthSettings.RegenAmount);
74-
75-
return EntityBuilder.Begin()
76-
.AddPosition(spawnPosition.x, spawnPosition.y, spawnPosition.z, gameLogic)
77-
.AddMetadata("Player", gameLogic)
78-
.SetPersistence(false)
79-
.SetReadAcl(AllWorkerAttributes)
80-
.AddComponent(serverMovement, gameLogic)
81-
.AddComponent(clientMovement, client)
82-
.AddComponent(clientRotation, client)
83-
.AddComponent(shootingComponent, client)
84-
.AddComponent(gunComponent, gameLogic)
85-
.AddComponent(gunStateComponent, client)
86-
.AddComponent(healthComponent, gameLogic)
87-
.AddComponent(healthRegenComponent, gameLogic)
88-
.AddPlayerLifecycleComponents(workerId, client, gameLogic)
89-
.Build();
64+
65+
var pos = new Position.Snapshot { Coords = spawnPosition.ToSpatialCoordinates() };
66+
var serverMovement = new ServerMovement.Snapshot { Latest = serverResponse };
67+
var clientMovement = new ClientMovement.Snapshot { Latest = new ClientRequest() };
68+
var clientRotation = new ClientRotation.Snapshot { Latest = rotationUpdate };
69+
var shootingComponent = new ShootingComponent.Snapshot();
70+
var gunComponent = new GunComponent.Snapshot { GunId = PlayerGunSettings.DefaultGunIndex };
71+
var gunStateComponent = new GunStateComponent.Snapshot { IsAiming = false };
72+
var healthComponent = new HealthComponent.Snapshot
73+
{
74+
Health = PlayerHealthSettings.MaxHealth,
75+
MaxHealth = PlayerHealthSettings.MaxHealth,
76+
};
77+
78+
var healthRegenComponent = new HealthRegenComponent.Snapshot
79+
{
80+
CooldownSyncInterval = PlayerHealthSettings.SpatialCooldownSyncInterval,
81+
DamagedRecently = false,
82+
RegenAmount = PlayerHealthSettings.RegenAmount,
83+
RegenCooldownTimer = PlayerHealthSettings.RegenAfterDamageCooldown,
84+
RegenInterval = PlayerHealthSettings.RegenInterval,
85+
RegenPauseTime = 0,
86+
};
87+
88+
var template = new EntityTemplate();
89+
template.AddComponent(pos, WorkerUtils.UnityGameLogic);
90+
template.AddComponent(new Metadata.Snapshot { EntityType = "Player" }, WorkerUtils.UnityGameLogic);
91+
template.AddComponent(serverMovement, WorkerUtils.UnityGameLogic);
92+
template.AddComponent(clientMovement, client);
93+
template.AddComponent(clientRotation, client);
94+
template.AddComponent(shootingComponent, client);
95+
template.AddComponent(gunComponent, WorkerUtils.UnityGameLogic);
96+
template.AddComponent(gunStateComponent, client);
97+
template.AddComponent(healthComponent, WorkerUtils.UnityGameLogic);
98+
template.AddComponent(healthRegenComponent, WorkerUtils.UnityGameLogic);
99+
PlayerLifecycleHelper.AddPlayerLifecycleComponents(template, workerId, client, WorkerUtils.UnityGameLogic);
100+
101+
template.SetReadAccess(WorkerUtils.UnityClient, WorkerUtils.UnityGameLogic, WorkerUtils.SimulatedPlayer, WorkerUtils.AndroidClient, WorkerUtils.iOSClient);
102+
template.SetComponentWriteAccess(EntityAcl.ComponentId, WorkerUtils.UnityGameLogic);
103+
104+
return template;
90105
}
91106
}
92107
}

0 commit comments

Comments
 (0)