Przeglądaj źródła

Merging dev latest

Signed-off-by: AMZN-Gene <[email protected]>
AMZN-Gene 2 lat temu
rodzic
commit
ebdaaf1638

+ 8 - 0
AssetBundling/SeedLists/GameSeedList.seed

@@ -96,6 +96,14 @@
 			<Class name="unsigned int" field="platformFlags" value="1" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
 			<Class name="unsigned int" field="platformFlags" value="1" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
 			<Class name="AZStd::string" field="pathHint" value="uicanvases/splashscreen/splashscreen.jpg.streamingimage" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
 			<Class name="AZStd::string" field="pathHint" value="uicanvases/splashscreen/splashscreen.jpg.streamingimage" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
 		</Class>
 		</Class>
+		<Class name="SeedInfo" field="element" version="2" type="{FACC3682-2ACA-4AA4-B85A-07AD276D18A0}">
+			<Class name="AssetId" field="assetId" version="1" type="{652ED536-3402-439B-AEBE-4A5DBC554085}">
+				<Class name="AZ::Uuid" field="guid" value="{775F7670-09BB-5568-8F8C-4122F68EEE30}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
+				<Class name="unsigned int" field="subId" value="595876996" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
+			</Class>
+			<Class name="unsigned int" field="platformFlags" value="1" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
+			<Class name="AZStd::string" field="pathHint" value="mpsgamelift/prefabs/gameliftconnectjsonmenu.spawnable" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
+		</Class>
 	</Class>
 	</Class>
 </ObjectStream>
 </ObjectStream>
 
 

+ 1 - 1
Documentation/PackedAssetBuilds.md

@@ -115,7 +115,7 @@ build\non_mono\bin\profile\AssetBundler.exe --project-path="c:\your\path\to\o3de
 
 
 Follow steps for "Create a bundle for game assets", "Create a bundle for engine assets" and "Add bundles to the release game layout" from https://www.o3de.org/docs/user-guide/packaging/asset-bundler/bundle-assets-for-release/
 Follow steps for "Create a bundle for game assets", "Create a bundle for engine assets" and "Add bundles to the release game layout" from https://www.o3de.org/docs/user-guide/packaging/asset-bundler/bundle-assets-for-release/
 
 
