Skip to content
This repository was archived by the owner on Dec 5, 2018. It is now read-only.

Commit 20cdf69

Browse files
committed
revised blank project for SpatialOS 10.2.0
1 parent 482c6b6 commit 20cdf69

29 files changed

+143
-229
lines changed

README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# BlankProject
1+
# Blank Project
22
---
33

4-
*Copyright Improbable 2016*
4+
*Copyright Improbable Worlds Ltd, 2017*
55

6-
- *GitHub Repository*: [github.com/spatialos/BlankProject](https://github.com/spatialos/BlankProject)
6+
- *GitHub repository*: [https://github.com/spatialos/BlankProject](https://github.com/spatialos/BlankProject)
77

88
---
99

@@ -14,14 +14,10 @@ This is a blank SpatialOS project that you can use to build your own SpatialOS a
1414
It contains:
1515

1616
* A SpatialOS project descriptor.
17-
* Unity worker
17+
* A Unity worker.
1818
* Bare-bones Launch Configurations for automatically and manually launching workers.
1919
* Bare-bones Client and Physics Scenes with a `Bootstrap.cs` file.
20-
* An example deployment configuration, `deploy.json`.
20+
* An example deployment configuration, `default_launch.json`.
2121
* `.gitignore` files for a SpatialOS project.
2222

23-
## Using the BlankProject
24-
25-
[SpatialOS documentation](https://spatialos.improbable.io/docs/).
26-
27-
To report bugs or to give feedback on this project, please contact SpatialOS Support.
23+
If you run into problems, or want to give us feedback, please visit the [SpatialOS forums](https://forums.improbable.io/).

default_launch.json

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,17 @@
66
"snapshotWritePeriodSeconds": 0
77
},
88
"dimensions": {
9-
"xMeters": 8000,
10-
"zMeters": 8000
9+
"xMeters": 1500,
10+
"zMeters": 1500
1111
}
1212
},
1313
"workers": [
1414
{
1515
"worker_type": "UnityWorker",
1616
"load_balancing": {
17-
"dynamic_loadbalancer": {
18-
"worker_scaler_config": {
19-
"constant_config": {
20-
"num_workers": 4
21-
}
22-
},
23-
"worker_placer_config": {
24-
"random_params": {}
25-
},
26-
"loadbalancer_config": {
27-
"min_range_meters": 500.0,
28-
"max_range_meters": 5000.0,
29-
"speed_meters_per_second": 100.0,
30-
"expansion_time_millis": 60000
31-
}
32-
}
17+
"auto_hex_grid": {
18+
"num_workers": 1
19+
}
3320
},
3421
"permissions": [{
3522
"all": {}
@@ -38,9 +25,19 @@
3825
{
3926
"worker_type": "UnityClient",
4027
"permissions": [{
41-
"all": {}
28+
"entity_creation": {
29+
"allow": false
30+
},
31+
"entity_deletion": {
32+
"allow": false
33+
},
34+
"entity_query": {
35+
"allow": true,
36+
"components": [
37+
"*"
38+
]
4239
}
43-
]
40+
}]
4441
}
4542
]
4643
}

schema/improbable/general/WorldTransform.schema

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package improbable.global;
2+
3+
component WorldTransform {
4+
id = 1000;
5+
EntityPosition position = 1;
6+
}

schema/improbable/player/name.schema

Lines changed: 0 additions & 8 deletions
This file was deleted.

snapshots/default.snapshot

24 Bytes
Binary file not shown.

snapshots/initial_world.snapshot

-129 Bytes
Binary file not shown.

spatialos.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "your_project_name_here",
3-
"project_version": "0.0.4",
3+
"project_version": "1.0.0",
44
"sdk_version": "10.2.0",
55
"dependencies": [
6-
{"name": "WorkerSdkSchema", "version": "10.2.0"}
6+
{"name": "WorkerSdkSchema", "version": "10.2.0"}
77
]
88
}

workers/unity/Assets/Bootstrap.cs

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,40 @@
11
using System.Collections.Generic;
22
using System.IO;
3-
using Assets.EntityTemplates;
43
using Improbable;
54
using Improbable.Worker;
65
using UnityEngine;
76
using JetBrains.Annotations;
87
using UnityEditor;
8+
using Assets.Gamelogic.Global;
99

10-
public class SnapshotMenu : MonoBehaviour
10+
namespace Assets.Editor
1111
{
12-
private static readonly string InitialWorldSnapshotPath = Application.dataPath +
13-
"/../../../snapshots/initial_world.snapshot";
12+
public class SnapshotMenu : MonoBehaviour
13+
{
14+
[MenuItem("Improbable/Snapshots/Generate Default Snapshot")]
15+
[UsedImplicitly]
16+
private static void GenerateDefaultSnapshot()
17+
{
18+
var snapshotEntities = new Dictionary<EntityId, SnapshotEntity>();
1419

15-
[MenuItem("Improbable/Snapshots/Generate Snapshot Programmatically")]
16-
[UsedImplicitly]
17-
private static void GenerateSnapshotProgrammatically()
18-
{
19-
var snapshotEntities = new Dictionary<EntityId, SnapshotEntity>();
20-
var currentEntityId = 1;
20+
// Add entity data to the snapshot
2121

22-
snapshotEntities.Add(new EntityId(currentEntityId++), ExampleEntityTemplate.GenerateExampleSnapshotEntityTemplate());
22+
SaveSnapshot(snapshotEntities);
23+
}
2324

24-
SaveSnapshot(snapshotEntities);
25-
}
25+
private static void SaveSnapshot(IDictionary<EntityId, SnapshotEntity> snapshotEntities)
26+
{
27+
File.Delete(SimulationSettings.DefaultSnapshotPath);
28+
var maybeError = Snapshot.Save(SimulationSettings.DefaultSnapshotPath, snapshotEntities);
2629

27-
private static void SaveSnapshot(IDictionary<EntityId, SnapshotEntity> snapshotEntities)
28-
{
29-
File.Delete(InitialWorldSnapshotPath);
30-
var maybeError = Snapshot.Save(InitialWorldSnapshotPath, snapshotEntities);
31-
32-
if (maybeError.HasValue)
33-
{
34-
Debug.LogErrorFormat("Failed to generate initial world snapshot: {0}", maybeError.Value);
35-
}
36-
else
37-
{
38-
Debug.LogFormat("Successfully generated initial world snapshot at {0}", InitialWorldSnapshotPath);
39-
}
40-
}
30+
if (maybeError.HasValue)
31+
{
32+
Debug.LogErrorFormat("Failed to generate initial world snapshot: {0}", maybeError.Value);
33+
}
34+
else
35+
{
36+
Debug.LogFormat("Successfully generated initial world snapshot at {0}", SimulationSettings.DefaultSnapshotPath);
37+
}
38+
}
39+
}
4140
}

0 commit comments

Comments
 (0)