Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #804 from spatialos/0.3.0-rc
Browse files Browse the repository at this point in the history
0.3.0 rc
  • Loading branch information
oblm authored Apr 4, 2019
2 parents e2c82df + b87c127 commit 7110a93
Show file tree
Hide file tree
Showing 131 changed files with 3,429 additions and 1,710 deletions.
8 changes: 4 additions & 4 deletions .buildkite/premerge.steps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ common: &common
agents:
- "capable_of_building=gdk-for-unreal"
- "environment=production"
- "permission_set=pusher"
- "platform=windows"
- "queue=v2-1550696629-578d33ded6eb9929-------z"
- "permission_set=builder"
- "queue=v2-1551960839-2fc9bbe6e15deffd-------z"
retry:
automatic:
- <<: *agent_transients
Expand All @@ -21,8 +21,8 @@ common: &common
# These are then relied on to have stable names by other things, so once named, please beware renaming has consequences.

steps:
- label: "setup-GDK-:windows:"
- label: "build-GDK-:windows:"
command: "powershell ./ci/setup-and-build-gdk.ps1"
<<: *common # This folds the YAML named anchor into this step. Overrides, if any, should follow, not precede.
artifact_paths:
- "UnrealEngine/Engine/Programs/AutomationTool/Saved/Logs/*"
- "UnrealEngine/Engine/Programs/AutomationTool/Saved/Logs/*"
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The GDK offers:
* **Multiserver support**: leveraging our cloud platform [SpatialOS (SpatialOS documentation)](https://docs.improbable.io/reference/latest/shared/concepts/spatialos), the GDK allows you to run multiple game servers in a single game instance so your Unreal-developed games can have more players, more Actors, and better gameplay systems than previously possible.

* **An Unreal-native experience:** keeping traditional workflows and networking APIs that Unreal Engine developers are familiar with, the GDK introduces new native-feeling concepts that turn a single-server engine into a distributed one. This enables the GDK to retain the functionality of the networking features which Unreal offers out of the box, including transform synchronization, character movement, and map travel.
* **An easy onboarding experience**: we have made sure it’s easy to get started with the GDK by including a Starter Project which you can use as a tour of SpatialOS and a base for your own game, as well as a guide to porting your current multiplayer Unreal game to run on SpatialOS.
* **An easy onboarding experience**: we have made sure it’s easy to get started with the GDK by including a Starter Template which you can use as a tour of SpatialOS and a base for your own game, as well as a guide to porting your current multiplayer Unreal game to run on SpatialOS.

>This is an [alpha (SpatialOS documentation)](https://docs.improbable.io/reference/latest/shared/release-policy#maturity-stages) release of the SpatialOS GDK for Unreal, pending stability and performance improvements. The API may change as we learn from feedback - see the guidance on [Recommended use](#recommended-use), below.
Expand Down Expand Up @@ -46,7 +46,6 @@ The GDK and its related projects are available on GitHub.
**NOTE:** This link may give you a 404.

In order to get access to this fork, you need to link your GitHub account to a verified Epic Games account, and to have agreed to Epic's license. You will not be able to use the GDK for Unreal without doing this first. To do this, see the [Unreal documentation](https://www.unrealengine.com/en-US/ue4-on-github).
* [Starter Project](https://github.com/spatialos/UnrealGDKStarterProject)
* [Third-Person Shooter game](https://github.com/spatialos/UnrealGDKThirdPersonShooter) (Not actively developed)
* [The Test Suite](https://github.com/spatialos/UnrealGDKTestSuite)</br>

Expand Down
2 changes: 1 addition & 1 deletion RequireSetup
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Increment the below number whenever it is required to run Setup.bat as part of a new commit.
Our git hooks will detect this file has been updated and automatically run Setup.bat on pull.

8
14
31 changes: 7 additions & 24 deletions Setup.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@if not defined TEAMCITY_CAPTURE_ENV ( echo off ) else ( echo on )
@echo off

setlocal

Expand All @@ -7,7 +7,6 @@ pushd "%~dp0"
call :MarkStartOfBlock "%~0"

call :MarkStartOfBlock "Setup the git hooks"
if defined TEAMCITY_CAPTURE_ENV goto SkipGitHooks
if not exist .git\hooks goto SkipGitHooks

rem Remove the old post-checkout hook.
Expand All @@ -28,31 +27,25 @@ call :MarkStartOfBlock "Setup the git hooks"
call :MarkEndOfBlock "Setup the git hooks"

call :MarkStartOfBlock "Check dependencies"
set /p UNREAL_VERSION=<./SpatialGDK/Extras/unreal-engine.version
if defined TEAMCITY_CAPTURE_ENV (
set UNREAL_HOME=C:\Unreal\UnrealEngine-%UNREAL_VERSION%
)

if not defined UNREAL_HOME (
echo Error: Please set UNREAL_HOME environment variable to point to the Unreal Engine folder.
if not defined TEAMCITY_CAPTURE_ENV pause
pause
exit /b 1
)

rem Use Unreal Engine's script to get the path to MSBuild. This turns off echo so turn it back on for TeamCity.
call "%UNREAL_HOME%\Engine\Build\BatchFiles\GetMSBuildPath.bat"
if defined TEAMCITY_CAPTURE_ENV echo on

if not defined MSBUILD_EXE (
echo Error: Could not find the MSBuild executable. Please make sure you have Microsoft Visual Studio or Microsoft Build Tools installed.
if not defined TEAMCITY_CAPTURE_ENV pause
pause
exit /b 1
)

where spatial >nul
if ERRORLEVEL 1 (
echo Error: Could not find spatial. Please make sure you have it installed and the containing directory added to PATH environment variable.
if not defined TEAMCITY_CAPTURE_ENV pause
pause
exit /b 1
)
call :MarkEndOfBlock "Check dependencies"
Expand Down Expand Up @@ -127,25 +120,15 @@ popd
echo UnrealGDK build completed successfully^!

if not defined NO_PAUSE (
if not defined TEAMCITY_CAPTURE_ENV (
pause
)
pause
)

exit /b %ERRORLEVEL%

:MarkStartOfBlock
if defined TEAMCITY_CAPTURE_ENV (
echo ##teamcity[blockOpened name='%~1']
) else (
echo Starting: %~1
)
echo Starting: %~1
exit /b 0

:MarkEndOfBlock
if defined TEAMCITY_CAPTURE_ENV (
echo ##teamcity[blockClosed name='%~1']
) else (
echo Finished: %~1
)
echo Finished: %~1
exit /b 0
35 changes: 27 additions & 8 deletions SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ exit 1


// This is for internal use only. We do not support Linux clients.
private const string FakeClientWorkerShellScript =
private const string SimulatedPlayerWorkerShellScript =
@"#!/bin/bash
NEW_USER=unrealworker
WORKER_ID=$1
Expand Down Expand Up @@ -158,16 +158,34 @@ public static void Main(string[] args)
});

var windowsNoEditorPath = Path.Combine(stagingDir, "WindowsNoEditor");

// Add a _ to the start of the exe name, to ensure it is the exe selected by the launcher.
// TO-DO: Remove this once LAUNCH-341 has been completed, and the _ is no longer necessary.
var oldExe = Path.Combine(windowsNoEditorPath, $"{gameName}.exe");
var renamedExe = Path.Combine(windowsNoEditorPath, $"_{gameName}.exe");
if (File.Exists(oldExe))
{
File.Move(oldExe, renamedExe);
}
else
{
Console.WriteLine("Could not find the executable to rename.");
}

Common.RunRedirected(@"%UNREAL_HOME%\Engine\Build\BatchFiles\RunUAT.bat", new[]
{
"ZipUtils",
"-add=" + Quote(windowsNoEditorPath),
"-archive=" + Quote(Path.Combine(outputDir, "[email protected]")),
});
}
else if (gameName == baseGameName + "FakeClient") // This is for internal use only. We do not support Linux clients.
else if (gameName == baseGameName + "FakeClient")
{
Common.WriteWarning("'FakeClient' has been renamed to 'SimulatedPlayer', please use this instead. It will create the same assembly under a different name: [email protected].");
}
else if (gameName == baseGameName + "SimulatedPlayer") // This is for internal use only. We do not support Linux clients.
{
Common.WriteHeading(" > Building fakeclient.");
Common.WriteHeading(" > Building simulated player.");
Common.RunRedirected(@"%UNREAL_HOME%\Engine\Build\BatchFiles\RunUAT.bat", new[]
{
"BuildCookRun",
Expand Down Expand Up @@ -196,8 +214,8 @@ public static void Main(string[] args)
additionalUATArgs
});

var linuxFakeClientPath = Path.Combine(stagingDir, "LinuxNoEditor");
File.WriteAllText(Path.Combine(linuxFakeClientPath, "StartWorker.sh"), FakeClientWorkerShellScript.Replace("\r\n", "\n"), new UTF8Encoding(false));
var linuxSimulatedPlayerPath = Path.Combine(stagingDir, "LinuxNoEditor");
File.WriteAllText(Path.Combine(linuxSimulatedPlayerPath, "StartWorker.sh"), SimulatedPlayerWorkerShellScript.Replace("\r\n", "\n"), new UTF8Encoding(false));

var workerCoordinatorPath = Path.GetFullPath(Path.Combine("../spatial", "build", "dependencies", "WorkerCoordinator"));
if (Directory.Exists(workerCoordinatorPath))
Expand All @@ -207,18 +225,19 @@ public static void Main(string[] args)
"/I",
"/Y",
workerCoordinatorPath,
linuxFakeClientPath
linuxSimulatedPlayerPath
});
} else
{
Console.WriteLine("worker coordinator path did not exist");
}