-* The "default seed lists" choice should choose all but 4 seed lists to make the `engine_pc.pak`
+* The "default seed lists" choice should choose all but 3 seed lists to make the `engine_pc.pak`
 * The other [seed lists](https://github.com/o3de/o3de-multiplayersample/tree/development/AssetBundling/SeedLists) should all get selected to make the `game_pc.pak`.
 * The other [seed lists](https://github.com/o3de/o3de-multiplayersample/tree/development/AssetBundling/SeedLists) should all get selected to make the `game_pc.pak`.
 
 
 > It's important to make sure that the bootstrap.game.profile.setreg file has been added to one of the seed files. (also add debug if you want to support debug builds)
 > It's important to make sure that the bootstrap.game.profile.setreg file has been added to one of the seed files. (also add debug if you want to support debug builds)

+ 11 - 13
MPSGameLift/Documentation/GameLift.md

@@ -38,31 +38,29 @@ This README covers optional setup, testing and running on [Amazon GameLift](http
 ---
 ---
 **NOTE**
 **NOTE**
 
 
-This will not build the game client. If you need the client for testing, also run this command:
-```sh
-cmake --build build\windows_mono --target MultiplayerSample.GameLauncher --config profile -- /m /nologo
-```
+The `--package-gamelauncher` command line option can be added to also package the game client.
+A folder named "MultiplayerSampleGamePackage" containing the game launcher will be created inside of the current working directory.
 
 
 ---
 ---
 
 
-1. Test the profile pak server and game locally
+1. Test the profile pak server and game locally without using GameLift
     Run the server in headless mode using `rhi=null` and `NullRenderer` parameters; the server appears as a white screen in headless mode.
     Run the server in headless mode using `rhi=null` and `NullRenderer` parameters; the server appears as a white screen in headless mode.
     
     
-    `C:\GameLiftPackageWindows\MultiplayerSample.ServerLauncher.exe --rhi=null -NullRenderer -bg_ConnectToAssetProcessor=0 -sys_PakPriority=2 --console-command-file=launch_server.cfg`
+    `.\GameLiftPackageWindows\MultiplayerSample.ServerLauncher.exe --rhi=null -NullRenderer --console-command-file=launch_server.cfg --net_udpDefaultTimeoutMs=20000`
     
     
-    `<path-to-multiplayer-sample>\build\windows\bin\profile\MultiplayerSample.GameLauncher.exe -bg_ConnectToAssetProcessor=0 --connect`
+    `.\MultiplayerSampleGamePackage\MultiplayerSample.GameLauncher.exe --connect=127.0.0.1 --net_udpDefaultTimeoutMs=20000`
 
 
     ---
     ---
     **NOTE**
     **NOTE**
 
 
     Launch_server.cfg is required because there's a bug with multiplayer when calling --loadlevel in the command-line. See https://github.com/o3de/o3de/issues/15773.
     Launch_server.cfg is required because there's a bug with multiplayer when calling --loadlevel in the command-line. See https://github.com/o3de/o3de/issues/15773.
-
+    net_udpDefaultTimeoutMs is increased to 20 seconds in case the initial client level load takes too long. (see https://github.com/o3de/o3de/issues/14659)
     ---
     ---
 
 
-1. Open C:\GameLiftPackageWindows\user\log\Server.log
-    You should see the "New Starbase" level loaded
+1. Open .\GameLiftPackageWindows\user\log\Server.log
+    You should see a level load command. This is the "New Starbase" level.
     ```
     ```
-    Entities from new root spawnable 'levels/newstarbase/newstarbase.spawnable' are ready
+    LoadLevel : <empty>
     ```
     ```
 
 
 
 
@@ -144,7 +142,7 @@ If the operation fails, make sure the server is running. Ensure that `InitSDK` a
 ### Start Client
 ### Start Client
 
 
 ```sh
 ```sh
-<path-to-multiplayer-sample>\build\windows_mono\bin\profile\MultiplayerSample.GameLauncher.exe -bg_ConnectToAssetProcessor=0
+.\MultiplayerSampleGamePackage\MultiplayerSample.GameLauncher.exe
 ```
 ```
 
 
 Once started, the client should show a text area where the session information needs to be pasted into. You may need to press `~` on your keyboard to open the console and release the cursor from being bound to the client window.
 Once started, the client should show a text area where the session information needs to be pasted into. You may need to press `~` on your keyboard to open the console and release the cursor from being bound to the client window.
@@ -216,7 +214,7 @@ Record GameSessionId for the next step. Example: **arn:aws:gamelift:us-west-2::g
 
 
 Launch the game client with:
 Launch the game client with:
 ```sh
 ```sh
-<path-to-multiplayer-sample>\build\windows_mono\bin\profile\MultiplayerSample.GameLauncher.exe -bg_ConnectToAssetProcessor=0
+.\MultiplayerSampleGamePackage\MultiplayerSample.GameLauncher.exe
 ```
 ```
 ```sh
 ```sh
 aws gamelift create-player-session --region <Region> --game-session-id <GameSessionId> --player-id Player1
 aws gamelift create-player-session --region <Region> --game-session-id <GameSessionId> --player-id Player1

+ 39 - 24
MPSGameLift/Scripts/export_gamelift_server_package.py

@@ -32,6 +32,7 @@ build_folder = os.path.join(o3de_context.project_path, "build", "windows")
 monolithic_build_folder = os.path.join(o3de_context.project_path, "build", "windows_mono")
 monolithic_build_folder = os.path.join(o3de_context.project_path, "build", "windows_mono")
 bundles_directory = os.path.join(o3de_context.project_path, "AssetBundling", "Bundles" )
 bundles_directory = os.path.join(o3de_context.project_path, "AssetBundling", "Bundles" )
 gamelift_package_folder_name = "GameLiftPackageWindows"
 gamelift_package_folder_name = "GameLiftPackageWindows"
+client_package_folder_name = "MultiplayerSampleGamePackage"
 
 
 o3de_logger.info(f"Exporting AWS GameLift Server Package for {project_name}")
 o3de_logger.info(f"Exporting AWS GameLift Server Package for {project_name}")
 
 
@@ -42,6 +43,7 @@ parser = argparse.ArgumentParser(
 
 
 parser.add_argument('--code', action='store_true', help='Build code')
 parser.add_argument('--code', action='store_true', help='Build code')
 parser.add_argument('--assets', action='store_true', help='Build assets')
 parser.add_argument('--assets', action='store_true', help='Build assets')
+parser.add_argument('--package-gamelauncher', action='store_true', help='Produce a client GameLauncher.exe release package along side the GameLift server package.')
 parser.add_argument('-g', '--generator', choices=['Visual Studio 16', 'Visual Studio 17'], help='Which compiler do you want to use?')
 parser.add_argument('-g', '--generator', choices=['Visual Studio 16', 'Visual Studio 17'], help='Which compiler do you want to use?')
 parser.add_argument('--no-clobber', action='store_true', dest='no_clobber', help='Do not create a new package if an existing GameLift server package exists.')
 parser.add_argument('--no-clobber', action='store_true', dest='no_clobber', help='Do not create a new package if an existing GameLift server package exists.')
 
 
@@ -112,6 +114,12 @@ if (args.code):
     if (process_command(["cmake", "--build", monolithic_build_folder, "--target", f"{project_name}.ServerLauncher", "--config", "release", "--", "/m"])):
     if (process_command(["cmake", "--build", monolithic_build_folder, "--target", f"{project_name}.ServerLauncher", "--config", "release", "--", "/m"])):
         quit()
         quit()
 
 
+    # Buld the monolithic game launcher build
+    if args.package_gamelauncher:
+        if (process_command(["cmake", "--build", monolithic_build_folder, "--target", f"{project_name}.GameLauncher", "--config", "release", "--", "/m"])):
+            quit()
+
+
 # Build Assets
 # Build Assets
 if (args.assets):
 if (args.assets):
     # Process assets
     # Process assets
@@ -151,7 +159,6 @@ if (args.assets):
     if (process_command([asset_bundler_batch, "assetLists", "--assetListFile", game_asset_list_path, "--platform", platform, "--allowOverwrites",
     if (process_command([asset_bundler_batch, "assetLists", "--assetListFile", game_asset_list_path, "--platform", platform, "--allowOverwrites",
                          "--seedListFile", os.path.join(seed_list_directory, "BasePopcornFxSeedList.seed"), 
                          "--seedListFile", os.path.join(seed_list_directory, "BasePopcornFxSeedList.seed"), 
                          "--seedListFile", os.path.join(seed_list_directory, "GameSeedList.seed"), 
                          "--seedListFile", os.path.join(seed_list_directory, "GameSeedList.seed"), 
-                         "--seedListFile", os.path.join(seed_list_directory, "ProfileOnlySeedList.seed"), 
                          "--seedListFile", os.path.join(seed_list_directory, "VFXSeedList.seed")]) != 0):
                          "--seedListFile", os.path.join(seed_list_directory, "VFXSeedList.seed")]) != 0):
         quit()
         quit()
 
 
@@ -172,26 +179,34 @@ if (args.assets):
                          "--assetListFile", engine_asset_list_path]) != 0):
                          "--assetListFile", engine_asset_list_path]) != 0):
         quit()
         quit()
 
 
