You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/unity/part-3.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -610,7 +610,7 @@ The `OnApplied` callback will be called after the server synchronizes the initia
610
610
611
611
In the scene view, select the `GameManager` object. Click on the `Border Material` property and choose `Sprites-Default`.
612
612
613
-
### Creating GameObjects
613
+
### Creating GameObjects
614
614
615
615
Now that we have our arena all set up, we need to take the row data that SpacetimeDB syncs with our client and use it to create and draw `GameObject`s on the screen.
Copy file name to clipboardExpand all lines: docs/docs/unreal/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Need help with the tutorial or CLI commands? [Join our Discord server](https://d
4
4
5
5
In this tutorial you'll learn how to build a small-scoped MMORPG in Unreal, from scratch, using SpacetimeDB. Although, the game we're going to build is small in scope, it'll scale to hundreds of players and will help you get acquainted with all the features and best practices of SpacetimeDB, while building [a fun little game](https://github.com/ClockworkLabs/Blackholio).
6
6
7
-
By the end, you should have a basic understanding of what SpacetimeDB offers for developers making multiplayer games.
7
+
By the end, you should have a basic understanding of what SpacetimeDB offers for developers making multiplayer games.
8
8
9
9
The game is inspired by [agar.io](https://agar.io), but SpacetimeDB themed with some fun twists. If you're not familiar [agar.io](https://agar.io), it's a web game in which you and hundreds of other players compete to cultivate mass to become the largest cell in the Petri dish.
Copy file name to clipboardExpand all lines: docs/docs/unreal/part-1.md
+19-12Lines changed: 19 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@ Need help with the tutorial? [Join our Discord server](https://discord.gg/spacet
8
8
9
9
## Prepare Project Structure
10
10
11
+
> **NOTE:** Ensure you have SpacetimeDB version 1.4.0 installed to enable Unreal Engine code generation support.
12
+
11
13
This project is separated into two subdirectories;
12
14
13
15
1. Server (module) code
@@ -49,33 +51,38 @@ While the SpacetimeDB Unreal client SDK is in preview releases, it can only be i
49
51
50
52
Once the SDK is stabilized, we'll find a more ergonomic way to distribute it.
51
53
52
-
Before beginning make sure to close the Unreal project and IDE.
54
+
> **Note:**Before beginning make sure to close the Unreal project and IDE.
53
55
54
-
Add the SpacetimeDB Unreal SDK by first adding a new plugin folder:
55
-
```bash
56
-
cd client_unreal
57
-
md Plugins
58
-
```
59
-
Copy the SpacetimeDbSdk to the new Plugins folder. This should create `/client_unreal/Plugins/SpacetimeDbSdk`.
56
+
#### Installation steps
60
57
61
-
In the root of the Unreal project, right click the client_unreal.uproject and select **Generate Visual Studio project files**.
58
+
1. Navigate to your Unreal project directory and create a `Plugins` folder if it doesn’t already exist:
59
+
```bash
60
+
cd client_unreal
61
+
mkdir Plugins
62
+
```
63
+
2. Download or clone the SDK from GitHub and copy the SpacetimeDbSdk folder into your new Plugins directory.
64
+
- This should create `/client_unreal/Plugins/SpacetimeDbSdk`.
65
+
3. In the root of the Unreal project, right click the client_unreal.uproject and select **Generate Visual Studio project files**. On Windows 11 you may need to expand **Show more options** to select the generate option.
1. Open the `client_unreal` project. Unreal will prompt you to build the `SpacetimeDbSdk` plugin. Do so.
72
+
1. Open the `client_unreal` project in your IDE (Visual Studio or JetBrains Rider) and run the project to launch the Unreal Editor.
73
+
- This will enable **Live Coding**, making the workflow a bit smoother.
74
+
- Unreal will prompt you to build the `SpacetimeDbSdk` plugin. Do so.
68
75
2. Open **Tools -> New C++ Class** in the top menu, select **Actor** as the parent and click **Next**
69
76
3. Select **Public** Class Type
70
77
4. Name the class `GameManager`.
71
78
72
79
The `GameManager` class will be where we will put the high level initialization and coordination logic for our game.
73
80
74
-
> Note: In a production Unreal project, you would typically implement this logic in a Subsystem. For simplicity, this tutorial uses a singleton actor.
81
+
> **Note:** In a production Unreal project, you would typically implement this logic in a Subsystem. For simplicity, this tutorial uses a singleton actor.
75
82
76
83
### Set Up the Level
77
84
78
-
Set up the basic level, add the new `GameManager` to the level, and add lighting.
85
+
Set up the empty level, add the new `GameManager` to the level, and add lighting.
79
86
80
87
1.**Create a new level**
81
88
- Open **File -> New Level** in the top menu, select **Empty Level**, and click **Create**.
This will generate a set of files in the `client_unreal/Source/client_unreal/Private/ModuleBindings` and `client_unreal/Source/client_unreal/Public/ModuleBindings` directories which contain the code generated types and reducer functions that are defined in your module, but usable on the client.
445
445
446
+
> **Note:**`--uproject-dir` is straightforward as the path to the .uproject file. `--module-name` is the name of the Unreal module which in most projects is the name of the project, in this case `client_unreal`.
447
+
446
448
```
447
449
├── Reducers
448
450
│ └── Connect.g.h
@@ -467,7 +469,7 @@ This will also generate a file in the `client_unreal/Source/client_unreal/Privat
467
469
468
470
### Connecting to the Database
469
471
470
-
Update `client_unreal.Build.cs` to include the `SpacetimeDbSdk`. Add `SpacetimeDbSdk` to `PublicDependencyModuleNames`, and confirm that `PrivateDependencyModuleNames` includes the following modules for current and future needs:
472
+
Update `client_unreal.Build.cs` to include the `SpacetimeDbSdk`. Add `SpacetimeDbSdk`and `Paper2D`to `PublicDependencyModuleNames`, and confirm that `PrivateDependencyModuleNames` includes the following modules for current and future needs:
The `AGameManager()` constructor in `GameManager.cpp` includes an `InstancedStaticMeshComponent` to set up the cube. Update the constructor as follows:
0 commit comments