Ingen beskrivning

Alex Peterson ec2291ccb0 Merge pull request #202 from o3de/stabilization/2210 2 år sedan
.github ce015bf1e6 Add initial bug and feature templates 3 år sedan
BURT 861e63dd50 Fixed casing of all .fbx.assetinfo files to match their .fbx (#84) 3 år sedan
Config a9c9a11fc4 Setup repository content 4 år sedan
Gem 1c0c32820d Merge pull request #176 from aws-lumberyard-dev/GHI_9622_10824_ClientServerFix 3 år sedan
InputBindings 3d71ca9275 Adding in in-progress input bindings for improved camera controls (not fully hooked up yet) 3 år sedan
Jack e2feca38ed Updated the @assets@ alias to be @projectproductassets@ 3 år sedan
Levels 8d0c76608b Updating demo placards to use textures instead of rendering them out with LyShine rendertargets so that they can also appear on server. Removing old placard tech since it isn't needed 3 år sedan
LightingPresets a9c9a11fc4 Setup repository content 4 år sedan
Materials 8d0c76608b Updating demo placards to use textures instead of rendering them out with LyShine rendertargets so that they can also appear on server. Removing old placard tech since it isn't needed 3 år sedan
Objects 419b3cfb68 Added test assets 4 år sedan
Platform 9f0d624b82 Updated the README.md to account for the correct source folder path to 3 år sedan
Prefabs ae15f18d51 Fixing SpawningPerfTest by adding the new player spawner component to the SpawningPerfTest. Applying ranom movements to the test boxes over time instead of using physX because physX had a performance bug. 3 år sedan
Registry cd1f18c9b3 Updated the MultiplayerSampleData ScanFolder to use a portable reference 3 år sedan
Scripts 7e18336312 Merged linux readme and jenkins changes from dev to stab/2110 3 år sedan
ShaderLib e7d22b7afc Merged main 4 år sedan
Shaders bb83e9c6c1 Final update copyright headers to reference license files at the repo root (#23) 4 år sedan
cmake 0bdec351ab Adapts to new template (#98) 3 år sedan
scriptcanvas 76ad4e9b05 Add missing spawn ticket ref to SpawnIfAuthority.sc and fix misnamed cfg var 3 år sedan
.gitattributes 9cd7e08167 Initial commit 4 år sedan
.gitignore 9cd7e08167 Initial commit 4 år sedan
.lfsconfig d139a3a602 Updating .lfsconfig comments only 4 år sedan
CMakeLists.txt 0bdec351ab Adapts to new template (#98) 3 år sedan
LICENSE.txt 93c55dc674 o3de-multiplayersample main - license update 4 år sedan
LICENSE_APACHE2.TXT 93c55dc674 o3de-multiplayersample main - license update 4 år sedan
LICENSE_MIT.TXT 93c55dc674 o3de-multiplayersample main - license update 4 år sedan
README.md f72064d678 Spelling fix 3 år sedan
README_LINUX.md 82d99aa1eb Add instructions about null renderer (#140) 3 år sedan
default.blastconfiguration a9c9a11fc4 Setup repository content 4 år sedan
editor.cfg 76ad4e9b05 Add missing spawn ticket ref to SpawnIfAuthority.sc and fix misnamed cfg var 3 år sedan
game.cfg a9c9a11fc4 Setup repository content 4 år sedan
generate_asset_cmake.bat bb83e9c6c1 Final update copyright headers to reference license files at the repo root (#23) 4 år sedan
launch_client.cfg 24a5096097 Misc cfg cleanup to help prevent workflow-6 (multiplayer) confusion. Removed unused autoexec.cfg, we can bring this back as needed for autolaunching a starter level for releases, but it wasnt being used and still using old cry map commands. Moved as many cvars out of Editor.cfg into the proper commands.editor.setreg; note we still need Editor.cfg to load the legacy cry cvars. Added cmd's to partner up with the server/client cfg so users know those cfg's arn't automatically loaded and instead need to be used in a commandline 3 år sedan
launch_client.cmd 1ea3c9bfc3 Adding sh script for opening client and server for linux users 3 år sedan
launch_client.sh 1ea3c9bfc3 Adding sh script for opening client and server for linux users 3 år sedan
launch_server.cfg 24a5096097 Misc cfg cleanup to help prevent workflow-6 (multiplayer) confusion. Removed unused autoexec.cfg, we can bring this back as needed for autolaunching a starter level for releases, but it wasnt being used and still using old cry map commands. Moved as many cvars out of Editor.cfg into the proper commands.editor.setreg; note we still need Editor.cfg to load the legacy cry cvars. Added cmd's to partner up with the server/client cfg so users know those cfg's arn't automatically loaded and instead need to be used in a commandline 3 år sedan
launch_server.cmd 1ea3c9bfc3 Adding sh script for opening client and server for linux users 3 år sedan
launch_server.sh 1ea3c9bfc3 Adding sh script for opening client and server for linux users 3 år sedan
multiplayersample_asset_files.cmake bb83e9c6c1 Final update copyright headers to reference license files at the repo root (#23) 4 år sedan
preview.png 3c4b190fd7 Updating icon to have 2 players, this is multiplayer after all! 3 år sedan
project.json a977d1c62a Updated the origin, license and summaryfields in the MultiplayerSample 3 år sedan

README.md

MultiplayerSample Project

A simple third-person multiplayer sample for O3DE.

NOTE: For Linux, see the Linux specific setup in README_LINUX.

Download and Install

This repository uses Git LFS for storing large binary files. You will need to create a Github personal access token to authenticate with the LFS service.

Create a Git Personal Access Token

You will need your personal access token credentials to authenticate when you clone the repository.

Create a personal access token with the 'repo' scope.

(Recommended) Verify you have a credential manager installed to store your credentials

Recent versions of Git install a credential manager to store your credentials so you don't have to put in the credentials for every request. It is highly recommended you check that you have a credential manager installed and configured

Step 1. Clone the repository

You can clone the project to any folder locally, including inside the engine folder. If you clone the project inside an existing Git repository (e.g. o3de) you should add the project folder to the Git exclude file for the existing repository.

Option #1 (Recommended) - cloning into a folder outside the engine repository folder

# clone the project into a folder outside your engine repository folder
> git clone https://github.com/o3de/o3de-multiplayersample.git
Cloning into 'o3de-multiplayersample'...

Option #2 - cloning into the engine repository folder

# clone the project into a folder named 'o3de-multiplayersample' in your existing engine repository folder
> git clone https://github.com/o3de/o3de-multiplayersample.git c:/path/to/o3de/o3de-multiplayersample
Cloning into 'o3de-multiplayersample'...

# modify the local engine git exclude file to ignore the project folder
> echo o3de-multiplayersample > c:/path/to/o3de/.git/info/exclude

If you have a Git credential helper configured, you should not be prompted for your credentials anymore.

Step 2. Register the engine and project

# register the engine (only need to do this once)
> c:/path/to/o3de/scripts/o3de register --this-engine

# register the project
> c:/path/to/o3de/scripts/o3de register -p c:/path/to/o3de-multiplayersample

Step 3. Configure and build

Option #1 (Recommended) - Project-centric approach

This option will output all the project binaries in the project's build folder e.g. c:/path/to/o3de-multiplayersample/build

# example configure command
> cmake -S c:/path/to/o3de-multiplayersample -B c:/path/to/o3de-multiplayersample/build/windows_vs2019 -G "Visual Studio 16" -DLY_3RDPARTY_PATH="c:/3rdparty"

# example build command
> cmake --build c:/path/to/o3de-multiplayersample/build/windows_vs2019 --target Editor MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher --config profile -- /m /nologo

Option #2 - Engine-centric approach to building a project

This option will output all the project and engine binaries in the engine's build folder e.g. c:/path/to/o3de/build

# example configure command
> cmake -S c:/path/to/o3de -B c:/path/to/o3de/build/windows_vs2019 -G "Visual Studio 16" -DLY_3RDPARTY_PATH="c:/3rdparty" -DLY_PROJECTS="c:/path/to/o3de-multiplayersample"

# example build command
> cmake --build c:/path/to/o3de/build/windows_vs2019 --target Editor MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher --config profile -- /m /nologo

Step 4. Setup Client and Server

Under project root, there should be 2 files: launch_client.cfg and launch_server.cfg. File launch_client.cfg should contain:

connect

File launch_server.cfg should contain:

host
LoadLevel Levels/SampleBase/SampleBase.spawnable

Running the Server

A server can be run as follows

MultiplayerSample.ServerLauncher.exe --console-command-file=launch_server.cfg 

Notice the launch_server.cfg is passed into the commandline. Any file passed into the console-command-file argument will be used when starting up the application. For convenience you can run launch_server.cmd (Windows) or launch_server.sh (Unix) directly.

(Optional) Running the Server Headless

If you do not need to see rendered output on your servers, you can reduce resource usage by using 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.

MultiplayerSample.ServerLauncher.exe --console-command-file=launch_server.cfg -rhi=null -NullRenderer

Running the Server in the Editor

By default, launching a local server from the editor during Play Mode is enabled. To disable this behavior, update the editorsv_enabled value in the editor.cfg file to false.

Refer to the O3DE document Test Multiplayer Games in the O3DE Editor for the complete list of console variables (cvar) which support play in the editor with servers.

Running the Client

A client can be run with:

MultiplayerSample.GameLauncher.exe --console-command-file=launch_client.cfg

This will connect a client to the local server and start a multiplayer session. For convenience you can run launch_client.cmd (Windows) or launch_client.sh (Unix) directly.

Debugging in Visual Studio

When debugging MultiplayerSample.GameLauncher and MultiplayerSample.ServerLauncher from Visual Studio it's helpful to automatically host and connect; thereby avoiding having to open the console (~) once the application opens and explicitly executing the 'host' and 'loadlevel' command on server, or the 'connect' command on client. For convenience, Gem/Code/CMakeLists.txt defines ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS which allows Visual Studio to automatically populate the debugger with command arguments. By default, launch_client.cfg is used when debugging the GameLauncher and launch_server.cfg is used when debugging the ServerLauncher.

More Information

License

For terms please see the LICENSE*.TXT file at the root of this distribution.