-# Add all the required exe's, dll's, and asset pak files into a folder to upload to GameLift
-gamelift_package_cache_dir = os.path.join(gamelift_package_folder_name, "Cache", "pc")
-gamelift_package_gems_dir = os.path.join(gamelift_package_folder_name, "Gems", "AWSCore")
+def create_exe_package(new_package_folder_name, exe_name):
+    # Add all the required exe's, dll's, and asset pak files into a folder to upload to GameLift
+    package_cache_dir = os.path.join(new_package_folder_name, "Cache", "pc")
 
 
-# Delete the old server package
-if os.path.exists(gamelift_package_folder_name):
-    shutil.rmtree(gamelift_package_folder_name)
+    # Delete the old server package
+    if os.path.exists(new_package_folder_name):
+        shutil.rmtree(new_package_folder_name)
 
 
-# Create the folders
-os.makedirs(gamelift_package_cache_dir, exist_ok=True)
-os.makedirs(gamelift_package_gems_dir, exist_ok=True)
+    # Create the folders
+    os.makedirs(package_cache_dir, exist_ok=True)
+
+    # Copy .exe and .dll files to GameLiftWindowsServerPackage directory
+    build_dir = os.path.join(monolithic_build_folder, "bin", "release")
+    for file_name in os.listdir(build_dir):
+        file_path = os.path.join(build_dir, file_name)
+        if os.path.isfile(file_path) and file_name.lower().endswith((exe_name.lower(), '.dll')):
+            shutil.copy2(file_path, new_package_folder_name)
 
 
-# Copy .exe and .dll files to GameLiftWindowsServerPackage directory
-build_dir = os.path.join(monolithic_build_folder, "bin", "release")
-for file_name in os.listdir(build_dir):
-    file_path = os.path.join(build_dir, file_name)
-    if os.path.isfile(file_path) and file_name.lower().endswith(('.exe', '.dll')):
-        shutil.copy(file_path, gamelift_package_folder_name)
+    # Copy .pak files to Cache\pc directory
+    for file_name in os.listdir(bundles_directory):
+        if file_name.endswith(".pak"):
+            file_path = os.path.join(bundles_directory, file_name)
+            shutil.copy2(file_path, package_cache_dir)
 
 
-# Copy launch_server.cfg file to GameLiftWindowsServerPackage directory
+# Create the GameLift server package
+create_exe_package(gamelift_package_folder_name, 'ServerLauncher.exe')
+
+# GameLift server package needs launch_server.cfg file
 launch_server_cfg_filepath = os.path.join(o3de_context.project_path, "launch_server.cfg")
 launch_server_cfg_filepath = os.path.join(o3de_context.project_path, "launch_server.cfg")
 if os.path.isfile(launch_server_cfg_filepath):
 if os.path.isfile(launch_server_cfg_filepath):
     shutil.copy(launch_server_cfg_filepath, gamelift_package_folder_name)
     shutil.copy(launch_server_cfg_filepath, gamelift_package_folder_name)