var archiveFileName = "[email protected]";
Common.RunRedirected(@"%UNREAL_HOME%\Engine\Build\BatchFiles\RunUAT.bat", new[]
{
"ZipUtils",
"-add=" + Quote(linuxFakeClientPath),
"-archive=" + Quote(Path.Combine(outputDir, "[email protected]")),
"-add=" + Quote(linuxSimulatedPlayerPath),
"-archive=" + Quote(Path.Combine(outputDir, archiveFileName)),
});
}
else if (gameName == baseGameName + "Server")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
Expand Down Expand Up @@ -94,5 +94,12 @@ public static void WriteHeading(string format, params object[] args)
Console.WriteLine(format, args);
Console.ForegroundColor = ConsoleColor.Gray;
}

public static void WriteWarning(string format, params object[] args)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(format, args);
Console.ForegroundColor = ConsoleColor.Gray;
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified SpatialGDK/Documentation/assets/screen-grabs/snapshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions SpatialGDK/Documentation/content/ability-system.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%(TOC)%>
# Gameplay Ability System on the GDK for Unreal

The [Gameplay Ability System](https://docs.unrealengine.com/en-us/Gameplay/GameplayAbilitySystem) is a flexible framework for building abilities and attributes of the type you might find in an RPG, MMO, or MOBA. However, as it makes use of lots of the advanced parts of the Unreal networking stack, the GDK for Unreal doesn't *currently* support it in it's entirety.
Expand Down
1 change: 1 addition & 0 deletions SpatialGDK/Documentation/content/authority.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%(TOC)%>
# Authority
To work with authority in the GDK, it’s useful to refresh on authority in Unreal’s native networking. See:

Expand Down
3 changes: 2 additions & 1 deletion SpatialGDK/Documentation/content/concepts.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%(TOC)%>
# SpatialOS concepts

See the SpatialOS documentation for guidance on the SpatialOS core concepts.
Expand All @@ -6,4 +7,4 @@ See the SpatialOS documentation for guidance on the SpatialOS core concepts.
* [World, entities, components](https://docs.improbable.io/reference/latest/shared/concepts/world-entities-components)
* [Workers and load balancing](https://docs.improbable.io/reference/latest/shared/concepts/workers-load-balancing)
* [Interest and authority](https://docs.improbable.io/reference/latest/shared/concepts/interest-authority)
* [Schema](https://docs.improbable.io/reference/latest/shared/concepts/schema)
* [Schema](https://docs.improbable.io/reference/latest/shared/concepts/schema)
4 changes: 2 additions & 2 deletions SpatialGDK/Documentation/content/cross-server-rpcs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Cross-server RPCs
<%(TOC)%>
# Cross-server RPCs

In native-Unreal networking, [RPCs (Unreal documentation)](https://docs.unrealengine.com/en-us/Gameplay/Networking/Actors/RPCs) are functions which either the client or the server use to send messages to each other over a network connection.

Expand Down Expand Up @@ -68,4 +68,4 @@ The tables below show where cross-server RPCs are executed based on where they w
| Owned by invoking client | Runs on invoking client-worker
| Owned by a different client | Runs on invoking client-worker
| Server-owned Actor | Runs on invoking client-worker
| Unowned Actor | Runs on invoking client-worker
| Unowned Actor | Runs on invoking client-worker
3 changes: 2 additions & 1 deletion SpatialGDK/Documentation/content/directory-structure.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%(TOC)%>
# Directory structure
The table below lists the contents of the GDK for Unreal repository after running `Setup.bat` to build the Unreal engine as part of [Getting started]({{urlRoot}}/content/get-started/build-unreal-fork#step-4-build-unreal-engine).

Expand All @@ -15,4 +16,4 @@ The table below lists the contents of the GDK for Unreal repository after runnin
| `SpatialGDK/Source/SpatialGDK/Private` | Contains the private source code of the GDK uplugin.
| `SpatialGDK/Source/SpatialGDK/Public/WorkerSdk/` | Not tracked in git. Contains the [C API worker SDK](https://docs.improbable.io/reference/latest/capi/introduction) headers which are used while building the GDK. You install these when you run `Setup.bat`
| `SpatialGDK/Source/SpatialGDKEditorToolbar/` | Contains the [SpatialOS GDK toolbar]({{urlRoot}}/content/toolbars.md) that appears within the Unreal Editor GUI, from which you can take snapshots, generate schemas, start and stop deployments, and access the SpatialOS Inspector.
| `ci/` | Contains scripts we use internally for our continuous integration.
| `ci/` | Contains scripts we use internally for our continuous integration.
7 changes: 4 additions & 3 deletions SpatialGDK/Documentation/content/dynamic-typebindings.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<%(TOC)%>
# Dynamic Typebindings
To allow Unreal to replicate through the SpatialOS network stack and combine multiple dedicated server instances across one seamless game world, the GDK has to adapt Unreal networking functionality to work with the [SpatialOS Worker API (SpatialOS documentation)](https://docs.improbable.io/reference/latest/capi/introduction). It does this seamlessly using `Dynamic Typebindings`.
To allow Unreal to replicate through the SpatialOS network stack and combine multiple dedicated server instances across one seamless game world, the GDK has to adapt Unreal networking functionality to work with the [SpatialOS Worker API](https://docs.improbable.io/reference/latest/capi/introduction). It does this seamlessly using `Dynamic Typebindings`.

`Dynamic Typebindings` operate at [runtime]({{urlRoot}}/content/glossary#spatialos-runtime) so that your development iteration speed is not affected, despite your network code running on a completely different representation than Unreal’s.

Expand All @@ -17,7 +18,7 @@ For Unreal Actors and sub-objects:
In addition, Unreal Actors also generate (where relevant):

* Client/Server/CrossServer RPC schema components (for example, `_MyActorClientRPCS_`)- Each RPC category has its own SpatialOS component containing all the Actor’s RPCs for that category converted into SpatialOS commands.
* NetMulticast RPC schema component (for example, `_MyActorNetMulticastRPCS_`)- Contains all the multicast RPCs callable on this Actor, converted into SpatialOS [events (SpatialOS documentation)](https://docs.improbable.io/reference/latest/shared/glossary#event).
* NetMulticast RPC schema component (for example, `_MyActorNetMulticastRPCS_`)- Contains all the multicast RPCs callable on this Actor, converted into SpatialOS [events](https://docs.improbable.io/reference/latest/shared/glossary#event).
* Static sub-object schema components - For each static sub-object present on this Actor, additional schema components are generated which wrap the replicated and handover properties defined in the components above.

> Note: The GDK doesn't currently support dynamic components.
Expand All @@ -28,4 +29,4 @@ When comparing the two network stacks, it’s useful to keep the following mappi
* Unreal Replicating Property <-> SpatialOS field
* Unreal Client/Server RPC <-> SpatialOS command
* Unreal NetMulticast RPC <-> SpatialOS event
* Unreal Replication Condition <-> SpatialOS component design
* Unreal Replication Condition <-> SpatialOS component design
3 changes: 2 additions & 1 deletion SpatialGDK/Documentation/content/generating-a-snapshot.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<%(TOC)%>
# Snapshots

A snapshot is a representation of the state of a [SpatialOS world]({{urlRoot}}/content/glossary#spatialos-world) at a given point in time. It stores each [persistent]({{urlRoot}}/content/glossary##persistence) [SpatialOS entity]({{urlRoot}}/content/glossary##spatialos-entity) and the values of their [SpatialOS components]({{urlRoot}}/content/glossary#spatialos-component)' [properties (SpatialOS documentation)](https://docs.improbable.io/reference/latest/shared/glossary#property).
A snapshot is a representation of the state of a [SpatialOS world]({{urlRoot}}/content/glossary#spatialos-world) at a given point in time. It stores each [persistent]({{urlRoot}}/content/glossary##persistence) [SpatialOS entity]({{urlRoot}}/content/glossary##spatialos-entity) and the values of their [SpatialOS components]({{urlRoot}}/content/glossary#spatialos-component)' [properties](https://docs.improbable.io/reference/latest/shared/glossary#property).

You can find out more about snapshots in the [SpatialOS snapshot documentation](https://docs.improbable.io/reference/latest/shared/operate/snapshot) but note that this documentation concentrates on working with snapshots using the [SpatialOS SDK]({{urlRoot}}/content/glossary#spatialos-sdk).

Expand Down
Loading

0 comments on commit 7110a93

Please sign in to comment.