This README covers installation and running MultiplayerSample project on Ubuntu Linux. Refer Open 3D Engine on Linux for setting up the engine on Linux.
This repository uses Git LFS to store large binary files. A GitHub personal access token is required to authenticate with the Git LFS service. You can setup your personal access token and credential manager with the following steps:
-
Create a Git Personal Access Token. Your personal access token credentials are required for authentication when you clone the repository. For more information, refer to Create a personal access token with the 'repo' scope.
-
Verify you have a credential manager installed and configured. Recent versions of Git install a credential manager so that your credentials are stored and supplied automatically when required.
These instructions use the following installation paths. Be sure to substitute your local installation paths:
- O3DE installation root:
$HOME/o3de/
- O3DE 3rd-party packages root:
$HOME/o3de-packages/
NOTE: You can clone the project to any local directory. If you clone the project inside an existing Git repository directory (for example, the directory that contains your local O3DE engine repository) you should add the o3de-multiplayersample project directory to the Git exclude file for the existing Git repository.
-
In a terminal,
cd
to the local directory where you'd like to clone the project, for example:mkdir $HOME/my-o3de-projects cd $HOME/my-o3de-projects
-
Clone the project.
git clone https://github.com/o3de/o3de-multiplayersample.git Cloning into 'o3de-multiplayersample'...
-
Clone the assets. In this example the assets are cloned beside the muliplayersample project.
git clone https://github.com/o3de/o3de-multiplayersample-assets.git Cloning into 'o3de-multiplayersample-assets'...
-
From inside your clone of o3de-multiplayersample-assets, update the submodules. This step adds some required content such as the PopcornFX Gem.
cd o3de-multiplayersample-assets git submodule update --init --recursive
-
From your root project folder clone O3DE-Extras. The O3DE-Extras repo is required for the WWISE Audio gem.
cd $HOME/my-o3de-projects git clone https://github.com/o3de/o3de-extras/
-
Clone the project into a directory named 'o3de-multiplayersample' in your existing engine repository directory.
git clone https://github.com/o3de/o3de-multiplayersample.git $HOME/o3de/o3de-multiplayersample Cloning into 'o3de-multiplayersample'...
-
Clone the asset Gems into a directory named 'o3de-multiplayersample-assets' in your existing engine Gems directory.
git clone https://github.com/o3de/o3de-multiplayersample-assets.git $HOME/o3de/gems/o3de-multiplayersample-assets Cloning into 'o3de-multiplayersample-assets'...
-
From inside your clone of o3de-multiplayersample-assets, update the submodules. This step adds some required content such as the PopcornFX Gem.
cd $HOME/o3de/gems/o3de-multiplayersample-assets git submodule update --init --recursive
-
Modify the local engine git exclude file to ignore the project directory.
echo o3de-multiplayersample > $HOME/o3de/.git/info/exclude echo o3de-multiplayersample-assets > $HOME/o3de/.git/info/exclude
NOTE: The following steps only need to be performed once.
-
Register the engine.
$HOME/o3de/scripts/o3de register --this-engine
-
Register the asset Gems.
$HOME/o3de/scripts/o3de register --all-gems-path $HOME/my-o3de-projects/o3de-multiplayersample-assets/Gems
-
Register the audio gem.
$HOME/o3de/scripts/o3de register --gem-path $HOME/my-o3de-projects/o3de-extras/Gems/AudioEngineWwise/
-
Register the project.
$HOME/o3de/scripts/o3de register -p $HOME/my-o3de-projects/o3de-multiplayersample
The final step prints warnings that the compatibility check for MultiplayerSample and Blast will be skipped. These warnings can be ignored.
This option outputs all the project binaries in the project's build directory (for example $HOME/my-o3de-projects/o3de-multiplayersample/build
). The following commands are run from the o3de-multiplayersample
project directory.
-
Example project-centric configure command.
cmake -B build/linux -S . -G "Ninja Multi-Config" -DLY_3RDPARTY_PATH=$HOME/o3de-packages
-
Example project-centric build command.
cmake --build build/linux --target Editor MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher --config profile -j 8
This option will output all the project and engine binaries in the engine's build directory (for example, $HOME/o3de/build
).
-
Example engine-centric configure command.
cmake -S $HOME/o3de -B $HOME/o3de/build/linux -G "Ninja Multi-Config" -DLY_3RDPARTY_PATH=$HOME/o3de-packages -DLY_PROJECTS="$HOME/my-o3de-projects/o3de-multiplayersample"
-
Example engine-centric build command.
cmake --build $HOME/o3de/build/linux --target Editor MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher --config profile -j 8
Under project root, there are two files: launch_client.cfg
and launch_server.cfg
.
-
launch_client.cfg
contains the client connection setting. To connect to a server that is running locally, add the following line:connect
To connect to a remote server, add the IP address of the server after the connect statement. For example:
connect 192.168.0.20
-
launch_server.cfg
contains the initial level to load:LoadLevel Levels/NewStarbase/NewStarbase.spawnable
NOTE: The commands in the following sections are run from the project root directory or the engine root directory depending on how the project was built in Step 3.
./build/linux/bin/profile/MultiplayerSample.ServerLauncher --console-command-file=launch_server.cfg
Note that the launch_server.cfg
configuration file is passed with the --console-command-file
argument.
Alternatively, you can run launch_server.sh
which includes the --console-command-file
argument.
./launch_server.sh
If you do not need to see rendered output on your server, you can reduce resource usage by launching a headless server that uses the null renderer.
NOTE: Parameters to use null renderer must be passed on the command line as the console-command-file is parsed after rendering is configured.
./build/linux/bin/profile/MultiplayerSample.ServerLauncher --console-command-file=launch_server.cfg -rhi=null -NullRenderer
The client launcher can be run with the following command:
./build/linux/bin/profile/MultiplayerSample.GameLauncher --console-command-file=launch_client.cfg
This command starts the client and connects to the server specified in launch_client.cfg
.
Alternatively, you can run launch_client.cmd
(Windows) or launch_client.sh
(Unix) which includes the --console-command-file
argument.
./launch_client.cmd
For terms please see the LICENSE*.TXT files included in the root of this distribution.