@@ -199,19 +214,19 @@ else:
     o3de_logger.error(f"Could not find serverlauncher.cfg! Launch_server.cfg is required because there's a bug with multiplayer when calling --loadlevel in the command-line. See https://github.com/o3de/o3de/issues/15773.")
     o3de_logger.error(f"Could not find serverlauncher.cfg! Launch_server.cfg is required because there's a bug with multiplayer when calling --loadlevel in the command-line. See https://github.com/o3de/o3de/issues/15773.")
     quit()
     quit()
 
 
-# Copy .pak files to Cache\pc directory
-for file_name in os.listdir(bundles_directory):
-    if file_name.endswith(".pak"):
-        file_path = os.path.join(bundles_directory, file_name)
-        shutil.copy(file_path, gamelift_package_cache_dir)
-
-# Copy files to Gems\AWSCore directory
+# GameLift server needs AWSCore metadata files that have been output to the build directory.
+gamelift_package_gems_dir = os.path.join(gamelift_package_folder_name, "Gems", "AWSCore")
+os.makedirs(gamelift_package_gems_dir, exist_ok=True)
 gems_files_dir = os.path.join(monolithic_build_folder, "bin", "release", "Gems", "AWSCore")
 gems_files_dir = os.path.join(monolithic_build_folder, "bin", "release", "Gems", "AWSCore")
 for file_name in os.listdir(gems_files_dir):
 for file_name in os.listdir(gems_files_dir):
     file_path = os.path.join(gems_files_dir, file_name)
     file_path = os.path.join(gems_files_dir, file_name)
     if os.path.isfile(file_path):
     if os.path.isfile(file_path):
         shutil.copy(file_path, gamelift_package_gems_dir)
         shutil.copy(file_path, gamelift_package_gems_dir)
 
 
+# Create the Client Package
+if args.package_gamelauncher:
+    create_exe_package(client_package_folder_name, 'GameLauncher.exe')
+
 o3de_logger.info("Export Successful!\n"
 o3de_logger.info("Export Successful!\n"
                  "Test the server locally and upload the server package to GameLift.\n"
                  "Test the server locally and upload the server package to GameLift.\n"
                  f"Example: aws gamelift upload-build --server-sdk-version 5.0.0 --operating-system WINDOWS_2016 --build-root .\GameLiftPackageWindows\ --name {project_name} --build-version v1.0 --region us-west-2")
                  f"Example: aws gamelift upload-build --server-sdk-version 5.0.0 --operating-system WINDOWS_2016 --build-root .\GameLiftPackageWindows\ --name {project_name} --build-version v1.0 --region us-west-2")