From 10e6e9f32b3c1733ff000f8f8f2a28eaf07478a9 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Fri, 29 Oct 2021 18:59:56 -0400 Subject: [PATCH 01/71] Added jenkinsfile Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Scripts/build/Jenkins/Jenkinsfile | 604 ++++++++++++++++++++++++++++++ 1 file changed, 604 insertions(+) create mode 100644 Scripts/build/Jenkins/Jenkinsfile diff --git a/Scripts/build/Jenkins/Jenkinsfile b/Scripts/build/Jenkins/Jenkinsfile new file mode 100644 index 000000000..5e3afa372 --- /dev/null +++ b/Scripts/build/Jenkins/Jenkinsfile @@ -0,0 +1,604 @@ +#!/usr/bin/env groovy +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +PIPELINE_CONFIG_FILE = 'scripts/build/Jenkins/lumberyard.json' +INCREMENTAL_BUILD_SCRIPT_PATH = 'scripts/build/bootstrap/incremental_build_util.py' + +EMPTY_JSON = readJSON text: '{}' + +PROJECT_REPOSITORY_NAME = 'o3de-multiplayersample' +PROJECT_ORGANIZATION_NAME = 'o3de' +ENGINE_REPOSITORY_NAME = 'o3de' +ENGINE_ORGANIZATION_NAME = 'o3de' +ENGINE_BRANCH_DEFAULT = "${env.BRANCH_DEFAULT}" ?: "${env.BRANCH_NAME}" + +def pipelineProperties = [] + +def pipelineParameters = [ + // Build/clean Parameters + // The CLEAN_OUTPUT_DIRECTORY is used by ci_build scripts. Creating the parameter here passes it as an environment variable to jobs and is consumed that way + booleanParam(defaultValue: false, description: 'Deletes the contents of the output directory before building. This will cause a \"clean\" build. NOTE: does not imply CLEAN_ASSETS', name: 'CLEAN_OUTPUT_DIRECTORY'), + booleanParam(defaultValue: false, description: 'Deletes the contents of the output directories of the AssetProcessor before building.', name: 'CLEAN_ASSETS'), + booleanParam(defaultValue: false, description: 'Deletes the contents of the workspace and forces a complete pull.', name: 'CLEAN_WORKSPACE'), + booleanParam(defaultValue: false, description: 'Recreates the volume used for the workspace. The volume will be created out of a snapshot taken from main.', name: 'RECREATE_VOLUME'), + stringParam(defaultValue: "${ENGINE_BRANCH_DEFAULT}", description: 'Sets a different branch from o3de engine repo to use or use commit id. Default is branchname', trim: true, name: 'ENGINE_BRANCH') +] + +def PlatformSh(cmd, lbl = '', winSlashReplacement = true) { + if (env.IS_UNIX) { + sh label: lbl, + script: cmd + } else if (winSlashReplacement) { + bat label: lbl, + script: cmd.replace('/','\\') + } else { + bat label: lbl, + script: cmd + } +} + +def PlatformMkdir(path) { + if (env.IS_UNIX) { + sh label: "Making directories ${path}", + script: "mkdir -p ${path}" + } else { + def win_path = path.replace('/','\\') + bat label: "Making directories ${win_path}", + script: "mkdir ${win_path}." + } +} + +def PlatformRm(path) { + if (env.IS_UNIX) { + sh label: "Removing ${path}", + script: "rm ${path}" + } else { + def win_path = path.replace('/','\\') + bat label: "Removing ${win_path}", + script: "del /Q ${win_path}" + } +} + +def PlatformRmDir(path) { + if (env.IS_UNIX) { + sh label: "Removing ${path}", + script: "rm -rf ${path}" + } else { + def win_path = path.replace('/','\\') + bat label: "Removing ${win_path}", + script: "rd /s /q ${win_path}" + } +} + +def IsPullRequest(branchName) { + // temporarily using the name to detect if we are in a PR + // In the future we will check with github + return branchName.startsWith('PR-') +} + +def IsJobEnabled(branchName, buildTypeMap, pipelineName, platformName) { + if (IsPullRequest(branchName)) { + return buildTypeMap.value.TAGS && buildTypeMap.value.TAGS.contains(pipelineName) + } + def job_list_override = params.JOB_LIST_OVERRIDE ? params.JOB_LIST_OVERRIDE.tokenize(',') : '' + if (!job_list_override.isEmpty()) { + return params[platformName] && job_list_override.contains(buildTypeMap.key); + } else { + return params[platformName] && buildTypeMap.value.TAGS && buildTypeMap.value.TAGS.contains(pipelineName) + } +} + +def GetRunningPipelineName(JENKINS_JOB_NAME) { + // If the job name has an underscore + def job_parts = JENKINS_JOB_NAME.tokenize('/')[0].tokenize('_') + if (job_parts.size() > 1) { + return [job_parts.take(job_parts.size() - 1).join('_'), job_parts[job_parts.size()-1]] + } + return [job_parts[0], 'default'] +} + +@NonCPS +def RegexMatcher(str, regex) { + def matcher = (str =~ regex) + return matcher ? matcher.group(1) : null +} + +def LoadPipelineConfig(String pipelineName, String branchName) { + echo 'Loading pipeline config' + def pipelineConfig = {} + pipelineConfig = readJSON file: PIPELINE_CONFIG_FILE + PlatformRm(PIPELINE_CONFIG_FILE) + pipelineConfig.platforms = EMPTY_JSON + + // Load the pipeline configs per platform + pipelineConfig.PIPELINE_CONFIGS.each { pipeline_config -> + def platform_regex = pipeline_config.replace('.','\\.').replace('*', '(.*)') + if (!env.IS_UNIX) { + platform_regex = platform_regex.replace('/','\\\\') + } + echo "Searching platform pipeline configs in ${pipeline_config} using ${platform_regex}" + for (pipeline_config_path in findFiles(glob: pipeline_config)) { + echo "\tFound platform pipeline config ${pipeline_config_path}" + def platform = RegexMatcher(pipeline_config_path, platform_regex) + if (platform) { + pipelineConfig.platforms[platform] = EMPTY_JSON + pipelineConfig.platforms[platform].PIPELINE_ENV = readJSON file: pipeline_config_path.toString() + } + PlatformRm(pipeline_config_path.toString()) + } + } + + // Load the build configs + pipelineConfig.BUILD_CONFIGS.each { build_config -> + def platform_regex = build_config.replace('.','\\.').replace('*', '(.*)') + if (!env.IS_UNIX) { + platform_regex = platform_regex.replace('/','\\\\') + } + echo "Searching configs in ${build_config} using ${platform_regex}" + for (build_config_path in findFiles(glob: build_config)) { + echo "\tFound config ${build_config_path}" + def platform = RegexMatcher(build_config_path, platform_regex) + if (platform) { + pipelineConfig.platforms[platform].build_types = readJSON file: build_config_path.toString() + } + } + } + return pipelineConfig +} + +def GetBuildEnvVars(Map platformEnv, Map buildTypeEnv, String pipelineName) { + def envVarMap = [:] + platformPipelineEnv = platformEnv['ENV'] ?: [:] + platformPipelineEnv.each { var -> + envVarMap[var.key] = var.value + } + platformEnvOverride = platformEnv['PIPELINE_ENV_OVERRIDE'] ?: [:] + platformPipelineEnvOverride = platformEnvOverride[pipelineName] ?: [:] + platformPipelineEnvOverride.each { var -> + envVarMap[var.key] = var.value + } + buildTypeEnv.each { var -> + // This may override the above one if there is an entry defined by the job + envVarMap[var.key] = var.value + } + + // Environment that only applies to to Jenkins tweaks. + // For 3rdParty downloads, we store them in the EBS volume so we can reuse them across node + // instances. This allow us to scale up and down without having to re-download 3rdParty + envVarMap['LY_PACKAGE_DOWNLOAD_CACHE_LOCATION'] = "${envVarMap['WORKSPACE']}/3rdParty/downloaded_packages" + envVarMap['LY_PACKAGE_UNPACK_LOCATION'] = "${envVarMap['WORKSPACE']}/3rdParty/packages" + + return envVarMap +} + +def GetEnvStringList(Map envVarMap) { + def strList = [] + envVarMap.each { var -> + strList.add("${var.key}=${var.value}") + } + return strList +} + +def GetEngineRemoteConfig(remoteConfigs) { + def engineRemoteConfigs = [name: "${ENGINE_REPOSITORY_NAME}", + url: remoteConfigs.url[0] + .replace("${PROJECT_REPOSITORY_NAME}", "${ENGINE_REPOSITORY_NAME}") + .replace("/${PROJECT_ORGANIZATION_NAME}/", "/${ENGINE_ORGANIZATION_NAME}/"), + credentialsId: remoteConfigs.credentialsId[0] + ] + return engineRemoteConfigs +} + +def CheckoutBootstrapScripts(String branchName) { + checkout([$class: 'GitSCM', + branches: [[name: "*/${branchName}"]], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'PruneStaleBranch'], + [$class: 'AuthorInChangelog'], + [$class: 'SparseCheckoutPaths', sparseCheckoutPaths: [ + [ $class: 'SparseCheckoutPath', path: 'scripts/build/Jenkins/' ], + [ $class: 'SparseCheckoutPath', path: 'scripts/build/bootstrap/' ], + [ $class: 'SparseCheckoutPath', path: 'scripts/build/Platform' ] + ]], + // Shallow checkouts break changelog computation. Do not enable. + [$class: 'CloneOption', noTags: false, reference: '', shallow: false] + ], + submoduleCfg: [], + userRemoteConfigs: [GetEngineRemoteConfig(scm.userRemoteConfigs)] + ]) +} + +def CheckoutRepo(boolean disableSubmodules = false) { + + def projectsAndUrl = [ + "${ENGINE_REPOSITORY_NAME}": GetEngineRemoteConfig(scm.userRemoteConfigs), + "${PROJECT_REPOSITORY_NAME}": scm.userRemoteConfigs[0] + ] + + projectsAndUrl.each { projectAndUrl -> + if (!fileExists(projectAndUrl.key)) { + PlatformMkdir(projectAndUrl.key) + } + dir(projectAndUrl.key) { + if (fileExists('.git')) { + // If the repository after checkout is locked, likely we took a snapshot while git was running, + // to leave the repo in a usable state, garbage collect. + def indexLockFile = '.git/index.lock' + if (fileExists(indexLockFile)) { + PlatformSh('git gc', 'Git GarbageCollect') + } + if (fileExists(indexLockFile)) { // if it is still there, remove it + PlatformRm(indexLockFile) + } + } + } + } + + def random = new Random() + def retryAttempt = 0 + retry(5) { + if (retryAttempt > 0) { + sleep random.nextInt(60 * retryAttempt) // Stagger checkouts to prevent HTTP 429 (Too Many Requests) response from Github + } + retryAttempt = retryAttempt + 1 + projectsAndUrl.each { projectAndUrl -> + dir(projectAndUrl.key) { + def branchName = scm.branches + if (projectAndUrl.key == "${ENGINE_REPOSITORY_NAME}") { + branchName = [[name: params.ENGINE_BRANCH]] + } + checkout scm: [ + $class: 'GitSCM', + branches: branchName, + extensions: [ + [$class: 'PruneStaleBranch'], + [$class: 'AuthorInChangelog'], + [$class: 'SubmoduleOption', disableSubmodules: disableSubmodules, recursiveSubmodules: true], + [$class: 'CheckoutOption', timeout: 60] + ], + userRemoteConfigs: [projectAndUrl.value] + ] + } + } + } + + // CHANGE_ID is used by some scripts to identify uniquely the current change (usually metric jobs) + dir(PROJECT_REPOSITORY_NAME) { + PlatformSh('git rev-parse HEAD > commitid', 'Getting commit id') + env.CHANGE_ID = readFile file: 'commitid' + env.CHANGE_ID = env.CHANGE_ID.trim() + PlatformRm('commitid') + // CHANGE_DATE is used by the installer to provide some ability to sort tagged builds in addition to BRANCH_NAME and CHANGE_ID + commitDateFmt = '%%cI' + if (env.IS_UNIX) commitDateFmt = '%cI' + + PlatformSh("git show -s --format=${commitDateFmt} ${env.CHANGE_ID} > commitdate", 'Getting commit date') + env.CHANGE_DATE = readFile file: 'commitdate' + env.CHANGE_DATE = env.CHANGE_DATE.trim() + PlatformRm('commitdate') + } +} + +def PreBuildCommonSteps(Map pipelineConfig, String repositoryName, String projectName, String pipeline, String branchName, String platform, String buildType, String workspace, boolean mount = true, boolean disableSubmodules = false) { + echo 'Starting pre-build common steps...' + + if (mount) { + unstash name: 'incremental_build_script' + + def pythonCmd = '' + if (env.IS_UNIX) pythonCmd = 'sudo -E python3 -u ' + else pythonCmd = 'python3 -u ' + + if (env.RECREATE_VOLUME?.toBoolean()) { + PlatformSh("${pythonCmd} ${INCREMENTAL_BUILD_SCRIPT_PATH} --action delete --repository_name ${repositoryName} --project ${projectName} --pipeline ${pipeline} --branch ${branchName} --platform ${platform} --build_type ${buildType}", 'Deleting volume', winSlashReplacement=false) + } + timeout(5) { + PlatformSh("${pythonCmd} ${INCREMENTAL_BUILD_SCRIPT_PATH} --action mount --repository_name ${repositoryName} --project ${projectName} --pipeline ${pipeline} --branch ${branchName} --platform ${platform} --build_type ${buildType}", 'Mounting volume', winSlashReplacement=false) + } + + if (env.IS_UNIX) { + sh label: 'Setting volume\'s ownership', + script: """ + if sudo test ! -d "${workspace}"; then + sudo mkdir -p ${workspace} + cd ${workspace}/.. + sudo chown -R lybuilder:root . + fi + """ + } + } + + // Cleanup previous repo location, we are currently at the root of the workspace, if we have a .git folder + // we need to cleanup. Once all branches take this relocation, we can remove this + if (env.CLEAN_WORKSPACE?.toBoolean() || fileExists("${workspace}/.git")) { + if (fileExists(workspace)) { + PlatformRmDir(workspace) + } + } + + dir(workspace) { + // Add folder where we will store the 3rdParty downloads and packages + if (!fileExists('3rdParty')) { + PlatformMkdir('3rdParty') + } + CheckoutRepo(disableSubmodules) + } + dir("${workspace}/${ENGINE_REPOSITORY_NAME}") { + // Get python + if (env.IS_UNIX) { + sh label: 'Getting python', + script: 'python/get_python.sh' + } else { + bat label: 'Getting python', + script: 'python/get_python.bat' + } + + // Always run the clean step, the scripts detect what variables were set, but it also cleans if + // the NODE_LABEL has changed + def command = "${pipelineConfig.PYTHON_DIR}/python" + if (env.IS_UNIX) command += '.sh' + else command += '.cmd' + command += " -u ${pipelineConfig.BUILD_ENTRY_POINT} --platform ${platform} --type clean" + PlatformSh(command, "Running ${platform} clean") + } +} + +def Build(Map pipelineConfig, String platform, String type, String workspace) { + // If EXECUTE_FROM_PROJECT is defined, we execute the script from the project instead of from the engine + // In both cases, the scripts are in the engine, is just what the current dir is and how we get to the scripts + def currentDir = "${workspace}/${ENGINE_REPOSITORY_NAME}" + def pathToEngine = "" + + timeout(time: env.TIMEOUT, unit: 'MINUTES', activity: true) { + def command = "${pipelineConfig.PYTHON_DIR}/python" + def ext = '' + if (env.IS_UNIX) { + command += '.sh' + ext = '.sh' + } + else command += '.cmd' + + // Setup environment for project execution, otherwise, register the project + if (env.EXECUTE_FROM_PROJECT?.toBoolean()) { + currentDir = "${workspace}/${PROJECT_REPOSITORY_NAME}" + pathToEngine = "../${ENGINE_REPOSITORY_NAME}/" + } else { + dir("${workspace}/${ENGINE_REPOSITORY_NAME}") { + PlatformSh("scripts/o3de${ext} register --project-path ${workspace}/${PROJECT_REPOSITORY_NAME}", "Registering project ${PROJECT_REPOSITORY_NAME}") + } + } + command += " -u ${pipelineConfig.BUILD_ENTRY_POINT} --platform ${platform} --type ${type}" + dir("${workspace}/${ENGINE_REPOSITORY_NAME}") { + PlatformSh(command, "Running ${platform} ${type}") + } + } +} + +def ExportTestResults(Map options, String platform, String type, String workspace, Map params) { + catchError(message: "Error exporting tests results (this won't fail the build)", buildResult: 'SUCCESS', stageResult: 'FAILURE') { + def o3deroot = "${workspace}/${ENGINE_REPOSITORY_NAME}" + dir("${o3deroot}/${params.OUTPUT_DIRECTORY}") { + junit testResults: "Testing/**/*.xml" + PlatformRmDir("Testing") + // Recreate test runner xml directories that need to be pre generated + PlatformMkdir("Testing/Pytest") + PlatformMkdir("Testing/Gtest") + } + } +} + +def PostBuildCommonSteps(String workspace, boolean mount = true) { + echo 'Starting post-build common steps...' + + if (mount) { + def pythonCmd = '' + if (env.IS_UNIX) pythonCmd = 'sudo -E python3 -u ' + else pythonCmd = 'python3 -u ' + + try { + timeout(5) { + PlatformSh("${pythonCmd} ${INCREMENTAL_BUILD_SCRIPT_PATH} --action unmount", 'Unmounting volume') + } + } catch (Exception e) { + echo "Unmount script error ${e}" + } + } +} + +def CreateSetupStage(Map pipelineConfig, String repositoryName, String projectName, String pipelineName, String branchName, String platformName, String jobName, Map environmentVars) { + return { + stage('Setup') { + PreBuildCommonSteps(pipelineConfig, repositoryName, projectName, pipelineName, branchName, platformName, jobName, environmentVars['WORKSPACE'], environmentVars['MOUNT_VOLUME']) + } + } +} + +def CreateBuildStage(Map pipelineConfig, String platformName, String jobName, Map environmentVars) { + return { + stage("${jobName}") { + Build(pipelineConfig, platformName, jobName, environmentVars['WORKSPACE']) + } + } +} + +def CreateExportTestResultsStage(Map pipelineConfig, String platformName, String jobName, Map environmentVars, Map params) { + return { + stage("${jobName}_results") { + ExportTestResults(pipelineConfig, platformName, jobName, environmentVars['WORKSPACE'], params) + } + } +} + +def CreateTeardownStage(Map environmentVars) { + return { + stage('Teardown') { + PostBuildCommonSteps(environmentVars['WORKSPACE'], environmentVars['MOUNT_VOLUME']) + } + } +} + +def projectName = '' +def pipelineName = '' +def branchName = '' +def pipelineConfig = {} + +// Start Pipeline +try { + stage('Setup Pipeline') { + node('controller') { + def envVarList = [] + if (isUnix()) { + envVarList.add('IS_UNIX=1') + } + withEnv(envVarList) { + timestamps { + repositoryUrl = scm.getUserRemoteConfigs()[0].getUrl() + // repositoryName is the full repository name + repositoryName = (repositoryUrl =~ /https:\/\/github.com\/(.*)\.git/)[0][1] + (projectName, pipelineName) = GetRunningPipelineName(env.JOB_NAME) // env.JOB_NAME is the name of the job given by Jenkins + + if (env.BRANCH_NAME) { + branchName = env.BRANCH_NAME + } else { + branchName = scm.branches[0].name // for non-multibranch pipelines + env.BRANCH_NAME = branchName // so scripts that read this environment have it (e.g. incremental_build_util.py) + } + pipelineProperties.add(disableConcurrentBuilds()) + + def engineBranch = params.ENGINE_BRANCH ?: "${ENGINE_BRANCH_DEFAULT}" // This allows the first run to work with parameters having null value, but use the engine branch parameter afterwards + echo "Running repository: \"${repositoryName}\", pipeline: \"${pipelineName}\", branch: \"${branchName}\" on engine branch \"${engineBranch}\"..." + + CheckoutBootstrapScripts(engineBranch) + + // Load configs + pipelineConfig = LoadPipelineConfig(pipelineName, branchName) + + // Add each platform as a parameter that the user can disable if needed + if (!IsPullRequest(branchName)) { + pipelineParameters.add(stringParam(defaultValue: '', description: 'Filters and overrides the list of jobs to run for each of the below platforms (comma-separated). Can\'t be used during a pull request.', name: 'JOB_LIST_OVERRIDE')) + + pipelineConfig.platforms.each { platform -> + pipelineParameters.add(booleanParam(defaultValue: true, description: '', name: platform.key)) + } + } + pipelineProperties.add(parameters(pipelineParameters)) + properties(pipelineProperties) + + // Stash the INCREMENTAL_BUILD_SCRIPT_PATH since all nodes will use it + stash name: 'incremental_build_script', + includes: INCREMENTAL_BUILD_SCRIPT_PATH + } + } + } + } + + if (env.BUILD_NUMBER == '1' && !IsPullRequest(branchName)) { + // Exit pipeline early on the intial build. This allows Jenkins to load the pipeline for the branch and enables users + // to select build parameters on their first actual build. See https://issues.jenkins.io/browse/JENKINS-41929 + currentBuild.result = 'SUCCESS' + return + } + + def someBuildHappened = false + + // Build and Post-Build Testing Stage + def buildConfigs = [:] + + // Platform Builds run on EC2 + pipelineConfig.platforms.each { platform -> + platform.value.build_types.each { build_job -> + if (IsJobEnabled(branchName, build_job, pipelineName, platform.key)) { // User can filter jobs, jobs are tagged by pipeline + def envVars = GetBuildEnvVars(platform.value.PIPELINE_ENV ?: EMPTY_JSON, build_job.value.PIPELINE_ENV ?: EMPTY_JSON, pipelineName) + envVars['JOB_NAME'] = "${branchName}_${platform.key}_${build_job.key}" // backwards compatibility, some scripts rely on this + envVars['CMAKE_LY_PROJECTS'] = "../${PROJECT_REPOSITORY_NAME}" + def nodeLabel = envVars['NODE_LABEL'] + someBuildHappened = true + + buildConfigs["${platform.key} [${build_job.key}]"] = { + node("${nodeLabel}") { + if (isUnix()) { // Has to happen inside a node + envVars['IS_UNIX'] = 1 + } + withEnv(GetEnvStringList(envVars)) { + def build_job_name = build_job.key + try { + CreateSetupStage(pipelineConfig, repositoryName, projectName, pipelineName, branchName, platform.key, build_job.key, envVars).call() + + if (build_job.value.steps) { //this is a pipe with many steps so create all the build stages + build_job.value.steps.each { build_step -> + build_job_name = build_step + CreateBuildStage(pipelineConfig, platform.key, build_step, envVars).call() + } + } else { + CreateBuildStage(pipelineConfig, platform.key, build_job.key, envVars).call() + } + } + catch(Exception e) { + // https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Result.java + // {SUCCESS,UNSTABLE,FAILURE,NOT_BUILT,ABORTED} + def currentResult = envVars['ON_FAILURE_MARK'] ?: 'FAILURE' + if (currentResult == 'FAILURE') { + currentBuild.result = 'FAILURE' + error "FAILURE: ${e}" + } else if (currentResult == 'UNSTABLE') { + currentBuild.result = 'UNSTABLE' + unstable(message: "UNSTABLE: ${e}") + } + } + finally { + def params = platform.value.build_types[build_job_name].PARAMETERS + if (params && params.containsKey('TEST_RESULTS') && params.TEST_RESULTS == 'True') { + CreateExportTestResultsStage(pipelineConfig, platform.key, build_job_name, envVars, params).call() + } + CreateTeardownStage(envVars).call() + } + } + } + } + } + } + } + + timestamps { + + stage('Build') { + parallel buildConfigs // Run parallel builds + } + + echo 'All builds successful' + } + if (!someBuildHappened) { + currentBuild.result = 'NOT_BUILT' + } +} +catch(Exception e) { + error "Exception: ${e}" +} +finally { + try { + if (env.SNS_TOPIC) { + snsPublish( + topicArn: env.SNS_TOPIC, + subject:'Build Result', + message:"${currentBuild.currentResult}:${BUILD_URL}:${env.RECREATE_VOLUME}:${env.CLEAN_OUTPUT_DIRECTORY}:${env.CLEAN_ASSETS}" + ) + } + node('controller') { + step([ + $class: 'Mailer', + notifyEveryUnstableBuild: true, + recipients: emailextrecipients([ + [$class: 'RequesterRecipientProvider'] + ]) + ]) + } + } catch(Exception e) { + } +} From 97530e303c400935f21ce4f2f898cbf153c95a1d Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Thu, 4 Nov 2021 13:28:48 -0400 Subject: [PATCH 02/71] Fix for the release build Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Gem/Code/Source/Components/NetworkStressTestComponent.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gem/Code/Source/Components/NetworkStressTestComponent.cpp b/Gem/Code/Source/Components/NetworkStressTestComponent.cpp index d0eb0dfd4..587788126 100644 --- a/Gem/Code/Source/Components/NetworkStressTestComponent.cpp +++ b/Gem/Code/Source/Components/NetworkStressTestComponent.cpp @@ -46,7 +46,9 @@ namespace MultiplayerSample { case Multiplayer::MultiplayerAgentType::DedicatedServer: case Multiplayer::MultiplayerAgentType::ClientServer: +#ifdef IMGUI_ENABLED m_isServer = true; +#endif break; default: break; From 6316937318ff318e453199b2e916354d20dcc114 Mon Sep 17 00:00:00 2001 From: Olex Lozitskiy <5432499+AMZN-Olex@users.noreply.github.com> Date: Mon, 8 Nov 2021 10:46:00 -0500 Subject: [PATCH 03/71] Added a linux readme. Signed-off-by: Olex Lozitskiy <5432499+AMZN-Olex@users.noreply.github.com> --- README_LINUX.md | 131 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 README_LINUX.md diff --git a/README_LINUX.md b/README_LINUX.md new file mode 100644 index 000000000..6f218bb7f --- /dev/null +++ b/README_LINUX.md @@ -0,0 +1,131 @@ +# MultiplayerSample Project for Linux +## Download and Install + +This README covers installation and running MultiplayerSample project on Ubuntu Linux. +Refer [Open 3D Engine on Linux](https://o3de.org/docs/user-guide/platforms/linux/) for setting up the engine on Linux. + +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.](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) + + +### (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](https://github.com/microsoft/Git-Credential-Manager-Core#linux) + + + +### Step 1. Clone the repositories + +Let's assume you are cloning the engine and the project to **/home/your_username/git** where **your_username** is your Linux username and **/home/your_username** is your home folder. The rest of the readme will reference this path as **~**. + +```shell +> cd ~ +> mkdir git +> cd git +# Clone the engine. +> git clone https://github.com/o3de/o3de +Cloning into 'o3de'... + +# Clone the project into a folder outside your engine repository folder. +> git clone https://github.com/o3de/o3de-multiplayersample.git +Cloning into 'o3de-multiplayersample'... +``` + + +### Step 2. Register the engine and project + +```shell +# Register the engine (only need to do this once). +> cd ~/git/o3de +> ./scripts/o3de.sh register --this-engine + +# Register the project. +> ./scripts/o3de.sh register -p ~/git/o3de-multiplayersample +``` + +### Step 3. Configure and build with Project-centric approach + +This option will output all the project binaries in the project's build folder e.g. **~/git/o3de-multiplayersample/build**. + +```shell +> cd ~/git/o3de-multiplayersample +> mkdir build +> cd build + +# Configure. +> cmake .. -G "Ninja Multi-Config" -DCMAKE_BUILD_TYPE=profile -DLY_3RDPARTY_PATH=~/ws/3rdParty -DCMAKE_C_COMPILER=clang-12 -DCMAKE_CXX_COMPILER=clang++-12 -DLY_PROJECTS="~/git/o3de-multiplayersample" + +# Build the Editor, game launcher and server launcher. +> cmake --build . --config profile --target Editor +> cmake --build . --config profile --target MultiplayerSample.GameLauncher +> cmake --build . --config profile --target MultiplayerSample.ServerLauncher +``` + +#### Step 3b. (Optional) Build and Run Multiplayer Unittests + +```shell +> cd ~/git/o3de-multiplayersample/build + +> cmake --build . --config profile --target Multiplayer.Tests +# Run unittests and benchmarks +> ./bin/profile/AzTestRunner ./bin/profile/libMultiplayer.Tests.so AzRunBenchmarks +> ./bin/profile/AzTestRunner ./bin/profile/libMultiplayer.Tests.so AzRunUnitTests +``` + +### Step 4. Setup Client and Server + +Under engine root, create 2 files: **client.cfg** and **server.cfg**. File ~/git/o3de/client.cfg should contain: + +```shell +connect +``` + +File ~/git/o3de/server.cfg should contain: + +```shell +host +LoadLevel Levels/SampleBase/SampleBase.spawnable +``` + +### Step 5. Verify Asset Processor + +```shell +> cd ~/git/o3de-multiplayersample/build +> cmake --build . --config profile --target AssetProcessor +# launch Asset Processor and verify MultiplayerSample assets are good +> ./bin/profile/AssetProcessor & +``` + +### Step 6. Run a Server and a Client + + +A server can be run as follows: + +```shell +> cd ~/git/o3de-multiplayersample/build +> ./bin/profile/MultiplayerSample.ServerLauncher --console-command-file=server.cfg +``` + +A client can be run with: + +```shell +> cd ~/git/o3de-multiplayersample/build +> ./bin/profile/MultiplayerSample.GameLauncher --console-command-file=client.cfg +``` + +This will connect a client to the local server and start a multiplayer session. + + + +## License + +For terms please see the LICENSE*.TXT file at the root of this distribution. + + From 2b1cc4bbe9aa285d32b351fdca2ad1d440a86217 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:25:18 -0500 Subject: [PATCH 04/71] Address CR feedback Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- README_LINUX.md | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/README_LINUX.md b/README_LINUX.md index 6f218bb7f..2d4e42d02 100644 --- a/README_LINUX.md +++ b/README_LINUX.md @@ -1,7 +1,7 @@ # MultiplayerSample Project for Linux ## Download and Install -This README covers installation and running MultiplayerSample project on Ubuntu Linux. +This README covers installation and running MultiplayerSample project on Ubuntu Linux. Refer [Open 3D Engine on Linux](https://o3de.org/docs/user-guide/platforms/linux/) for setting up the engine on Linux. 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. @@ -14,9 +14,9 @@ You will need your personal access token credentials to authenticate when you cl [Create a personal access token with the 'repo' scope.](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) -### (Recommended) Verify you have a credential manager installed to store your credentials +### (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. +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](https://github.com/microsoft/Git-Credential-Manager-Core#linux) @@ -39,7 +39,7 @@ Cloning into 'o3de-multiplayersample'... ``` -### Step 2. Register the engine and project +### Step 2. Register the engine and project ```shell # Register the engine (only need to do this once). @@ -50,7 +50,7 @@ Cloning into 'o3de-multiplayersample'... > ./scripts/o3de.sh register -p ~/git/o3de-multiplayersample ``` -### Step 3. Configure and build with Project-centric approach +### Step 3. Configure and build with Project-centric approach This option will output all the project binaries in the project's build folder e.g. **~/git/o3de-multiplayersample/build**. @@ -63,18 +63,16 @@ This option will output all the project binaries in the project's build folder e > cmake .. -G "Ninja Multi-Config" -DCMAKE_BUILD_TYPE=profile -DLY_3RDPARTY_PATH=~/ws/3rdParty -DCMAKE_C_COMPILER=clang-12 -DCMAKE_CXX_COMPILER=clang++-12 -DLY_PROJECTS="~/git/o3de-multiplayersample" # Build the Editor, game launcher and server launcher. -> cmake --build . --config profile --target Editor -> cmake --build . --config profile --target MultiplayerSample.GameLauncher -> cmake --build . --config profile --target MultiplayerSample.ServerLauncher +> cmake --build . --config profile --target Editor MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher ``` -#### Step 3b. (Optional) Build and Run Multiplayer Unittests +#### Step 3b. (Optional) Build and Run Multiplayer Unit Tests ```shell > cd ~/git/o3de-multiplayersample/build > cmake --build . --config profile --target Multiplayer.Tests -# Run unittests and benchmarks +# Run unit tests and benchmarks > ./bin/profile/AzTestRunner ./bin/profile/libMultiplayer.Tests.so AzRunBenchmarks > ./bin/profile/AzTestRunner ./bin/profile/libMultiplayer.Tests.so AzRunUnitTests ``` @@ -94,12 +92,12 @@ host LoadLevel Levels/SampleBase/SampleBase.spawnable ``` -### Step 5. Verify Asset Processor +### Step 5. Verify Asset Processor ```shell > cd ~/git/o3de-multiplayersample/build > cmake --build . --config profile --target AssetProcessor -# launch Asset Processor and verify MultiplayerSample assets are good +# Launch Asset Processor and verify that MultiplayerSample assets are good. > ./bin/profile/AssetProcessor & ``` @@ -127,5 +125,3 @@ This will connect a client to the local server and start a multiplayer session. ## License For terms please see the LICENSE*.TXT file at the root of this distribution. - - From b7f0dfd8fe9652162b329fd43c148ec557874178 Mon Sep 17 00:00:00 2001 From: kberg-amzn Date: Tue, 9 Nov 2021 16:17:20 -0800 Subject: [PATCH 05/71] Changes to allow for better (safer) controller access, esp in situations where entities may be migrating between hosts Signed-off-by: kberg-amzn --- .../AutoGen/NetworkAiComponent.AutoComponent.xml | 2 ++ ...etworkPlayerMovementComponent.AutoComponent.xml | 1 + .../NetworkWeaponsComponent.AutoComponent.xml | 1 + Gem/Code/Source/Components/NetworkAiComponent.cpp | 10 ++-------- .../Components/NetworkPlayerMovementComponent.cpp | 14 +++++++------- .../Components/NetworkPlayerMovementComponent.h | 3 +++ .../Components/NetworkStressTestComponent.cpp | 3 +-- .../Source/Components/NetworkWeaponsComponent.cpp | 10 +++------- 8 files changed, 20 insertions(+), 24 deletions(-) diff --git a/Gem/Code/Source/AutoGen/NetworkAiComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkAiComponent.AutoComponent.xml index 6708bb8f2..985cf3fe8 100644 --- a/Gem/Code/Source/AutoGen/NetworkAiComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkAiComponent.AutoComponent.xml @@ -13,6 +13,8 @@ + + diff --git a/Gem/Code/Source/AutoGen/NetworkPlayerMovementComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkPlayerMovementComponent.AutoComponent.xml index 124b64c9b..509412c70 100644 --- a/Gem/Code/Source/AutoGen/NetworkPlayerMovementComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkPlayerMovementComponent.AutoComponent.xml @@ -12,6 +12,7 @@ + diff --git a/Gem/Code/Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml index 008dd1c65..2015eb0ef 100644 --- a/Gem/Code/Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml @@ -10,6 +10,7 @@ + diff --git a/Gem/Code/Source/Components/NetworkAiComponent.cpp b/Gem/Code/Source/Components/NetworkAiComponent.cpp index 2fd8dbbab..2b4f6811f 100644 --- a/Gem/Code/Source/Components/NetworkAiComponent.cpp +++ b/Gem/Code/Source/Components/NetworkAiComponent.cpp @@ -27,10 +27,7 @@ namespace MultiplayerSample { if (GetEnabled()) { - Multiplayer::LocalPredictionPlayerInputComponent* playerInputComponent = FindComponent(); - Multiplayer::LocalPredictionPlayerInputComponentController* playerInputController = (playerInputComponent != nullptr) ? - static_cast(playerInputComponent->GetController()) : nullptr; - + Multiplayer::LocalPredictionPlayerInputComponentController* playerInputController = GetLocalPredictionPlayerInputComponentController(); if (playerInputController != nullptr) { playerInputController->ForceEnableAutonomousUpdate(); @@ -42,10 +39,7 @@ namespace MultiplayerSample { if (GetEnabled()) { - Multiplayer::LocalPredictionPlayerInputComponent* playerInputComponent = FindComponent(); - Multiplayer::LocalPredictionPlayerInputComponentController* playerInputController = (playerInputComponent != nullptr) ? - static_cast(playerInputComponent->GetController()) : nullptr; - + Multiplayer::LocalPredictionPlayerInputComponentController* playerInputController = GetLocalPredictionPlayerInputComponentController(); if (playerInputController != nullptr) { playerInputController->ForceDisableAutonomousUpdate(); diff --git a/Gem/Code/Source/Components/NetworkPlayerMovementComponent.cpp b/Gem/Code/Source/Components/NetworkPlayerMovementComponent.cpp index 00ce27a7e..958b3d91c 100644 --- a/Gem/Code/Source/Components/NetworkPlayerMovementComponent.cpp +++ b/Gem/Code/Source/Components/NetworkPlayerMovementComponent.cpp @@ -23,23 +23,19 @@ namespace MultiplayerSample NetworkPlayerMovementComponentController::NetworkPlayerMovementComponentController(NetworkPlayerMovementComponent& parent) : NetworkPlayerMovementComponentControllerBase(parent) - , m_updateAI{ [this] - { - UpdateAI(); - }, - AZ::Name{ "MovementControllerAi" } } + , m_updateAI{ [this] { UpdateAI(); }, AZ::Name{ "MovementControllerAi" } } { ; } void NetworkPlayerMovementComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { - NetworkAiComponent* networkAiComponent = FindComponent(); + NetworkAiComponent* networkAiComponent = GetParent().GetNetworkAiComponent(); m_aiEnabled = (networkAiComponent != nullptr) ? networkAiComponent->GetEnabled() : false; if (m_aiEnabled) { m_updateAI.Enqueue(AZ::TimeMs{ 0 }, true); - m_networkAiComponentController = static_cast(networkAiComponent->GetController()); + m_networkAiComponentController = GetNetworkAiComponentController(); } else if (IsAutonomous()) { @@ -52,6 +48,8 @@ namespace MultiplayerSample StartingPointInput::InputEventNotificationBus::MultiHandler::BusConnect(CrouchEventId); StartingPointInput::InputEventNotificationBus::MultiHandler::BusConnect(LookLeftRightEventId); StartingPointInput::InputEventNotificationBus::MultiHandler::BusConnect(LookUpDownEventId); + StartingPointInput::InputEventNotificationBus::MultiHandler::BusConnect(ZoomInEventId); + StartingPointInput::InputEventNotificationBus::MultiHandler::BusConnect(ZoomOutEventId); } } @@ -68,6 +66,8 @@ namespace MultiplayerSample StartingPointInput::InputEventNotificationBus::MultiHandler::BusDisconnect(CrouchEventId); StartingPointInput::InputEventNotificationBus::MultiHandler::BusDisconnect(LookLeftRightEventId); StartingPointInput::InputEventNotificationBus::MultiHandler::BusDisconnect(LookUpDownEventId); + StartingPointInput::InputEventNotificationBus::MultiHandler::BusDisconnect(ZoomInEventId); + StartingPointInput::InputEventNotificationBus::MultiHandler::BusDisconnect(ZoomOutEventId); } } diff --git a/Gem/Code/Source/Components/NetworkPlayerMovementComponent.h b/Gem/Code/Source/Components/NetworkPlayerMovementComponent.h index ef8ba121f..694e1c268 100644 --- a/Gem/Code/Source/Components/NetworkPlayerMovementComponent.h +++ b/Gem/Code/Source/Components/NetworkPlayerMovementComponent.h @@ -25,6 +25,9 @@ namespace MultiplayerSample const StartingPointInput::InputEventNotificationId LookLeftRightEventId("lookLeftRight"); const StartingPointInput::InputEventNotificationId LookUpDownEventId("lookUpDown"); + const StartingPointInput::InputEventNotificationId ZoomInEventId("zoomIn"); + const StartingPointInput::InputEventNotificationId ZoomOutEventId("zoomOut"); + class NetworkPlayerMovementComponentController : public NetworkPlayerMovementComponentControllerBase , private StartingPointInput::InputEventNotificationBus::MultiHandler diff --git a/Gem/Code/Source/Components/NetworkStressTestComponent.cpp b/Gem/Code/Source/Components/NetworkStressTestComponent.cpp index d0eb0dfd4..b2f52b581 100644 --- a/Gem/Code/Source/Components/NetworkStressTestComponent.cpp +++ b/Gem/Code/Source/Components/NetworkStressTestComponent.cpp @@ -150,8 +150,7 @@ namespace MultiplayerSample Multiplayer::NetworkEntityHandle createdEntity = entityList[0]; // Drive inputs from AI instead of user inputs and disable camera following - NetworkAiComponent* aiComponent = createdEntity.FindComponent(); - NetworkAiComponentController* networkAiController = reinterpret_cast(aiComponent->GetController()); + NetworkAiComponentController* networkAiController = createdEntity.FindController(); networkAiController->ConfigureAi(fireIntervalMinMs, fireIntervalMaxMs, actionIntervalMinMs, actionIntervalMaxMs, seed); networkAiController->SetEnabled(true); if (invokingConnection) diff --git a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp index 77c574c20..baffc44dd 100644 --- a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp +++ b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp @@ -296,23 +296,19 @@ namespace MultiplayerSample NetworkWeaponsComponentController::NetworkWeaponsComponentController(NetworkWeaponsComponent& parent) : NetworkWeaponsComponentControllerBase(parent) - , m_updateAI{ [this] - { - UpdateAI(); - }, - AZ::Name{ "WeaponsControllerAI" } } + , m_updateAI{[this] { UpdateAI(); }, AZ::Name{ "WeaponsControllerAI" } } { ; } void NetworkWeaponsComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { - NetworkAiComponent* networkAiComponent = FindComponent(); + NetworkAiComponent* networkAiComponent = GetParent().GetNetworkAiComponent(); m_aiEnabled = (networkAiComponent != nullptr) ? networkAiComponent->GetEnabled() : false; if (m_aiEnabled) { m_updateAI.Enqueue(AZ::TimeMs{ 0 }, true); - m_networkAiComponentController = static_cast(networkAiComponent->GetController()); + m_networkAiComponentController = GetNetworkAiComponentController(); } else if (IsAutonomous()) { From 3d71ca9275cafa589512e679c7158de5e1dd9dce Mon Sep 17 00:00:00 2001 From: kberg-amzn Date: Tue, 9 Nov 2021 16:23:45 -0800 Subject: [PATCH 06/71] Adding in in-progress input bindings for improved camera controls (not fully hooked up yet) Signed-off-by: kberg-amzn --- InputBindings/player.inputbindings | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/InputBindings/player.inputbindings b/InputBindings/player.inputbindings index 1a3054ca5..180273130 100644 --- a/InputBindings/player.inputbindings +++ b/InputBindings/player.inputbindings @@ -146,6 +146,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + From 6ad2db0f9e7ae885f223532c838a8a7812c3ce7e Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Wed, 10 Nov 2021 14:25:46 -0500 Subject: [PATCH 07/71] Added server.cfg and client.cfg to the project Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- README.md | 32 ++++++++++++++++---------------- client.cfg | 1 + server.cfg | 2 ++ 3 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 client.cfg create mode 100644 server.cfg diff --git a/README.md b/README.md index 04e53ee07..0ca77efb9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# MultiplayerSample Project +# MultiplayerSample Project ## 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. @@ -11,14 +11,14 @@ You will need your personal access token credentials to authenticate when you cl [Create a personal access token with the 'repo' scope.](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) -### (Recommended) Verify you have a credential manager installed to store your credentials +### (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. +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](https://github.com/microsoft/Git-Credential-Manager-Core) -### Step 1. Clone the repository +### 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. @@ -43,31 +43,31 @@ Cloning into 'o3de-multiplayersample'... If you have a Git credential helper configured, you should not be prompted for your credentials anymore. -### Step 2. Register the engine and project +### Step 2. Register the engine and project ```shell # register the engine (only need to do this once) > c:/path/to/o3de/scripts/o3de register --this-engine -# register the project +# register the project > c:/path/to/o3de/scripts/o3de register -p c:/path/to/o3de-multiplayersample ``` -### Step 3. Configure and build +### Step 3. Configure and build -#### Option #1 (Recommended) - Project-centric approach +#### 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 ```shell # example configure command -> cmake c:/path/to/o3de -B c:/path/to/o3de-multiplayersample/build -G "Visual Studio 16" -DLY_3RDPARTY_PATH="c:/3rdparty" -DLY_PROJECTS="c:/path/to/o3de-multiplayersample" +> cmake c:/path/to/o3de -B c:/path/to/o3de-multiplayersample/build -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-multiplayersample/build --target Editor MultiplayerSample.GameLauncher --config profile -- /m /nologo +> cmake --build c:/path/to/o3de-multiplayersample/build --target Editor MultiplayerSample.GameLauncher --config profile -- /m /nologo ``` -#### Option #2 - Engine-centric approach to building a project +#### 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 @@ -76,25 +76,27 @@ This option will output all the project and engine binaries in the engine's buil > cmake c:/path/to/o3de -B c:/path/to/o3de/build -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 --target Editor MultiplayerSample.GameLauncher --config profile -- /m /nologo +> cmake --build c:/path/to/o3de/build --target Editor MultiplayerSample.GameLauncher --config profile -- /m /nologo ``` ### Step 4. Setup Client and Server -Under engine root, create 2 files: client.cfg and server.cfg. File c:/path/to/o3de/client.cfg should contain: +Under project root, there should be 2 files: client.cfg and server.cfg. File client.cfg should contain: ```shell connect ``` -File c:/path/to/o3de/server.cfg should contain: +File server.cfg should contain: ```shell host LoadLevel Levels/SampleBase/SampleBase.spawnable ``` +If these cfg files are not present, create them as they will be used to when launching server and client launchers. + A server can be run as follows: ```shell @@ -114,5 +116,3 @@ This will connect a client to the local server and start a multiplayer session. ## License For terms please see the LICENSE*.TXT file at the root of this distribution. - - diff --git a/client.cfg b/client.cfg new file mode 100644 index 000000000..1bd5775c4 --- /dev/null +++ b/client.cfg @@ -0,0 +1 @@ +connect diff --git a/server.cfg b/server.cfg new file mode 100644 index 000000000..a77f4c4ce --- /dev/null +++ b/server.cfg @@ -0,0 +1,2 @@ +host +LoadLevel Levels/SampleBase/SampleBase.spawnable From 70c898047444dc1c156462b8bce0de073bbbe46c Mon Sep 17 00:00:00 2001 From: Pip Potter <61438964+lmbr-pip@users.noreply.github.com> Date: Mon, 15 Nov 2021 09:24:32 -0800 Subject: [PATCH 08/71] Add links to the play-in-editor guide and linux setup Signed-off-by: Pip Potter <61438964+lmbr-pip@users.noreply.github.com> --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0ca77efb9..024180ceb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ # MultiplayerSample Project +A simple third-person multiplayer sample for O3DE. + +> **_NOTE:_** For Linux, see the Linux specific setup in [README_LINUX](./README_LINUX.md). + ## 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. @@ -16,8 +20,6 @@ You will need your personal access token credentials to authenticate when you cl 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](https://github.com/microsoft/Git-Credential-Manager-Core) - - ### 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. @@ -97,10 +99,14 @@ LoadLevel Levels/SampleBase/SampleBase.spawnable If these cfg files are not present, create them as they will be used to when launching server and client launchers. -A server can be run as follows: +#### Running the Server + +> **Note**: Refer to the O3DE document [Test Multiplayer Games in the O3DE Editor](https://o3de.org/docs/user-guide/gems/reference/multiplayer/multiplayer-gem/test-in-editor/), to set up required console variables (cvar) to support play in editor with servers. Ensure you add ```editorsv_enabled=true``` and ```editorsv_launch=true``` to the appropriate .cfg file or to the Editor launcher path. See the [Console Variable Tutorial]((https://o3de.org/docs/user-guide/engine/cvars/#using-the-cvar)) for more details on setting and using cvars. + +A server can be run as follows ```shell -MultiplayerSample.ServerLauncher.exe --console-command-file=server.cfg +MultiplayerSample.ServerLauncher.exe --console-command-file=server.cfg ``` A client can be run with: @@ -112,6 +118,9 @@ MultiplayerSample.GameLauncher.exe --console-command-file=client.cfg This will connect a client to the local server and start a multiplayer session. +## More Information +* [O3DE Networking](https://o3de.org/docs/user-guide/networking/) +* [Multiplayer Tutorials](https://o3de.org/docs/learning-guide/tutorials/multiplayer/) ## License From efaddda43a00a128bdd9b8f5fd00328b73f932fd Mon Sep 17 00:00:00 2001 From: Pip Potter <61438964+lmbr-pip@users.noreply.github.com> Date: Mon, 15 Nov 2021 10:13:43 -0800 Subject: [PATCH 09/71] Quick update Signed-off-by: Pip Potter <61438964+lmbr-pip@users.noreply.github.com> --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 024180ceb..cde380529 100644 --- a/README.md +++ b/README.md @@ -101,14 +101,18 @@ If these cfg files are not present, create them as they will be used to when lau #### Running the Server -> **Note**: Refer to the O3DE document [Test Multiplayer Games in the O3DE Editor](https://o3de.org/docs/user-guide/gems/reference/multiplayer/multiplayer-gem/test-in-editor/), to set up required console variables (cvar) to support play in editor with servers. Ensure you add ```editorsv_enabled=true``` and ```editorsv_launch=true``` to the appropriate .cfg file or to the Editor launcher path. See the [Console Variable Tutorial]((https://o3de.org/docs/user-guide/engine/cvars/#using-the-cvar)) for more details on setting and using cvars. - A server can be run as follows ```shell MultiplayerSample.ServerLauncher.exe --console-command-file=server.cfg ``` +#### Running the Server in the Editor + +Refer to the O3DE document [Test Multiplayer Games in the O3DE Editor](https://o3de.org/docs/user-guide/gems/reference/multiplayer/multiplayer-gem/test-in-editor/), to set up required console variables (cvar) to support play in editor with servers. Ensure you configure ```editorsv_enabled``` and ```editorsv_launch``` as required. See the [Console Variable Tutorial]((https://o3de.org/docs/user-guide/engine/cvars/#using-the-cvar)) for more details on setting and using cvars. + + +#### Running the Client A client can be run with: ```shell From 0bdec351abe7c6fbaceb8a769894d6c834a57d75 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 12:24:46 -0800 Subject: [PATCH 10/71] Adapts to new template (#98) * Adapts to new tempalte Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * remove begin/end markers from template Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- CMakeLists.txt | 15 +------ cmake/CompilerSettings.cmake | 13 ++++++ .../EngineFinder.cmake | 42 +++++++++++++++---- .../Linux/CompilerSettings_linux.cmake | 34 +++++++++++++++ 4 files changed, 82 insertions(+), 22 deletions(-) create mode 100644 cmake/CompilerSettings.cmake rename EngineFinder.cmake => cmake/EngineFinder.cmake (63%) create mode 100644 cmake/Platform/Linux/CompilerSettings_linux.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ebaa32c8..de4375960 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,28 +5,17 @@ # # -#! Adds the --project-path argument to the VS IDE debugger command arguments -function(add_vs_debugger_arguments) - # Inject the project root into the --project-path argument into the Visual Studio Debugger arguments by defaults - list(APPEND app_targets MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher) - list(APPEND app_targets AssetBuilder AssetProcessor AssetProcessorBatch Editor) - foreach(app_target IN LISTS app_targets) - if (TARGET ${app_target}) - set_property(TARGET ${app_target} APPEND PROPERTY VS_DEBUGGER_COMMAND_ARGUMENTS "--project-path=\"${CMAKE_CURRENT_LIST_DIR}\"") - endif() - endforeach() -endfunction() if(NOT PROJECT_NAME) cmake_minimum_required(VERSION 3.19) + include(cmake/CompilerSettings.cmake) project(MultiplayerSample LANGUAGES C CXX VERSION 1.0.0.0 ) - include(EngineFinder.cmake OPTIONAL) + include(cmake/EngineFinder.cmake OPTIONAL) find_package(o3de REQUIRED) o3de_initialize() - add_vs_debugger_arguments() else() # Add the project_name to global LY_PROJECTS_TARGET_NAME property file(READ "${CMAKE_CURRENT_LIST_DIR}/project.json" project_json) diff --git a/cmake/CompilerSettings.cmake b/cmake/CompilerSettings.cmake new file mode 100644 index 000000000..60bda1d45 --- /dev/null +++ b/cmake/CompilerSettings.cmake @@ -0,0 +1,13 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +# File to tweak compiler settings before compiler detection happens (before project() is called) +# We dont have PAL enabled at this point, so we can only use pure-CMake variables +if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") + include(cmake/Platform/Linux/CompilerSettings_linux.cmake) +endif() diff --git a/EngineFinder.cmake b/cmake/EngineFinder.cmake similarity index 63% rename from EngineFinder.cmake rename to cmake/EngineFinder.cmake index 4e7b90db8..057f15da5 100644 --- a/EngineFinder.cmake +++ b/cmake/EngineFinder.cmake @@ -1,21 +1,38 @@ +# # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # + # This file is copied during engine registration. Edits to this file will be lost next # time a registration happens. include_guard() # Read the engine name from the project_json file -file(READ ${CMAKE_CURRENT_LIST_DIR}/project.json project_json) -set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_CURRENT_LIST_DIR}/project.json) +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/project.json project_json) +set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/project.json) string(JSON LY_ENGINE_NAME_TO_USE ERROR_VARIABLE json_error GET ${project_json} engine) if(json_error) - message(FATAL_ERROR "Unable to read key 'engine' from 'project.json', error: ${json_error}") + message(FATAL_ERROR "Unable to read key 'engine' from 'project.json'\nError: ${json_error}") +endif() + +if(CMAKE_MODULE_PATH) + foreach(module_path ${CMAKE_MODULE_PATH}) + if(EXISTS ${module_path}/Findo3de.cmake) + file(READ ${module_path}/../engine.json engine_json) + string(JSON engine_name ERROR_VARIABLE json_error GET ${engine_json} engine_name) + if(json_error) + message(FATAL_ERROR "Unable to read key 'engine_name' from 'engine.json'\nError: ${json_error}") + endif() + if(LY_ENGINE_NAME_TO_USE STREQUAL engine_name) + return() # Engine being forced through CMAKE_MODULE_PATH + endif() + endif() + endforeach() endif() if(DEFINED ENV{USERPROFILE} AND EXISTS $ENV{USERPROFILE}) @@ -24,6 +41,11 @@ else() set(manifest_path $ENV{HOME}/.o3de/o3de_manifest.json) # Unix endif() +set(registration_error [=[ +Engine registration is required before configuring a project. +Run 'scripts/o3de register --this-engine' from the engine root. +]=]) + # Read the ~/.o3de/o3de_manifest.json file and look through the 'engines_path' object. # Find a key that matches LY_ENGINE_NAME_TO_USE and use that as the engine path. if(EXISTS ${manifest_path}) @@ -32,36 +54,38 @@ if(EXISTS ${manifest_path}) string(JSON engines_path_count ERROR_VARIABLE json_error LENGTH ${manifest_json} engines_path) if(json_error) - message(FATAL_ERROR "Unable to read key 'engines_path' from '${manifest_path}', error: ${json_error}") + message(FATAL_ERROR "Unable to read key 'engines_path' from '${manifest_path}'\nError: ${json_error}\n${registration_error}") endif() string(JSON engines_path_type ERROR_VARIABLE json_error TYPE ${manifest_json} engines_path) if(json_error OR NOT ${engines_path_type} STREQUAL "OBJECT") - message(FATAL_ERROR "Type of 'engines_path' in '${manifest_path}' is not a JSON Object, error: ${json_error}") + message(FATAL_ERROR "Type of 'engines_path' in '${manifest_path}' is not a JSON Object\nError: ${json_error}") endif() math(EXPR engines_path_count "${engines_path_count}-1") foreach(engine_path_index RANGE ${engines_path_count}) string(JSON engine_name ERROR_VARIABLE json_error MEMBER ${manifest_json} engines_path ${engine_path_index}) if(json_error) - message(FATAL_ERROR "Unable to read 'engines_path/${engine_path_index}' from '${manifest_path}', error: ${json_error}") + message(FATAL_ERROR "Unable to read 'engines_path/${engine_path_index}' from '${manifest_path}'\nError: ${json_error}") endif() if(LY_ENGINE_NAME_TO_USE STREQUAL engine_name) string(JSON engine_path ERROR_VARIABLE json_error GET ${manifest_json} engines_path ${engine_name}) if(json_error) - message(FATAL_ERROR "Unable to read value from 'engines_path/${engine_name}', error: ${json_error}") + message(FATAL_ERROR "Unable to read value from 'engines_path/${engine_name}'\nError: ${json_error}") endif() if(engine_path) list(APPEND CMAKE_MODULE_PATH "${engine_path}/cmake") - break() + return() endif() endif() endforeach() + + message(FATAL_ERROR "The project.json uses engine name '${LY_ENGINE_NAME_TO_USE}' but no engine with that name has been registered.\n${registration_error}") else() # If the user is passing CMAKE_MODULE_PATH we assume thats where we will find the engine if(NOT CMAKE_MODULE_PATH) - message(FATAL_ERROR "Engine registration is required before configuring a project. Please register an engine by running 'scripts/o3de register --this-engine'") + message(FATAL_ERROR "O3DE Manifest file not found.\n${registration_error}") endif() endif() diff --git a/cmake/Platform/Linux/CompilerSettings_linux.cmake b/cmake/Platform/Linux/CompilerSettings_linux.cmake new file mode 100644 index 000000000..9bb629c53 --- /dev/null +++ b/cmake/Platform/Linux/CompilerSettings_linux.cmake @@ -0,0 +1,34 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +if(NOT CMAKE_C_COMPILER AND NOT CMAKE_CXX_COMPILER AND NOT "$ENV{CC}" AND NOT "$ENV{CXX}") + set(path_search + /bin + /usr/bin + /usr/local/bin + /sbin + /usr/sbin + /usr/local/sbin + ) + list(TRANSFORM path_search APPEND "/clang-[0-9]*") + file(GLOB clang_versions ${path_search}) + if(clang_versions) + # Find and pick the highest installed version + list(SORT clang_versions COMPARE NATURAL) + list(GET clang_versions 0 clang_higher_version_path) + string(REGEX MATCH "clang-([0-9.]*)" clang_higher_version ${clang_higher_version_path}) + if(CMAKE_MATCH_1) + set(CMAKE_C_COMPILER clang-${CMAKE_MATCH_1}) + set(CMAKE_CXX_COMPILER clang++-${CMAKE_MATCH_1}) + else() + message(FATAL_ERROR "Clang not found, please install clang") + endif() + else() + message(FATAL_ERROR "Clang not found, please install clang") + endif() +endif() From 7cd5c6ebd337a88918fb2b6d8cf2dbdf337bf300 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Mon, 6 Dec 2021 13:38:25 -0500 Subject: [PATCH 11/71] AI spawn fix, making them autonomous Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Gem/Code/Source/Components/NetworkStressTestComponent.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gem/Code/Source/Components/NetworkStressTestComponent.cpp b/Gem/Code/Source/Components/NetworkStressTestComponent.cpp index b5c4f2d3e..cfc6996cf 100644 --- a/Gem/Code/Source/Components/NetworkStressTestComponent.cpp +++ b/Gem/Code/Source/Components/NetworkStressTestComponent.cpp @@ -150,6 +150,11 @@ namespace MultiplayerSample AZ::Interface::Get()->GetNetworkEntityManager()->CreateEntitiesImmediate( prefabId, Multiplayer::NetEntityRole::Authority, AZ::Transform::CreateIdentity(), Multiplayer::AutoActivate::DoNotActivate); + for (const Multiplayer::NetworkEntityHandle& entityItem : entityList) + { + entityItem.GetNetBindComponent()->SetAllowAutonomy(true); + } + Multiplayer::NetworkEntityHandle createdEntity = entityList[0]; // Drive inputs from AI instead of user inputs and disable camera following NetworkAiComponentController* networkAiController = createdEntity.FindController(); From 86523f42fc4d2b43edb22276b322bbbe0cf51efa Mon Sep 17 00:00:00 2001 From: allisaurus <34254888+allisaurus@users.noreply.github.com> Date: Wed, 15 Dec 2021 13:22:56 -0800 Subject: [PATCH 12/71] Add server build command to README Signed-off-by: allisaurus <34254888+allisaurus@users.noreply.github.com> --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cde380529..387cddb62 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,17 @@ If these cfg files are not present, create them as they will be used to when lau #### Running the Server -A server can be run as follows +First, make sure the server target has been built + +```shell +# example command for Project-centric approach +> cmake --build c:/path/to/o3de-multiplayersample/build --target Editor MultiplayerSample.ServerLauncher --config profile -- /m /nologo + +# example command for Engine-centric approach +> cmake --build c:/path/to/o3de/build --target Editor MultiplayerSample.ServerLauncher --config profile -- /m /nologo +``` + +A server can then be run as follows ```shell MultiplayerSample.ServerLauncher.exe --console-command-file=server.cfg @@ -109,7 +119,7 @@ MultiplayerSample.ServerLauncher.exe --console-command-file=server.cfg #### Running the Server in the Editor -Refer to the O3DE document [Test Multiplayer Games in the O3DE Editor](https://o3de.org/docs/user-guide/gems/reference/multiplayer/multiplayer-gem/test-in-editor/), to set up required console variables (cvar) to support play in editor with servers. Ensure you configure ```editorsv_enabled``` and ```editorsv_launch``` as required. See the [Console Variable Tutorial]((https://o3de.org/docs/user-guide/engine/cvars/#using-the-cvar)) for more details on setting and using cvars. +Refer to the O3DE document [Test Multiplayer Games in the O3DE Editor](https://o3de.org/docs/user-guide/gems/reference/multiplayer/multiplayer-gem/test-in-editor/), to set up required console variables (cvar) to support play in editor with servers. Ensure you configure ```editorsv_enabled``` and ```editorsv_launch``` as required. See the [Console Variable Tutorial](https://o3de.org/docs/user-guide/engine/cvars) for more details on setting and using cvars. #### Running the Client From 965d7cba95448b2405e6d42cee6b33d6c8066d75 Mon Sep 17 00:00:00 2001 From: allisaurus <34254888+allisaurus@users.noreply.github.com> Date: Thu, 16 Dec 2021 14:30:09 -0800 Subject: [PATCH 13/71] Address feedback Signed-off-by: allisaurus <34254888+allisaurus@users.noreply.github.com> --- README.md | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 387cddb62..8919765df 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,10 @@ This option will output all the project binaries in the project's build folder e # example configure command > cmake c:/path/to/o3de -B c:/path/to/o3de-multiplayersample/build -G "Visual Studio 16" -DLY_3RDPARTY_PATH="c:/3rdparty" -DLY_PROJECTS="c:/path/to/o3de-multiplayersample" -# example build command +# example build commands > cmake --build c:/path/to/o3de-multiplayersample/build --target Editor MultiplayerSample.GameLauncher --config profile -- /m /nologo + +> cmake --build c:/path/to/o3de-multiplayersample/build --target Editor MultiplayerSample.ServerLauncher --config profile -- /m /nologo ``` #### Option #2 - Engine-centric approach to building a project @@ -77,9 +79,10 @@ This option will output all the project and engine binaries in the engine's buil # example configure command > cmake c:/path/to/o3de -B c:/path/to/o3de/build -G "Visual Studio 16" -DLY_3RDPARTY_PATH="c:/3rdparty" -DLY_PROJECTS="c:/path/to/o3de-multiplayersample" -# example build command +# example build commands > cmake --build c:/path/to/o3de/build --target Editor MultiplayerSample.GameLauncher --config profile -- /m /nologo +> cmake --build c:/path/to/o3de/build --target Editor MultiplayerSample.ServerLauncher --config profile -- /m /nologo ``` ### Step 4. Setup Client and Server @@ -101,17 +104,7 @@ If these cfg files are not present, create them as they will be used to when lau #### Running the Server -First, make sure the server target has been built - -```shell -# example command for Project-centric approach -> cmake --build c:/path/to/o3de-multiplayersample/build --target Editor MultiplayerSample.ServerLauncher --config profile -- /m /nologo - -# example command for Engine-centric approach -> cmake --build c:/path/to/o3de/build --target Editor MultiplayerSample.ServerLauncher --config profile -- /m /nologo -``` - -A server can then be run as follows +A server can be run as follows ```shell MultiplayerSample.ServerLauncher.exe --console-command-file=server.cfg From dda949965a523a5832b3ac5bc2cdbd3367a8af73 Mon Sep 17 00:00:00 2001 From: allisaurus <34254888+allisaurus@users.noreply.github.com> Date: Thu, 16 Dec 2021 16:03:46 -0800 Subject: [PATCH 14/71] unify build commands Signed-off-by: allisaurus <34254888+allisaurus@users.noreply.github.com> --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8919765df..4d10c90da 100644 --- a/README.md +++ b/README.md @@ -65,10 +65,8 @@ This option will output all the project binaries in the project's build folder e # example configure command > cmake c:/path/to/o3de -B c:/path/to/o3de-multiplayersample/build -G "Visual Studio 16" -DLY_3RDPARTY_PATH="c:/3rdparty" -DLY_PROJECTS="c:/path/to/o3de-multiplayersample" -# example build commands -> cmake --build c:/path/to/o3de-multiplayersample/build --target Editor MultiplayerSample.GameLauncher --config profile -- /m /nologo - -> cmake --build c:/path/to/o3de-multiplayersample/build --target Editor MultiplayerSample.ServerLauncher --config profile -- /m /nologo +# example build command +> cmake --build c:/path/to/o3de-multiplayersample/build --target Editor MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher --config profile -- /m /nologo ``` #### Option #2 - Engine-centric approach to building a project @@ -79,10 +77,8 @@ This option will output all the project and engine binaries in the engine's buil # example configure command > cmake c:/path/to/o3de -B c:/path/to/o3de/build -G "Visual Studio 16" -DLY_3RDPARTY_PATH="c:/3rdparty" -DLY_PROJECTS="c:/path/to/o3de-multiplayersample" -# example build commands -> cmake --build c:/path/to/o3de/build --target Editor MultiplayerSample.GameLauncher --config profile -- /m /nologo - -> cmake --build c:/path/to/o3de/build --target Editor MultiplayerSample.ServerLauncher --config profile -- /m /nologo +# example build command +> cmake --build c:/path/to/o3de/build --target Editor MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher --config profile -- /m /nologo ``` ### Step 4. Setup Client and Server From 553458d393a1133faeff44177514068975fba61f Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Tue, 4 Jan 2022 11:06:15 -0500 Subject: [PATCH 15/71] Added a direction light Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Levels/SampleBase/SampleBase.prefab | 1597 +++++++++++++++++++++++---- 1 file changed, 1406 insertions(+), 191 deletions(-) diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index 6d347e9b2..5561e60b5 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -53,7 +53,18 @@ }, "Component_[8247764638131379605]": { "$type": "EditorEntitySortComponent", - "Id": 8247764638131379605 + "Id": 8247764638131379605, + "Child Entity Order": [ + "Instance_[2834016307555]/ContainerEntity", + "Instance_[2915620686179]/ContainerEntity", + "Instance_[3293577808227]/ContainerEntity", + "Instance_[785316907363]/ContainerEntity", + "Entity_[830977005898]", + "Entity_[611359903594]", + "Entity_[412839637138]", + "Entity_[1863191303392]", + "Entity_[14030996048227]" + ] } } }, @@ -149,22 +160,10 @@ "$type": "EditorScriptCanvasComponent", "Id": 12802329719955739455, "m_name": "SpawnIfAuthority", - "m_assetHolder": { - "m_asset": { - "assetId": { - "guid": "{B605AD71-0689-5650-B3F5-558D471B6351}" - }, - "assetHint": "scriptcanvas/spawnifauthority.scriptcanvas" - } - }, "runtimeDataIsValid": true, - "runtimeDataOverrides": { - "source": { - "assetId": { - "guid": "{B605AD71-0689-5650-B3F5-558D471B6351}" - }, - "assetHint": "scriptcanvas/spawnifauthority.scriptcanvas" - } + "sourceHandle": { + "id": "{B605AD71-0689-5650-B3F5-558D471B6351}", + "path": "scriptcanvas/spawnifauthority.scriptcanvas" } }, "Component_[15194128185768259769]": { @@ -220,28 +219,6 @@ "Id": "Entity_[412839637138]", "Name": "Ground and Sky", "Components": { - "Component_[13700729619015137843]": { - "$type": "AZ::Render::EditorImageBasedLightComponent", - "Id": 13700729619015137843, - "Controller": { - "Configuration": { - "diffuseImageAsset": { - "assetId": { - "guid": "{4CF4C63C-B317-5E0B-B523-44167A02F81E}", - "subId": 3000 - }, - "assetHint": "testdata/lightingpresets/beach_parking_1k_iblglobalcm_ibldiffuse.exr.streamingimage" - }, - "specularImageAsset": { - "assetId": { - "guid": "{4CF4C63C-B317-5E0B-B523-44167A02F81E}", - "subId": 2000 - }, - "assetHint": "testdata/lightingpresets/beach_parking_1k_iblglobalcm_iblspecular.exr.streamingimage" - } - } - } - }, "Component_[14576502551830180300]": { "$type": "EditorColliderComponent", "Id": 14576502551830180300, @@ -278,7 +255,10 @@ }, "Component_[15840258338216491819]": { "$type": "EditorEntitySortComponent", - "Id": 15840258338216491819 + "Id": 15840258338216491819, + "Child Entity Order": [ + "Entity_[611359903594]" + ] }, "Component_[16611535888956034510]": { "$type": "EditorMaterialComponent", @@ -296,112 +276,7 @@ } } } - }, - "defaultMaterialSlot": { - "materialAsset": { - "assetId": { - "guid": "{39704C53-AC3A-51BE-81EA-23CEA2455340}" - }, - "assetHint": "materials/defaultpbr.azmaterial" - } - }, - "materialSlots": [ - { - "id": { - "materialSlotStableId": 803645540 - } - }, - { - "id": { - "materialSlotStableId": 803645540 - } - }, - { - "id": { - "materialSlotStableId": 803645540 - } - }, - { - "id": { - "materialSlotStableId": 803645540 - } - }, - { - "id": { - "materialSlotStableId": 803645540 - } - }, - { - "id": { - "materialSlotStableId": 803645540 - } - }, - { - "materialAsset": { - "assetId": { - "guid": "{39704C53-AC3A-51BE-81EA-23CEA2455340}" - }, - "assetHint": "materials/defaultpbr.azmaterial" - } - } - ], - "materialSlotsByLod": [ - [ - { - "id": { - "lodIndex": 0, - "materialSlotStableId": 803645540 - } - } - ], - [ - { - "id": { - "lodIndex": 0, - "materialSlotStableId": 803645540 - } - } - ], - [ - { - "id": { - "lodIndex": 0, - "materialSlotStableId": 803645540 - } - } - ], - [ - { - "id": { - "lodIndex": 0, - "materialSlotStableId": 803645540 - } - } - ], - [ - { - "id": { - "lodIndex": 0, - "materialSlotStableId": 803645540 - } - } - ], - [ - { - "id": { - "lodIndex": 0, - "materialSlotStableId": 803645540 - } - } - ], - [ - { - "id": { - "lodIndex": 0 - } - } - ] - ] + } }, "Component_[1703359235958163404]": { "$type": "AZ::Render::EditorMeshComponent", @@ -450,18 +325,78 @@ "$type": "EditorVisibilityComponent", "Id": 3412423409421084023 }, - "Component_[6818347252800527841]": { - "$type": "AZ::Render::EditorPhysicalSkyComponent", - "Id": 6818347252800527841, + "Component_[7297856704634960860]": { + "$type": "SelectionComponent", + "Id": 7297856704634960860 + } + } + }, + "Entity_[611359903594]": { + "Id": "Entity_[611359903594]", + "Name": "Sky", + "Components": { + "Component_[12020387915929175314]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12020387915929175314 + }, + "Component_[12113168580323165094]": { + "$type": "EditorEntitySortComponent", + "Id": 12113168580323165094 + }, + "Component_[13428084923771247637]": { + "$type": "SelectionComponent", + "Id": 13428084923771247637 + }, + "Component_[16939772704288602141]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16939772704288602141, + "Parent Entity": "Entity_[356758116574]", + "Transform Data": { + "Translate": [ + 0.0, + 20.376968383789063, + 0.0 + ], + "Rotate": [ + -69.53874206542969, + 4.26886799687054e-7, + -12.672533988952637 + ] + } + }, + "Component_[181484920425426795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 181484920425426795 + }, + "Component_[1924698028746237056]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1924698028746237056 + }, + "Component_[3097249092599449156]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 3097249092599449156, "Controller": { "Configuration": { - "SkyIntensity": 5.0 + "Intensity": 1.0, + "CameraEntityId": "" } } }, - "Component_[7297856704634960860]": { - "$type": "SelectionComponent", - "Id": 7297856704634960860 + "Component_[3991835182627485406]": { + "$type": "EditorLockComponent", + "Id": 3991835182627485406 + }, + "Component_[8034472642282561588]": { + "$type": "EditorInspectorComponent", + "Id": 8034472642282561588 + }, + "Component_[8915786006739025830]": { + "$type": "EditorVisibilityComponent", + "Id": 8915786006739025830 + }, + "Component_[9242372134971919133]": { + "$type": "EditorEntityIconComponent", + "Id": 9242372134971919133 } } }, @@ -519,7 +454,7 @@ "Id": 7092071161962745685, "Controller": { "Configuration": { - "EditorEntityId": 15375043528419945729 + "EditorEntityId": 4798108558725889184 } } }, @@ -543,6 +478,326 @@ "path": "/ContainerEntity/Name", "value": "4x4x4x4BoxGrid" }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/0", + "value": "Entity_[596338346339]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/1", + "value": "Entity_[763842070883]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/2", + "value": "Entity_[510439000419]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/3", + "value": "Entity_[725187365219]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/4", + "value": "Entity_[519028935011]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/5", + "value": "Entity_[506144033123]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/6", + "value": "Entity_[549093706083]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/7", + "value": "Entity_[630698084707]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/8", + "value": "Entity_[609223248227]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/9", + "value": "Entity_[613518215523]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/10", + "value": "Entity_[557683640675]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/11", + "value": "Entity_[772432005475]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/12", + "value": "Entity_[720892397923]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/13", + "value": "Entity_[673647757667]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/14", + "value": "Entity_[669352790371]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/15", + "value": "Entity_[768137038179]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/16", + "value": "Entity_[540503771491]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/17", + "value": "Entity_[652172921187]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/18", + "value": "Entity_[750957168995]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/19", + "value": "Entity_[695122594147]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/20", + "value": "Entity_[579158477155]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/21", + "value": "Entity_[531913836899]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/22", + "value": "Entity_[583453444451]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/23", + "value": "Entity_[755252136291]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/24", + "value": "Entity_[617813182819]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/25", + "value": "Entity_[634993052003]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/26", + "value": "Entity_[553388673379]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/27", + "value": "Entity_[622108150115]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/28", + "value": "Entity_[639288019299]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/29", + "value": "Entity_[570568542563]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/30", + "value": "Entity_[643582986595]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/31", + "value": "Entity_[647877953891]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/32", + "value": "Entity_[729482332515]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/33", + "value": "Entity_[626403117411]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/34", + "value": "Entity_[536208804195]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/35", + "value": "Entity_[665057823075]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/36", + "value": "Entity_[527618869603]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/37", + "value": "Entity_[592043379043]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/38", + "value": "Entity_[781021940067]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/39", + "value": "Entity_[566273575267]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/40", + "value": "Entity_[561978607971]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/41", + "value": "Entity_[682237692259]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/42", + "value": "Entity_[660762855779]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/43", + "value": "Entity_[523323902307]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/44", + "value": "Entity_[738072267107]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/45", + "value": "Entity_[699417561443]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/46", + "value": "Entity_[574863509859]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/47", + "value": "Entity_[604928280931]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/48", + "value": "Entity_[600633313635]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/49", + "value": "Entity_[544798738787]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/50", + "value": "Entity_[776726972771]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/51", + "value": "Entity_[677942724963]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/52", + "value": "Entity_[716597430627]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/53", + "value": "Entity_[746662201699]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/54", + "value": "Entity_[514733967715]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/55", + "value": "Entity_[759547103587]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/56", + "value": "Entity_[656467888483]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/57", + "value": "Entity_[742367234403]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/58", + "value": "Entity_[587748411747]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/59", + "value": "Entity_[686532659555]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/60", + "value": "Entity_[712302463331]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/61", + "value": "Entity_[703712528739]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/62", + "value": "Entity_[733777299811]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/63", + "value": "Entity_[708007496035]" + }, { "op": "replace", "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Parent Entity", @@ -578,63 +833,703 @@ "value": "4x4x4x4BoxGrid" }, { - "op": "replace", - "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Parent Entity", - "value": "../Entity_[356758116574]" + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/0", + "value": "Entity_[596338346339]" }, { - "op": "replace", - "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Transform Data/Translate/0", - "value": 4.981606483459473 + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/1", + "value": "Entity_[763842070883]" }, { - "op": "replace", - "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Transform Data/Translate/1", - "value": 4.986534118652344 + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/2", + "value": "Entity_[510439000419]" }, { - "op": "replace", - "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Transform Data/Translate/2", - "value": 0.5 + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/3", + "value": "Entity_[725187365219]" }, { - "op": "remove", - "path": "/LinkId" - } - ] - }, - "Instance_[3293577808227]": { - "Source": "Prefabs/4x4x4BoxGrid.prefab", - "Patches": [ + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/4", + "value": "Entity_[519028935011]" + }, { - "op": "replace", - "path": "/ContainerEntity/Name", - "value": "4x4x4x4BoxGrid" + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/5", + "value": "Entity_[506144033123]" }, { - "op": "replace", - "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Parent Entity", - "value": "../Entity_[356758116574]" + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/6", + "value": "Entity_[549093706083]" }, { - "op": "replace", - "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Transform Data/Translate/0", - "value": -5.018393516540527 + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/7", + "value": "Entity_[630698084707]" }, { - "op": "replace", - "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Transform Data/Translate/1", - "value": -5.013465881347656 + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/8", + "value": "Entity_[609223248227]" }, { - "op": "replace", - "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Transform Data/Translate/2", - "value": 0.5 + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/9", + "value": "Entity_[613518215523]" }, { - "op": "remove", - "path": "/LinkId" - } + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/10", + "value": "Entity_[557683640675]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/11", + "value": "Entity_[772432005475]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/12", + "value": "Entity_[720892397923]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/13", + "value": "Entity_[673647757667]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/14", + "value": "Entity_[669352790371]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/15", + "value": "Entity_[768137038179]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/16", + "value": "Entity_[540503771491]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/17", + "value": "Entity_[652172921187]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/18", + "value": "Entity_[750957168995]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/19", + "value": "Entity_[695122594147]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/20", + "value": "Entity_[579158477155]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/21", + "value": "Entity_[531913836899]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/22", + "value": "Entity_[583453444451]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/23", + "value": "Entity_[755252136291]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/24", + "value": "Entity_[617813182819]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/25", + "value": "Entity_[634993052003]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/26", + "value": "Entity_[553388673379]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/27", + "value": "Entity_[622108150115]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/28", + "value": "Entity_[639288019299]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/29", + "value": "Entity_[570568542563]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/30", + "value": "Entity_[643582986595]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/31", + "value": "Entity_[647877953891]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/32", + "value": "Entity_[729482332515]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/33", + "value": "Entity_[626403117411]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/34", + "value": "Entity_[536208804195]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/35", + "value": "Entity_[665057823075]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/36", + "value": "Entity_[527618869603]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/37", + "value": "Entity_[592043379043]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/38", + "value": "Entity_[781021940067]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/39", + "value": "Entity_[566273575267]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/40", + "value": "Entity_[561978607971]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/41", + "value": "Entity_[682237692259]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/42", + "value": "Entity_[660762855779]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/43", + "value": "Entity_[523323902307]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/44", + "value": "Entity_[738072267107]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/45", + "value": "Entity_[699417561443]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/46", + "value": "Entity_[574863509859]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/47", + "value": "Entity_[604928280931]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/48", + "value": "Entity_[600633313635]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/49", + "value": "Entity_[544798738787]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/50", + "value": "Entity_[776726972771]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/51", + "value": "Entity_[677942724963]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/52", + "value": "Entity_[716597430627]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/53", + "value": "Entity_[746662201699]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/54", + "value": "Entity_[514733967715]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/55", + "value": "Entity_[759547103587]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/56", + "value": "Entity_[656467888483]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/57", + "value": "Entity_[742367234403]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/58", + "value": "Entity_[587748411747]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/59", + "value": "Entity_[686532659555]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/60", + "value": "Entity_[712302463331]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/61", + "value": "Entity_[703712528739]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/62", + "value": "Entity_[733777299811]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/63", + "value": "Entity_[708007496035]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Parent Entity", + "value": "../Entity_[356758116574]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Transform Data/Translate/0", + "value": 4.981606483459473 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Transform Data/Translate/1", + "value": 4.986534118652344 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Transform Data/Translate/2", + "value": 0.5 + }, + { + "op": "remove", + "path": "/LinkId" + } + ] + }, + "Instance_[3293577808227]": { + "Source": "Prefabs/4x4x4BoxGrid.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Name", + "value": "4x4x4x4BoxGrid" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/0", + "value": "Entity_[596338346339]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/1", + "value": "Entity_[763842070883]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/2", + "value": "Entity_[510439000419]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/3", + "value": "Entity_[725187365219]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/4", + "value": "Entity_[519028935011]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/5", + "value": "Entity_[506144033123]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/6", + "value": "Entity_[549093706083]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/7", + "value": "Entity_[630698084707]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/8", + "value": "Entity_[609223248227]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/9", + "value": "Entity_[613518215523]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/10", + "value": "Entity_[557683640675]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/11", + "value": "Entity_[772432005475]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/12", + "value": "Entity_[720892397923]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/13", + "value": "Entity_[673647757667]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/14", + "value": "Entity_[669352790371]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/15", + "value": "Entity_[768137038179]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/16", + "value": "Entity_[540503771491]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/17", + "value": "Entity_[652172921187]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/18", + "value": "Entity_[750957168995]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/19", + "value": "Entity_[695122594147]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/20", + "value": "Entity_[579158477155]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/21", + "value": "Entity_[531913836899]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/22", + "value": "Entity_[583453444451]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/23", + "value": "Entity_[755252136291]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/24", + "value": "Entity_[617813182819]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/25", + "value": "Entity_[634993052003]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/26", + "value": "Entity_[553388673379]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/27", + "value": "Entity_[622108150115]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/28", + "value": "Entity_[639288019299]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/29", + "value": "Entity_[570568542563]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/30", + "value": "Entity_[643582986595]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/31", + "value": "Entity_[647877953891]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/32", + "value": "Entity_[729482332515]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/33", + "value": "Entity_[626403117411]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/34", + "value": "Entity_[536208804195]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/35", + "value": "Entity_[665057823075]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/36", + "value": "Entity_[527618869603]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/37", + "value": "Entity_[592043379043]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/38", + "value": "Entity_[781021940067]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/39", + "value": "Entity_[566273575267]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/40", + "value": "Entity_[561978607971]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/41", + "value": "Entity_[682237692259]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/42", + "value": "Entity_[660762855779]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/43", + "value": "Entity_[523323902307]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/44", + "value": "Entity_[738072267107]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/45", + "value": "Entity_[699417561443]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/46", + "value": "Entity_[574863509859]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/47", + "value": "Entity_[604928280931]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/48", + "value": "Entity_[600633313635]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/49", + "value": "Entity_[544798738787]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/50", + "value": "Entity_[776726972771]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/51", + "value": "Entity_[677942724963]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/52", + "value": "Entity_[716597430627]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/53", + "value": "Entity_[746662201699]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/54", + "value": "Entity_[514733967715]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/55", + "value": "Entity_[759547103587]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/56", + "value": "Entity_[656467888483]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/57", + "value": "Entity_[742367234403]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/58", + "value": "Entity_[587748411747]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/59", + "value": "Entity_[686532659555]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/60", + "value": "Entity_[712302463331]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/61", + "value": "Entity_[703712528739]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/62", + "value": "Entity_[733777299811]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/63", + "value": "Entity_[708007496035]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Parent Entity", + "value": "../Entity_[356758116574]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Transform Data/Translate/0", + "value": -5.018393516540527 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Transform Data/Translate/1", + "value": -5.013465881347656 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Transform Data/Translate/2", + "value": 0.5 + }, + { + "op": "remove", + "path": "/LinkId" + } ] }, "Instance_[785316907363]": { @@ -645,6 +1540,326 @@ "path": "/ContainerEntity/Name", "value": "4x4x4x4BoxGrid" }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/0", + "value": "Entity_[596338346339]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/1", + "value": "Entity_[763842070883]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/2", + "value": "Entity_[510439000419]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/3", + "value": "Entity_[725187365219]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/4", + "value": "Entity_[519028935011]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/5", + "value": "Entity_[506144033123]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/6", + "value": "Entity_[549093706083]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/7", + "value": "Entity_[630698084707]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/8", + "value": "Entity_[609223248227]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/9", + "value": "Entity_[613518215523]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/10", + "value": "Entity_[557683640675]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/11", + "value": "Entity_[772432005475]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/12", + "value": "Entity_[720892397923]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/13", + "value": "Entity_[673647757667]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/14", + "value": "Entity_[669352790371]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/15", + "value": "Entity_[768137038179]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/16", + "value": "Entity_[540503771491]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/17", + "value": "Entity_[652172921187]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/18", + "value": "Entity_[750957168995]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/19", + "value": "Entity_[695122594147]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/20", + "value": "Entity_[579158477155]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/21", + "value": "Entity_[531913836899]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/22", + "value": "Entity_[583453444451]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/23", + "value": "Entity_[755252136291]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/24", + "value": "Entity_[617813182819]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/25", + "value": "Entity_[634993052003]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/26", + "value": "Entity_[553388673379]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/27", + "value": "Entity_[622108150115]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/28", + "value": "Entity_[639288019299]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/29", + "value": "Entity_[570568542563]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/30", + "value": "Entity_[643582986595]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/31", + "value": "Entity_[647877953891]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/32", + "value": "Entity_[729482332515]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/33", + "value": "Entity_[626403117411]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/34", + "value": "Entity_[536208804195]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/35", + "value": "Entity_[665057823075]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/36", + "value": "Entity_[527618869603]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/37", + "value": "Entity_[592043379043]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/38", + "value": "Entity_[781021940067]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/39", + "value": "Entity_[566273575267]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/40", + "value": "Entity_[561978607971]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/41", + "value": "Entity_[682237692259]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/42", + "value": "Entity_[660762855779]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/43", + "value": "Entity_[523323902307]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/44", + "value": "Entity_[738072267107]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/45", + "value": "Entity_[699417561443]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/46", + "value": "Entity_[574863509859]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/47", + "value": "Entity_[604928280931]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/48", + "value": "Entity_[600633313635]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/49", + "value": "Entity_[544798738787]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/50", + "value": "Entity_[776726972771]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/51", + "value": "Entity_[677942724963]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/52", + "value": "Entity_[716597430627]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/53", + "value": "Entity_[746662201699]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/54", + "value": "Entity_[514733967715]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/55", + "value": "Entity_[759547103587]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/56", + "value": "Entity_[656467888483]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/57", + "value": "Entity_[742367234403]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/58", + "value": "Entity_[587748411747]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/59", + "value": "Entity_[686532659555]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/60", + "value": "Entity_[712302463331]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/61", + "value": "Entity_[703712528739]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/62", + "value": "Entity_[733777299811]" + }, + { + "op": "add", + "path": "/ContainerEntity/Components/Component_[2180669853693886392]/Child Entity Order/63", + "value": "Entity_[708007496035]" + }, { "op": "replace", "path": "/ContainerEntity/Components/Component_[4107956514252411312]/Parent Entity", From 10f67f671f2237bb942d790337e01b1efd0413bb Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Thu, 6 Jan 2022 12:28:01 -0500 Subject: [PATCH 16/71] Added skyboxes Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Levels/SampleBase/SampleBase.prefab | 52 +++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index 5561e60b5..4bd960be3 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -217,7 +217,7 @@ }, "Entity_[412839637138]": { "Id": "Entity_[412839637138]", - "Name": "Ground and Sky", + "Name": "Ground", "Components": { "Component_[14576502551830180300]": { "$type": "EditorColliderComponent", @@ -347,20 +347,31 @@ "$type": "SelectionComponent", "Id": 13428084923771247637 }, + "Component_[15868007870507055798]": { + "$type": "AZ::Render::EditorPhysicalSkyComponent", + "Id": 15868007870507055798, + "Controller": { + "Configuration": { + "FogSettings": { + "Enable": true + } + } + } + }, "Component_[16939772704288602141]": { "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", "Id": 16939772704288602141, "Parent Entity": "Entity_[356758116574]", "Transform Data": { "Translate": [ - 0.0, - 20.376968383789063, - 0.0 + -4.764087677001953, + 12.970443725585938, + 19.850555419921875 ], "Rotate": [ -69.53874206542969, - 4.26886799687054e-7, - -12.672533988952637 + -4.26886799687054e-7, + -12.672529220581055 ] } }, @@ -377,7 +388,12 @@ "Id": 3097249092599449156, "Controller": { "Configuration": { - "Intensity": 1.0, + "Color": [ + 0.26219576597213745, + 0.4600900411605835, + 0.5198748707771301 + ], + "Intensity": 0.0, "CameraEntityId": "" } } @@ -386,6 +402,28 @@ "$type": "EditorLockComponent", "Id": 3991835182627485406 }, + "Component_[5074029630700212404]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 5074029630700212404, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{A5767C6B-5DB4-5999-A717-4587BEDF5CDE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/default_iblskyboxcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{FF892EA4-60B2-5E14-8610-CA2A793C86A7}", + "subId": 2000 + }, + "assetHint": "engineassets/textures/cubemap/default_level_cubemap_iblspecular.tif.streamingimage" + } + } + } + }, "Component_[8034472642282561588]": { "$type": "EditorInspectorComponent", "Id": 8034472642282561588 From a8de0198b0e74836826c30286a60f7e5a4c33fb4 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Thu, 20 Jan 2022 12:05:19 -0500 Subject: [PATCH 17/71] Perf spawn test level Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Gem/Code/CMakeLists.txt | 1 + .../Include/NetworkPrefabSpawnerInterface.h | 40 ++ .../NetworkPrefabSpawnerComponent.cpp | 285 ++++++++ .../PerfTest/NetworkPrefabSpawnerComponent.h | 72 ++ .../PerfTest/NetworkTestComponent.cpp | 68 ++ .../PerfTest/NetworkTestComponent.h | 49 ++ .../PerfTest/NetworkTestSpawnerComponent.cpp | 100 +++ .../PerfTest/NetworkTestSpawnerComponent.h | 55 ++ Gem/Code/Source/MultiplayerSampleModule.cpp | 6 + Gem/Code/multiplayersample_files.cmake | 7 + .../SpawningPerfTest/SpawningPerfTest.prefab | 645 ++++++++++++++++++ .../2022-01-20 [09.42.00]/tags.txt | 12 + Levels/SpawningPerfTest/tags.txt | 12 + Prefabs/Test_Net_Object.prefab | 219 ++++++ 14 files changed, 1571 insertions(+) create mode 100644 Gem/Code/Include/NetworkPrefabSpawnerInterface.h create mode 100644 Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp create mode 100644 Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h create mode 100644 Gem/Code/Source/Components/PerfTest/NetworkTestComponent.cpp create mode 100644 Gem/Code/Source/Components/PerfTest/NetworkTestComponent.h create mode 100644 Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp create mode 100644 Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.h create mode 100644 Levels/SpawningPerfTest/SpawningPerfTest.prefab create mode 100644 Levels/SpawningPerfTest/_savebackup/2022-01-20 [09.42.00]/tags.txt create mode 100644 Levels/SpawningPerfTest/tags.txt create mode 100644 Prefabs/Test_Net_Object.prefab diff --git a/Gem/Code/CMakeLists.txt b/Gem/Code/CMakeLists.txt index 63f789a6b..6e122beb3 100644 --- a/Gem/Code/CMakeLists.txt +++ b/Gem/Code/CMakeLists.txt @@ -6,6 +6,7 @@ # ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +#o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME MultiplayerSample.Static STATIC diff --git a/Gem/Code/Include/NetworkPrefabSpawnerInterface.h b/Gem/Code/Include/NetworkPrefabSpawnerInterface.h new file mode 100644 index 000000000..2ae2ad581 --- /dev/null +++ b/Gem/Code/Include/NetworkPrefabSpawnerInterface.h @@ -0,0 +1,40 @@ +#pragma once + +#include +#include + +namespace MultiplayerSample +{ + using PrefabSpawnCallbackBeforeActivation = AZStd::function, + AzFramework::SpawnableEntityContainerView)>; + + using PrefabSpawnCallback = AZStd::function, + AzFramework::SpawnableConstEntityContainerView)>; + + struct PrefabCallbacks + { + PrefabSpawnCallbackBeforeActivation m_beforeActivateCallback; + PrefabSpawnCallback m_onActivateCallback; + }; + + class NetworkPrefabSpawnerRequests + { + public: + AZ_RTTI(RecastO3DEGemRequests, "{82e5cfb5-6a1a-4bd1-b48d-cd817474d611}"); + virtual ~NetworkPrefabSpawnerRequests() = default; + + virtual void SpawnPrefab(const AZ::Transform& worldTm, const char* assetPath, PrefabCallbacks callbacks) = 0; + virtual void SpawnPrefabAsset(const AZ::Transform& worldTm, const AZ::Data::Asset& asset, PrefabCallbacks callbacks) = 0; + virtual void SpawnDefaultPrefab(const AZ::Transform& worldTm, PrefabCallbacks callbacks) = 0; + }; + + class NetworkPrefabSpawnerTraits + : public AZ::ComponentBus + { + }; + + using NetworkPrefabSpawnerRequestBus = AZ::EBus; + using NetworkPrefabSpawnerInterface = AZ::Interface; +} diff --git a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp new file mode 100644 index 000000000..7c489262f --- /dev/null +++ b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp @@ -0,0 +1,285 @@ + +#include "NetworkPrefabSpawnerComponent.h" + +#include +#include +#include +#include +#include +#include +#include + +namespace MultiplayerSample +{ + void NetworkPrefabSpawnerComponent::Reflect(AZ::ReflectContext* reflection) + { + if (const auto serializationContext = azrtti_cast(reflection)) + { + serializationContext->Class() + ->Field("Default Prefab", &NetworkPrefabSpawnerComponent::m_defaultSpawnableAsset) + ->Version(1); + + if (const auto editContext = serializationContext->GetEditContext()) + { + editContext->Class("Network Prefab Spawner", + "Handles spawning of prefabs") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Category, "MultiplayerSample") + ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game")) + ->DataElement(nullptr, &NetworkPrefabSpawnerComponent::m_defaultSpawnableAsset, "Default Prefab", "Default prefab to spawn upon request.") + ; + } + } + } + + void NetworkPrefabSpawnerComponent::Activate() + { + if (NetworkPrefabSpawnerInterface::Get() == nullptr) + { + NetworkPrefabSpawnerInterface::Register(this); + } + + NetworkPrefabSpawnerRequestBus::Handler::BusConnect(GetEntityId()); + + // preload + if (m_defaultSpawnableAsset.GetId().IsValid()) + { + m_defaultSpawnableAsset.QueueLoad(); + } + } + + void NetworkPrefabSpawnerComponent::Deactivate() + { + if (NetworkPrefabSpawnerInterface::Get() == this) + { + NetworkPrefabSpawnerInterface::Unregister(this); + } + + NetworkPrefabSpawnerRequestBus::Handler::BusDisconnect(); + AZ::Data::AssetBus::MultiHandler::BusDisconnect(); + } + + void NetworkPrefabSpawnerComponent::SpawnDefaultPrefab(const AZ::Transform& worldTm, PrefabCallbacks callbacks) + { + AssetItem newAsset; + newAsset.m_pathToAsset = m_defaultSpawnableAsset.GetHint().c_str(); + newAsset.m_spawnableAsset = m_defaultSpawnableAsset; + AZ::Data::AssetBus::MultiHandler::BusConnect(m_defaultSpawnableAsset.GetId()); + + if (newAsset.m_spawnableAsset.IsReady() == false) + { + newAsset.m_spawnableAsset.QueueLoad(); + } + + m_assetMap.emplace(newAsset.m_spawnableAsset.GetId(), newAsset); + + const SpawnRequest request{ newAsset.m_spawnableAsset.GetId(), worldTm, AZStd::move(callbacks) }; + if (newAsset.m_spawnableAsset.IsReady()) + { + CreateInstance(request, &newAsset); + } + else + { + m_requests.push_back(request); + } + } + + void NetworkPrefabSpawnerComponent::SpawnPrefab(const AZ::Transform& worldTm, const char* assetPath, PrefabCallbacks callbacks) + { + const AZ::Data::AssetId assetId = GetSpawnableAssetId(assetPath); + + const SpawnRequest request{ assetId, worldTm, AZStd::move(callbacks) }; + auto foundAsset = m_assetMap.find(assetId); + if (foundAsset != m_assetMap.end()) + { + if (foundAsset->second.m_spawnableAsset.IsReady()) + { + CreateInstance(request, &foundAsset->second); + } + else + { + m_requests.push_back(request); + } + } + else + { + AssetItem newAsset; + newAsset.m_pathToAsset = assetPath; + newAsset.m_spawnableAsset.Create(assetId, false); + AZ::Data::AssetBus::MultiHandler::BusConnect(assetId); + newAsset.m_spawnableAsset.QueueLoad(); + m_assetMap.emplace(assetId, newAsset); + + if (newAsset.m_spawnableAsset.IsReady()) + { + CreateInstance(request, &newAsset); + } + else + { + m_requests.push_back(request); + } + } + } + + void NetworkPrefabSpawnerComponent::SpawnPrefabAsset(const AZ::Transform& worldTm, + const AZ::Data::Asset& asset, PrefabCallbacks callbacks) + { + AssetItem newAsset; + newAsset.m_pathToAsset = asset.GetHint().c_str(); + newAsset.m_spawnableAsset = asset; + AZ::Data::AssetBus::MultiHandler::BusConnect(asset.GetId()); + + if (newAsset.m_spawnableAsset.IsReady() == false) + { + newAsset.m_spawnableAsset.QueueLoad(); + } + + m_assetMap.emplace(newAsset.m_spawnableAsset.GetId(), newAsset); + + const SpawnRequest request{ newAsset.m_spawnableAsset.GetId(), worldTm, AZStd::move(callbacks) }; + if (newAsset.m_spawnableAsset.IsReady()) + { + CreateInstance(request, &newAsset); + } + else + { + m_requests.push_back(request); + } + } + + AZ::Data::AssetId NetworkPrefabSpawnerComponent::GetSpawnableAssetId(const char* assetPath) const + { + if (assetPath) + { + AZ::Data::AssetId assetId; + AZ::Data::AssetCatalogRequestBus::BroadcastResult( + assetId, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, assetPath, + AZ::Data::s_invalidAssetType, false); + if (assetId.IsValid()) + { + return assetId; + } + } + + return {}; + } + + void NetworkPrefabSpawnerComponent::CreateInstance(const SpawnRequest& request, const AssetItem* asset) + { + AZ::Transform world = request.m_whereToSpawn; + + if (asset) + { + auto ticket = AZStd::make_shared(asset->m_spawnableAsset); + + auto preSpawnCallback = [world, request, ticket]([[maybe_unused]] AzFramework::EntitySpawnTicket::Id ticketId, AzFramework::SpawnableEntityContainerView view) + { + const AZ::Entity* rootEntity = *view.begin(); + if (AzFramework::TransformComponent* entityTransform = rootEntity->FindComponent()) + { + entityTransform->SetWorldTM(world); + } + + if (request.m_callbacks.m_beforeActivateCallback) + { + request.m_callbacks.m_beforeActivateCallback(ticket, view); + } + }; + + auto onSpawnedCallback = [request, ticket]([[maybe_unused]] AzFramework::EntitySpawnTicket::Id ticketId, AzFramework::SpawnableConstEntityContainerView view) + { + if (request.m_callbacks.m_onActivateCallback) + { + request.m_callbacks.m_onActivateCallback(ticket, view); + } + }; + + if (ticket->IsValid()) + { + AzFramework::SpawnAllEntitiesOptionalArgs optionalArgs; + optionalArgs.m_preInsertionCallback = AZStd::move(preSpawnCallback); + optionalArgs.m_completionCallback = AZStd::move(onSpawnedCallback); + AzFramework::SpawnableEntitiesInterface::Get()->SpawnAllEntities(*ticket, AZStd::move(optionalArgs)); + } + else + { + AZ_Assert(ticket->IsValid(), "Unable to instantiate spawnable asset"); + } + } + else + { + AZ_Assert(asset, "AssetMap didn't contain the asset id for prefab spawning"); + + } + } + + void NetworkPrefabSpawnerComponent::OnAssetReady(AZ::Data::Asset asset) + { + const AZ::Data::AssetId assetId = asset.GetId(); + AZ::Data::AssetBus::MultiHandler::BusDisconnect(assetId); + + const auto foundAsset = m_assetMap.find(assetId); + if (foundAsset != m_assetMap.end()) + { + for (auto requestIterator = m_requests.begin(); requestIterator < m_requests.end(); /*iterating inside the loop body*/) + { + const SpawnRequest& request = *requestIterator; + + if (request.m_assetIdToSpawn == assetId) + { + CreateInstance(request, &foundAsset->second); + requestIterator = m_requests.erase(requestIterator); + } + else + { + ++requestIterator; + } + } + } + } + + void NetworkPrefabSpawnerComponent::OnAssetCanceled(AZ::Data::AssetId assetId) + { + AZ_Printf("TEST", "%s %s", __FUNCTION__, assetId.ToString().c_str()); + } + + void NetworkPrefabSpawnerComponent::OnAssetContainerReady(AZ::Data::Asset assetData) + { + AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); + } + + void NetworkPrefabSpawnerComponent::OnAssetError(AZ::Data::Asset assetData) + { + AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); + } + + void NetworkPrefabSpawnerComponent::OnAssetMoved(AZ::Data::Asset assetData, [[maybe_unused]] void* oldDataPointer) + { + AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); + } + + void NetworkPrefabSpawnerComponent::OnAssetPreReload(AZ::Data::Asset assetData) + { + AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); + } + + void NetworkPrefabSpawnerComponent::OnAssetReloadError(AZ::Data::Asset assetData) + { + AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); + } + + void NetworkPrefabSpawnerComponent::OnAssetReloaded(AZ::Data::Asset assetData) + { + AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); + } + + void NetworkPrefabSpawnerComponent::OnAssetSaved(AZ::Data::Asset assetData, [[maybe_unused]] bool isSuccessful) + { + AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); + } + + void NetworkPrefabSpawnerComponent::OnAssetUnloaded(const AZ::Data::AssetId assetId, [[maybe_unused]] const AZ::Data::AssetType asset) + { + AZ_Printf("TEST", "%s %s", __FUNCTION__, assetId.ToString().c_str()); + } +} diff --git a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h new file mode 100644 index 000000000..c2ae149a2 --- /dev/null +++ b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h @@ -0,0 +1,72 @@ +#pragma once + +#include +#include +#include +#include + +namespace MultiplayerSample +{ + /** + * \brief Can spawn prefabs using C++ API. + * Does not keep track of instances. The user should save a copy of the ticket using callbacks in @PrefabCallbacks. + */ + class NetworkPrefabSpawnerComponent + : public AZ::Component + , public NetworkPrefabSpawnerRequestBus::Handler + , public AZ::Data::AssetBus::MultiHandler + { + public: + AZ_COMPONENT(NetworkPrefabSpawnerComponent, "{7E48961B-7E39-4FBC-95E4-74B712229E9B}", Component); + + static void Reflect(AZ::ReflectContext* reflection); + static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) + { + provided.push_back(AZ_CRC_CE("NetworkPrefabSpawnerService")); + } + + void Activate() override; + void Deactivate() override; + + // NetworkPrefabSpawnerRequestBus + void SpawnPrefab(const AZ::Transform& worldTm, const char* assetPath, PrefabCallbacks callbacks) override; + void SpawnPrefabAsset(const AZ::Transform& worldTm, const AZ::Data::Asset& asset, PrefabCallbacks callbacks) override; + void SpawnDefaultPrefab(const AZ::Transform& worldTm, PrefabCallbacks callbacks) override; + + // AssetBus + void OnAssetReady(AZ::Data::Asset asset) override; + void OnAssetCanceled(AZ::Data::AssetId assetId) override; + void OnAssetContainerReady(AZ::Data::Asset asset) override; + void OnAssetError(AZ::Data::Asset asset) override; + void OnAssetMoved(AZ::Data::Asset asset, void* oldDataPointer) override; + void OnAssetPreReload(AZ::Data::Asset asset) override; + void OnAssetReloadError(AZ::Data::Asset asset) override; + void OnAssetReloaded(AZ::Data::Asset asset) override; + void OnAssetSaved(AZ::Data::Asset asset, bool isSuccessful) override; + void OnAssetUnloaded(const AZ::Data::AssetId assetId, const AZ::Data::AssetType assetType) override; + + private: + AZ::Data::Asset m_defaultSpawnableAsset; + + AZ::Data::AssetId GetSpawnableAssetId(const char* assetPath) const; + + struct AssetItem + { + AZStd::string m_pathToAsset; + AZ::Data::Asset m_spawnableAsset; + }; + AZStd::unordered_map m_assetMap; + + struct SpawnRequest + { + AZ::Data::AssetId m_assetIdToSpawn; + AZ::Transform m_whereToSpawn = AZ::Transform::CreateIdentity(); + PrefabCallbacks m_callbacks; + }; + + AZStd::vector m_requests; + + AZStd::vector> m_instanceTickets; + void CreateInstance(const SpawnRequest& request, const AssetItem* asset); + }; +} diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.cpp new file mode 100644 index 000000000..27c973a5c --- /dev/null +++ b/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.cpp @@ -0,0 +1,68 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include + +namespace MultiplayerSample +{ + void NetworkTestComponent::Reflect(AZ::ReflectContext* context) + { + AZ::SerializeContext* serializeContext = azrtti_cast(context); + if (serializeContext) + { + serializeContext->Class() + ->Field("Enable Movement", &NetworkTestComponent::m_enableMotion) + ->Field("Oscillator Amplitude", &NetworkTestComponent::m_oscillatorAmplitude) + ->Field("Oscillator Speed", &NetworkTestComponent::m_oscillatorSpeedFactor) + ->Version(1); + + if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + { + using namespace AZ::Edit; + editContext->Class("Network Test Helper", + "Various helpful test tools and behaviors to test multiplayer logic and performance.") + ->ClassElement(ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Category, "MultiplayerSample") + ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game")) + ->DataElement(nullptr, &NetworkTestComponent::m_enableMotion, "Enabled", "enabled oscillation along Z axis") + ->DataElement(nullptr, &NetworkTestComponent::m_oscillatorAmplitude, "Oscillator Amplitude", "amplitude along Z axis") + ->DataElement(nullptr, &NetworkTestComponent::m_oscillatorSpeedFactor, "Oscillator Speed", "speed factor along Z axis") + ; + } + } + } + + void NetworkTestComponent::Activate() + { + if (const Multiplayer::NetBindComponent* netBindComponent = GetEntity()->FindComponent()) + { + if (netBindComponent->IsNetEntityRoleAuthority()) + { + AZ::TickBus::Handler::BusConnect(); + m_startTranslation = GetEntity()->GetTransform()->GetWorldTranslation(); + } + } + } + + void NetworkTestComponent::Deactivate() + { + AZ::TickBus::Handler::BusDisconnect(); + } + + void NetworkTestComponent::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) + { + m_accumulatedTime += deltaTime; + + AZ::Vector3 copy = m_startTranslation; + copy.SetZ(copy.GetZ() + AZStd::sin(m_accumulatedTime * m_oscillatorSpeedFactor) * m_oscillatorAmplitude); + GetEntity()->GetTransform()->SetWorldTranslation(copy); + } +} diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.h b/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.h new file mode 100644 index 000000000..a829041b8 --- /dev/null +++ b/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace MultiplayerSample +{ + //! @class NetworkTestComponent + class NetworkTestComponent final + : public AZ::Component + , public AZ::TickBus::Handler + { + public: + AZ_COMPONENT(MultiplayerSample::NetworkTestComponent, "{7FAA74C4-5A35-4602-95D9-E83DE9EC7B01}"); + + static void Reflect(AZ::ReflectContext* context); + + static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& provided) + { + provided.push_back(AZ_CRC_CE("NetBindService")); + } + + //! AZ::Component overrides. + //! @{ + void Activate() override; + void Deactivate() override; + //! }@ + + //! AZ::TickBus overrides. + //! @{ + void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; + //! }@ + + private: + bool m_enableMotion = false; + float m_oscillatorAmplitude = 1.f; + float m_oscillatorSpeedFactor = 1.f; + + float m_accumulatedTime = 0.f; + AZ::Vector3 m_startTranslation = AZ::Vector3::CreateZero(); + }; +} diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp new file mode 100644 index 000000000..be6c5af5b --- /dev/null +++ b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp @@ -0,0 +1,100 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include + +#include "NetworkPrefabSpawnerComponent.h" + +#pragma optimize("", off) + +namespace MultiplayerSample +{ + void NetworkTestSpawnerComponent::Reflect(AZ::ReflectContext* context) + { + AZ::SerializeContext* serializeContext = azrtti_cast(context); + if (serializeContext) + { + serializeContext->Class() + ->Field("Enabled", &NetworkTestSpawnerComponent::m_enabled) + ->Field("Max Objects", &NetworkTestSpawnerComponent::m_maximumLiveCount) + ->Field("Spawn Period", &NetworkTestSpawnerComponent::m_spawnPeriod) + ->Version(1); + + if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + { + using namespace AZ::Edit; + editContext->Class("Network Prefab Spawn Tester", + "Various helpful test tools and behaviors to test multiplayer logic and performance.") + ->ClassElement(ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Category, "MultiplayerSample") + ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game")) + ->DataElement(nullptr, &NetworkTestSpawnerComponent::m_enabled, "Enabled", "Enables spawning of test prefabs") + ->DataElement(nullptr, &NetworkTestSpawnerComponent::m_spawnPeriod, "Spawn Period", "How often to spawn new prefab instance, in seconds") + ->DataElement(nullptr, &NetworkTestSpawnerComponent::m_maximumLiveCount, "Max Objects", + "Maximum objects to keep alive, will delete older objects when the count goes above this value.") + ; + } + } + } + + void NetworkTestSpawnerComponent::Activate() + { + if (const Multiplayer::NetBindComponent* netBindComponent = GetEntity()->FindComponent()) + { + if (netBindComponent->IsNetEntityRoleAuthority()) + { + AZ::TickBus::Handler::BusConnect(); + + m_currentCount = 0; + m_accumulatedTime = 0.f; + m_sinceLastSpawn = 0.f; + } + } + } + + void NetworkTestSpawnerComponent::Deactivate() + { + AZ::TickBus::Handler::BusDisconnect(); + } + + void NetworkTestSpawnerComponent::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) + { + m_accumulatedTime += deltaTime; + + if (m_accumulatedTime > m_spawnPeriod) + { + m_accumulatedTime = 0.f; + + if (NetworkPrefabSpawnerComponent* spawner = GetEntity()->FindComponent()) + { + AZ::Transform t = GetEntity()->GetTransform()->GetWorldTM(); + + PrefabCallbacks callbacks; + callbacks.m_onActivateCallback = [this]( + AZStd::shared_ptr&& ticket, + [[maybe_unused]] AzFramework::SpawnableConstEntityContainerView view) + { + m_spawnedObjects.push_back(move(ticket)); + }; + + spawner->SpawnDefaultPrefab(t, callbacks); + } + + m_currentCount++; + + if (m_currentCount > m_maximumLiveCount) + { + m_spawnedObjects.pop_front(); + m_currentCount--; + } + } + } +} diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.h b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.h new file mode 100644 index 000000000..4cab11f32 --- /dev/null +++ b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +namespace MultiplayerSample +{ + //! @class NetworkTestSpawnerComponent + class NetworkTestSpawnerComponent final + : public AZ::Component + , public AZ::TickBus::Handler + { + public: + AZ_COMPONENT(MultiplayerSample::NetworkTestSpawnerComponent, "{4F8A554C-99F3-4DDB-8313-3B2FD5F78843}"); + + static void Reflect(AZ::ReflectContext* context); + + static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) + { + required.push_back(AZ_CRC_CE("NetBindService")); + required.push_back(AZ_CRC_CE("NetworkPrefabSpawnerService")); + } + + //! AZ::Component overrides. + //! @{ + void Activate() override; + void Deactivate() override; + //! }@ + + //! AZ::TickBus overrides. + //! @{ + void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; + //! }@ + + private: + bool m_enabled = false; + int m_maximumLiveCount = 0; + float m_spawnPeriod = 1.f; + + int m_currentCount = 0; + + float m_accumulatedTime = 0.f; + float m_sinceLastSpawn = 0.f; + + AZStd::deque> m_spawnedObjects; + }; +} diff --git a/Gem/Code/Source/MultiplayerSampleModule.cpp b/Gem/Code/Source/MultiplayerSampleModule.cpp index c53027e69..b6174e0eb 100644 --- a/Gem/Code/Source/MultiplayerSampleModule.cpp +++ b/Gem/Code/Source/MultiplayerSampleModule.cpp @@ -8,6 +8,9 @@ #include #include #include +#include +#include +#include #include #include "MultiplayerSampleSystemComponent.h" @@ -28,6 +31,9 @@ namespace MultiplayerSample m_descriptors.insert(m_descriptors.end(), { MultiplayerSampleSystemComponent::CreateDescriptor(), ExampleFilteredEntityComponent::CreateDescriptor(), + NetworkTestComponent::CreateDescriptor(), + NetworkPrefabSpawnerComponent::CreateDescriptor(), + NetworkTestSpawnerComponent::CreateDescriptor(), }); CreateComponentDescriptors(m_descriptors); diff --git a/Gem/Code/multiplayersample_files.cmake b/Gem/Code/multiplayersample_files.cmake index 8eedbf6e7..291a1173e 100644 --- a/Gem/Code/multiplayersample_files.cmake +++ b/Gem/Code/multiplayersample_files.cmake @@ -6,6 +6,7 @@ # set(FILES + Include/NetworkPrefabSpawnerInterface.h Source/AutoGen/NetworkAiComponent.AutoComponent.xml Source/AutoGen/NetworkAnimationComponent.AutoComponent.xml Source/AutoGen/NetworkHealthComponent.AutoComponent.xml @@ -31,6 +32,12 @@ set(FILES Source/Components/NetworkWeaponsComponent.h Source/Components/NetworkSimplePlayerCameraComponent.cpp Source/Components/NetworkSimplePlayerCameraComponent.h + Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp + Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h + Source/Components/PerfTest/NetworkTestComponent.cpp + Source/Components/PerfTest/NetworkTestComponent.h + Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp + Source/Components/PerfTest/NetworkTestSpawnerComponent.h Source/Components/NetworkStressTestComponent.cpp Source/Components/NetworkStressTestComponent.h Source/Components/NetworkPlayerMovementComponent.cpp diff --git a/Levels/SpawningPerfTest/SpawningPerfTest.prefab b/Levels/SpawningPerfTest/SpawningPerfTest.prefab new file mode 100644 index 000000000..1872ac361 --- /dev/null +++ b/Levels/SpawningPerfTest/SpawningPerfTest.prefab @@ -0,0 +1,645 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[947961075516]", + "Instance_[420009386512]/ContainerEntity" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 9615948867337072083 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[2390335684631149729]": { + "$type": "EditorColliderComponent", + "Id": 2390335684631149729, + "ColliderConfiguration": { + "Position": [ + 0.0, + 0.0, + -0.5 + ], + "MaterialSelection": { + "MaterialIds": [ + {} + ] + } + }, + "ShapeConfiguration": { + "ShapeType": 1, + "Box": { + "Configuration": [ + 100.0, + 100.0, + 1.0 + ] + } + } + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[947961075516]": { + "Id": "Entity_[947961075516]", + "Name": "Test Spawner", + "Components": { + "Component_[10963079133675343639]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10963079133675343639, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 7.0853471755981445, + -3.1976943016052246, + 8.996732711791992 + ] + } + }, + "Component_[12075594064273029366]": { + "$type": "EditorVisibilityComponent", + "Id": 12075594064273029366 + }, + "Component_[13350504610562010348]": { + "$type": "EditorEntityIconComponent", + "Id": 13350504610562010348 + }, + "Component_[13660454289932738945]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13660454289932738945 + }, + "Component_[14107901424544397859]": { + "$type": "GenericComponentWrapper", + "Id": 14107901424544397859, + "m_template": { + "$type": "Multiplayer::NetworkTransformComponent" + } + }, + "Component_[15277657083426159426]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 15277657083426159426, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{6DE0E9A8-A1C7-5D0F-9407-4E627C1F223C}", + "subId": 284780167 + }, + "assetHint": "models/sphere.azmodel" + } + } + } + }, + "Component_[16096517290206289106]": { + "$type": "EditorLockComponent", + "Id": 16096517290206289106 + }, + "Component_[16926976350439785536]": { + "$type": "EditorInspectorComponent", + "Id": 16926976350439785536 + }, + "Component_[16930831424390780459]": { + "$type": "EditorEntitySortComponent", + "Id": 16930831424390780459 + }, + "Component_[1766674680697458302]": { + "$type": "GenericComponentWrapper", + "Id": 1766674680697458302, + "m_template": { + "$type": "MultiplayerSample::NetworkTestSpawnerComponent", + "Enabled": true, + "Max Objects": 10 + } + }, + "Component_[194809454864350389]": { + "$type": "EditorPendingCompositionComponent", + "Id": 194809454864350389 + }, + "Component_[3262769293713077991]": { + "$type": "GenericComponentWrapper", + "Id": 3262769293713077991, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[4995577444629330118]": { + "$type": "SelectionComponent", + "Id": 4995577444629330118 + }, + "Component_[5153851167289802312]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5153851167289802312 + }, + "Component_[891954839471865918]": { + "$type": "GenericComponentWrapper", + "Id": 891954839471865918, + "m_template": { + "$type": "NetworkPrefabSpawnerComponent", + "Default Prefab": { + "assetId": { + "guid": "{997E5003-6C9F-56BA-BB11-97A228F4B888}", + "subId": 3333583332 + }, + "assetHint": "prefabs/test_net_object.network.spawnable" + } + } + } + } + } + }, + "Instances": { + "Instance_[420009386512]": { + "Source": "Prefabs/Test_Net_Object.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[10875373432506593388]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[10875373432506593388]/Transform Data/Translate/0", + "value": 2.2419509887695313 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[10875373432506593388]/Transform Data/Translate/1", + "value": 3.4806900024414063 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[10875373432506593388]/Transform Data/Translate/2", + "value": 3.210494041442871 + }, + { + "op": "remove", + "path": "/LinkId" + } + ] + } + } +} \ No newline at end of file diff --git a/Levels/SpawningPerfTest/_savebackup/2022-01-20 [09.42.00]/tags.txt b/Levels/SpawningPerfTest/_savebackup/2022-01-20 [09.42.00]/tags.txt new file mode 100644 index 000000000..0d6c1880e --- /dev/null +++ b/Levels/SpawningPerfTest/_savebackup/2022-01-20 [09.42.00]/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/Levels/SpawningPerfTest/tags.txt b/Levels/SpawningPerfTest/tags.txt new file mode 100644 index 000000000..0d6c1880e --- /dev/null +++ b/Levels/SpawningPerfTest/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/Prefabs/Test_Net_Object.prefab b/Prefabs/Test_Net_Object.prefab new file mode 100644 index 000000000..f18e2f0b4 --- /dev/null +++ b/Prefabs/Test_Net_Object.prefab @@ -0,0 +1,219 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "Test_Net_Object", + "Components": { + "Component_[10191933821067884969]": { + "$type": "EditorPrefabComponent", + "Id": 10191933821067884969 + }, + "Component_[10875373432506593388]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10875373432506593388, + "Parent Entity": "" + }, + "Component_[11273717943717484824]": { + "$type": "EditorEntityIconComponent", + "Id": 11273717943717484824 + }, + "Component_[11851438600995494736]": { + "$type": "EditorLockComponent", + "Id": 11851438600995494736 + }, + "Component_[11956544343143466658]": { + "$type": "EditorVisibilityComponent", + "Id": 11956544343143466658 + }, + "Component_[12257238983641842239]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12257238983641842239 + }, + "Component_[4588600448743603559]": { + "$type": "EditorInspectorComponent", + "Id": 4588600448743603559 + }, + "Component_[6275754365988430753]": { + "$type": "EditorEntitySortComponent", + "Id": 6275754365988430753, + "Child Entity Order": [ + "Entity_[428599321104]" + ] + }, + "Component_[6498525539371196468]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6498525539371196468 + }, + "Component_[7418299210056750657]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 7418299210056750657 + }, + "Component_[8238034828511115950]": { + "$type": "SelectionComponent", + "Id": 8238034828511115950 + } + } + }, + "Entities": { + "Entity_[428599321104]": { + "Id": "Entity_[428599321104]", + "Name": "Test Net Object", + "Components": { + "Component_[11149569005424291664]": { + "$type": "EditorLockComponent", + "Id": 11149569005424291664 + }, + "Component_[11915541920127156560]": { + "$type": "EditorOnlyEntityComponent", + "Id": 11915541920127156560 + }, + "Component_[13213110774758686394]": { + "$type": "EditorVisibilityComponent", + "Id": 13213110774758686394 + }, + "Component_[14022225546352237038]": { + "$type": "EditorRigidBodyComponent", + "Id": 14022225546352237038, + "Configuration": { + "entityId": "", + "Mass": 999.9999389648438, + "Centre of mass offset": [ + 0.0, + 0.0, + 0.5 + ], + "Inertia tensor": { + "roll": 0.0, + "pitch": 0.0, + "yaw": 0.0, + "scale": 0.0059999991208314896 + } + } + }, + "Component_[15076020362360634866]": { + "$type": "GenericComponentWrapper", + "Id": 15076020362360634866, + "m_template": { + "$type": "Multiplayer::NetworkTransformComponent" + } + }, + "Component_[15646219890037406725]": { + "$type": "SelectionComponent", + "Id": 15646219890037406725 + }, + "Component_[2148707257337573835]": { + "$type": "EditorInspectorComponent", + "Id": 2148707257337573835, + "ComponentOrderEntryArray": [ + { + "ComponentId": 4278170607060799418 + }, + { + "ComponentId": 4538817944860823080, + "SortIndex": 1 + }, + { + "ComponentId": 6520325419833207798, + "SortIndex": 2 + }, + { + "ComponentId": 14022225546352237038, + "SortIndex": 3 + }, + { + "ComponentId": 2512731683353439569, + "SortIndex": 4 + }, + { + "ComponentId": 15076020362360634866, + "SortIndex": 5 + }, + { + "ComponentId": 10163598543192033006, + "SortIndex": 6 + } + ] + }, + "Component_[2286851697353605533]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2286851697353605533 + }, + "Component_[2310691145575538810]": { + "$type": "GenericComponentWrapper", + "Id": 2310691145575538810, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[2512731683353439569]": { + "$type": "EditorColliderComponent", + "Id": 2512731683353439569, + "ColliderConfiguration": { + "Position": [ + 0.0, + 0.0, + 0.5 + ], + "MaterialSelection": { + "MaterialIds": [ + {} + ] + } + }, + "ShapeConfiguration": { + "ShapeType": 1 + } + }, + "Component_[307488191766036503]": { + "$type": "EditorEntitySortComponent", + "Id": 307488191766036503 + }, + "Component_[3177549462510279351]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3177549462510279351 + }, + "Component_[4278170607060799418]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4278170607060799418, + "Parent Entity": "ContainerEntity" + }, + "Component_[4538817944860823080]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 4538817944860823080, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{8F19FB6D-DF18-5CC0-B921-6755089004D7}", + "subId": 275006192 + }, + "assetHint": "materialeditor/viewportmodels/beveledcube.azmodel" + } + } + } + }, + "Component_[6520325419833207798]": { + "$type": "EditorMaterialComponent", + "Id": 6520325419833207798, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + } + } + }, + "Component_[7570897283397398271]": { + "$type": "EditorEntityIconComponent", + "Id": 7570897283397398271 + } + } + } + } +} \ No newline at end of file From e8dc03ed1e9d1fe2c95a3084074532cf526a0358 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Thu, 20 Jan 2022 17:23:39 -0800 Subject: [PATCH 18/71] Add IMultiplayerSpawner impl for MPS Signed-off-by: puvvadar --- .../MultiplayerSampleSystemComponent.cpp | 20 +++++++++++++++++++ .../Source/MultiplayerSampleSystemComponent.h | 11 +++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index d66c40a4c..e8f77a018 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -25,6 +25,9 @@ namespace MultiplayerSample { using namespace AzNetworking; + AZ_CVAR(AZ::CVarFixedString, sv_playerSpawnAsset, "prefabs/player.network.spawnable", nullptr, AZ::ConsoleFunctorFlags::DontReplicate, + "The spawnable to use when a new player connects"); + void MultiplayerSampleSystemComponent::Reflect(AZ::ReflectContext* context) { ReflectWeaponEnums(context); @@ -82,10 +85,13 @@ namespace MultiplayerSample //! Register our gems multiplayer components to assign NetComponentIds RegisterMultiplayerComponents(); + + AZ::Interface::Register(this); } void MultiplayerSampleSystemComponent::Deactivate() { + AZ::Interface::Unregister(this); AZ::TickBus::Handler::BusDisconnect(); } @@ -100,5 +106,19 @@ namespace MultiplayerSample return AZ::TICK_PLACEMENT + 2; } + AZStd::pair MultiplayerSampleSystemComponent::SpawnPlayerPrefab(uint64_t userId) + { + auto sv_playerSpawnAssetLowerCase = static_cast(sv_playerSpawnAsset); + AZStd::to_lower(sv_playerSpawnAssetLowerCase.begin(), sv_playerSpawnAssetLowerCase.end()); + Multiplayer::PrefabEntityId playerPrefabEntityId(AZ::Name(sv_playerSpawnAssetLowerCase.c_str())); + + // Assuming userIds increase linearly (which is naive), spawn in rows of a prescribed size + const uint8_t spawnRowSize = 8; + AZ::Transform transform = AZ::Transform::CreateIdentity(); + transform.SetTranslation( + AZ::Vector3(aznumeric_cast(userId % spawnRowSize) * 32.f, aznumeric_cast(userId / spawnRowSize) * 32.f, 0)); + + return AZStd::pair(playerPrefabEntityId, transform); + } } diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.h b/Gem/Code/Source/MultiplayerSampleSystemComponent.h index 8d177cf17..20b90e6d9 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.h +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.h @@ -10,11 +10,14 @@ #include #include +#include + namespace MultiplayerSample { class MultiplayerSampleSystemComponent : public AZ::Component , public AZ::TickBus::Handler + , public Multiplayer::IMultiplayerSpawner { public: AZ_COMPONENT(MultiplayerSampleSystemComponent, "{7BF68D79-E870-44B5-853A-BA68FF4F0B90}"); @@ -32,10 +35,16 @@ namespace MultiplayerSample void Activate() override; void Deactivate() override; //////////////////////////////////////////////////////////////////////// - + + //////////////////////////////////////////////////////////////////////// // AZ::TickBus::Handler overrides void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; int GetTickOrder() override; //////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////// + // IMultiplayerSpawner overrides + AZStd::pair SpawnPlayerPrefab(uint64_t userId) override; + //////////////////////////////////////////////////////////////////////// }; } From cc399778eb500e93f44d3594a548c1508683f9de Mon Sep 17 00:00:00 2001 From: puvvadar Date: Fri, 21 Jan 2022 12:57:18 -0800 Subject: [PATCH 19/71] Accomodate IMultiplayerSpawner updates Signed-off-by: puvvadar --- Gem/Code/Source/MultiplayerSampleSystemComponent.cpp | 7 ++++++- Gem/Code/Source/MultiplayerSampleSystemComponent.h | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index e8f77a018..f5eac8bb3 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -106,7 +106,7 @@ namespace MultiplayerSample return AZ::TICK_PLACEMENT + 2; } - AZStd::pair MultiplayerSampleSystemComponent::SpawnPlayerPrefab(uint64_t userId) + AZStd::pair MultiplayerSampleSystemComponent::OnPlayerJoin(uint64_t userId) { auto sv_playerSpawnAssetLowerCase = static_cast(sv_playerSpawnAsset); AZStd::to_lower(sv_playerSpawnAssetLowerCase.begin(), sv_playerSpawnAssetLowerCase.end()); @@ -120,5 +120,10 @@ namespace MultiplayerSample return AZStd::pair(playerPrefabEntityId, transform); } + + void MultiplayerSampleSystemComponent::OnPlayerLeave(Multiplayer::ConstNetworkEntityHandle entityHandle) + { + AZ::Interface::Get()->GetNetworkEntityManager()->MarkForRemoval(entityHandle); + } } diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.h b/Gem/Code/Source/MultiplayerSampleSystemComponent.h index 20b90e6d9..bb4941661 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.h +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.h @@ -44,7 +44,8 @@ namespace MultiplayerSample //////////////////////////////////////////////////////////////////////// // IMultiplayerSpawner overrides - AZStd::pair SpawnPlayerPrefab(uint64_t userId) override; + AZStd::pair OnPlayerJoin(uint64_t userId) override; + void OnPlayerLeave(Multiplayer::ConstNetworkEntityHandle entityHandle) override; //////////////////////////////////////////////////////////////////////// }; } From 0b51002a5e2d35f0e53efa66f2e68f6844d9c264 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Fri, 21 Jan 2022 13:18:08 -0800 Subject: [PATCH 20/71] Update for additional IMultiplayerSpawner::OnPlayerLeave params Signed-off-by: puvvadar --- Gem/Code/Source/MultiplayerSampleSystemComponent.cpp | 4 +++- Gem/Code/Source/MultiplayerSampleSystemComponent.h | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index f5eac8bb3..54959f3d9 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -20,6 +20,7 @@ #include #include #include +#include namespace MultiplayerSample { @@ -121,7 +122,8 @@ namespace MultiplayerSample return AZStd::pair(playerPrefabEntityId, transform); } - void MultiplayerSampleSystemComponent::OnPlayerLeave(Multiplayer::ConstNetworkEntityHandle entityHandle) + void MultiplayerSampleSystemComponent::OnPlayerLeave( + Multiplayer::ConstNetworkEntityHandle entityHandle, [[maybe_unused]] const Multiplayer::ReplicationSet& replicationSet, [[maybe_unused]] AzNetworking::DisconnectReason reason) { AZ::Interface::Get()->GetNetworkEntityManager()->MarkForRemoval(entityHandle); } diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.h b/Gem/Code/Source/MultiplayerSampleSystemComponent.h index bb4941661..b7abd4019 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.h +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.h @@ -12,6 +12,12 @@ #include +namespace Multiplayer +{ + struct EntityReplicationData; + using ReplicationSet = AZStd::map; +} + namespace MultiplayerSample { class MultiplayerSampleSystemComponent @@ -45,7 +51,10 @@ namespace MultiplayerSample //////////////////////////////////////////////////////////////////////// // IMultiplayerSpawner overrides AZStd::pair OnPlayerJoin(uint64_t userId) override; - void OnPlayerLeave(Multiplayer::ConstNetworkEntityHandle entityHandle) override; + void OnPlayerLeave( + Multiplayer::ConstNetworkEntityHandle entityHandle, + const Multiplayer::ReplicationSet& replicationSet, + AzNetworking::DisconnectReason reason) override; //////////////////////////////////////////////////////////////////////// }; } From f858933fbeb59a628fc8b22da4893fe9e0c0ee5c Mon Sep 17 00:00:00 2001 From: puvvadar Date: Fri, 21 Jan 2022 14:13:11 -0800 Subject: [PATCH 21/71] Update for new OnPlayerJoin params Signed-off-by: puvvadar --- Gem/Code/Source/MultiplayerSampleSystemComponent.cpp | 6 +++++- Gem/Code/Source/MultiplayerSampleSystemComponent.h | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index 54959f3d9..fa432c9a2 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -107,7 +108,10 @@ namespace MultiplayerSample return AZ::TICK_PLACEMENT + 2; } - AZStd::pair MultiplayerSampleSystemComponent::OnPlayerJoin(uint64_t userId) + AZStd::pair MultiplayerSampleSystemComponent::OnPlayerJoin( + uint64_t userId, + [[maybe_unused]] AzFramework::PlayerConnectionConfig config, + [[maybe_unused]] Multiplayer::LongNetworkString ticket) { auto sv_playerSpawnAssetLowerCase = static_cast(sv_playerSpawnAsset); AZStd::to_lower(sv_playerSpawnAssetLowerCase.begin(), sv_playerSpawnAssetLowerCase.end()); diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.h b/Gem/Code/Source/MultiplayerSampleSystemComponent.h index b7abd4019..09cfc7194 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.h +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.h @@ -12,6 +12,11 @@ #include +namespace AzFramework +{ + struct PlayerConnectionConfig; +} + namespace Multiplayer { struct EntityReplicationData; @@ -50,7 +55,10 @@ namespace MultiplayerSample //////////////////////////////////////////////////////////////////////// // IMultiplayerSpawner overrides - AZStd::pair OnPlayerJoin(uint64_t userId) override; + AZStd::pair OnPlayerJoin( + uint64_t userId, + AzFramework::PlayerConnectionConfig config, + Multiplayer::LongNetworkString ticket) override; void OnPlayerLeave( Multiplayer::ConstNetworkEntityHandle entityHandle, const Multiplayer::ReplicationSet& replicationSet, From f2601500f6b014152969054e25aa22e6a914810c Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 21 Jan 2022 15:58:38 -0800 Subject: [PATCH 22/71] Remove depreciated use of ly_get_list_relative_pal_filename; replaced with o3de_pal_dir Signed-off-by: Gene Walters --- Gem/Code/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gem/Code/CMakeLists.txt b/Gem/Code/CMakeLists.txt index 63f789a6b..4690f25a2 100644 --- a/Gem/Code/CMakeLists.txt +++ b/Gem/Code/CMakeLists.txt @@ -5,7 +5,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}") ly_add_target( NAME MultiplayerSample.Static STATIC From 013c3c0f1e98aa41d58797455da7f5dff7ca2717 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Tue, 25 Jan 2022 14:13:43 -0800 Subject: [PATCH 23/71] WIP work on Player spawning Signed-off-by: puvvadar --- ...rkPlayerSpawnerComponent.AutoComponent.xml | 2 +- .../NetworkPlayerSpawnerComponent.cpp | 26 ++++++++++++++++-- .../NetworkPlayerSpawnerComponent.h | 27 +++++++++++++++++-- .../MultiplayerSampleSystemComponent.cpp | 4 +++ .../Source/MultiplayerSampleSystemComponent.h | 3 +++ Gem/Code/multiplayersample_files.cmake | 3 +++ 6 files changed, 60 insertions(+), 5 deletions(-) diff --git a/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml index bf1789846..f2643fe5b 100644 --- a/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml @@ -3,7 +3,7 @@ diff --git a/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.cpp b/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.cpp index 6ea16f020..d044dfcef 100644 --- a/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.cpp +++ b/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.cpp @@ -1,6 +1,28 @@ /* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of + * this distribution. + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ + +#include +#include + +namespace MultiplayerSample +{ + void NetworkPlayerSpawnerComponent::OnInit() + { + ; + } + + void NetworkPlayerSpawnerComponent::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) + { + AZ::Interface::Get()->RegisterPlayerSpawner(this); + } + + void NetworkPlayerSpawnerComponent::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) + { + AZ::Interface::Get()->UnregisterPlayerSpawner(this); + } +} // namespace MultiplayerSample diff --git a/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h b/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h index cc8a920d0..2468921d5 100644 --- a/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h +++ b/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h @@ -1,8 +1,31 @@ /* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of + * this distribution. + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #pragma once + +#include +#include + +namespace MultiplayerSample +{ + + class NetworkPlayerSpawnerComponent : public NetworkPlayerSpawnerComponentBase + { + public: + AZ_MULTIPLAYER_COMPONENT( + MultiplayerSample::NetworkPlayerSpawnerComponent, + s_networkPlayerSpawnerComponentConcreteUuid, + MultiplayerSample::NetworkPlayerSpawnerComponentBase); + + NetworkPlayerSpawnerComponent(); + + void OnInit() override; + void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; + void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; + }; +} // namespace MultiplayerSample diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index fa432c9a2..0bb59c6e9 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -89,10 +90,13 @@ namespace MultiplayerSample RegisterMultiplayerComponents(); AZ::Interface::Register(this); + m_playerSpawner = AZStd::make_unique(); + AZ::Interface::Register(m_playerSpawner.get()); } void MultiplayerSampleSystemComponent::Deactivate() { + AZ::Interface::Unregister(m_playerSpawner.get()); AZ::Interface::Unregister(this); AZ::TickBus::Handler::BusDisconnect(); } diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.h b/Gem/Code/Source/MultiplayerSampleSystemComponent.h index 09cfc7194..997b00bda 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.h +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.h @@ -11,6 +11,7 @@ #include #include +#include namespace AzFramework { @@ -64,5 +65,7 @@ namespace MultiplayerSample const Multiplayer::ReplicationSet& replicationSet, AzNetworking::DisconnectReason reason) override; //////////////////////////////////////////////////////////////////////// + + AZStd::unique_ptr m_playerSpawner; }; } diff --git a/Gem/Code/multiplayersample_files.cmake b/Gem/Code/multiplayersample_files.cmake index 8eedbf6e7..2b124ae22 100644 --- a/Gem/Code/multiplayersample_files.cmake +++ b/Gem/Code/multiplayersample_files.cmake @@ -35,6 +35,9 @@ set(FILES Source/Components/NetworkStressTestComponent.h Source/Components/NetworkPlayerMovementComponent.cpp Source/Components/NetworkPlayerMovementComponent.h + Source/Spawners/IPlayerSpawner.h + Source/Spawners/RoundRobinSpawner.h + Source/Spawners/RoundRobinSpawner.cpp Source/Weapons/BaseWeapon.cpp Source/Weapons/BaseWeapon.h Source/Weapons/IWeapon.h From ce015bf1e63de085e588acbc1c3e90b3da0c9299 Mon Sep 17 00:00:00 2001 From: Pip Potter <61438964+lmbr-pip@users.noreply.github.com> Date: Wed, 26 Jan 2022 09:35:10 -0800 Subject: [PATCH 24/71] Add initial bug and feature templates Signed-off-by: Pip Potter <61438964+lmbr-pip@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_template.md | 44 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_template.md | 20 ++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_template.md create mode 100644 .github/ISSUE_TEMPLATE/feature_template.md diff --git a/.github/ISSUE_TEMPLATE/bug_template.md b/.github/ISSUE_TEMPLATE/bug_template.md new file mode 100644 index 000000000..b51e3faad --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_template.md @@ -0,0 +1,44 @@ +--- +name: Bug report +about: Create a report to help us improve +title: 'Bug Report' +labels: 'needs-triage,kind/bug' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. Try to isolate the issue to help the community to reproduce it easily and increase chances for a fast fix. + +**Steps to reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '...' +3. Select attached asset '...' +4. Scroll down to '...' +5. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Actual behavior** +A clear and concise description of what actually happened. + +**Assets required** +Provide sample assets needed to reproduce the issue. + +**Screenshots/Video** +If applicable, add screenshots and/or a video to help explain your problem. + +**Found in Branch** +Name of or link to the branch where the issue occurs. + +**Desktop/Device (please complete the following information):** + - Device: [e.g. PC, Mac, iPhone, Samsung] + - OS: [e.g. Windows, macOS, iOS, Android] + - Version [e.g. 10, Bug Sur, Oreo] + - CPU [e.g. Intel I9-9900k , Ryzen 5900x, ] + - GPU [AMD 6800 XT, NVidia RTX 3090] + - Memory [e.g. 16GB] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_template.md b/.github/ISSUE_TEMPLATE/feature_template.md new file mode 100644 index 000000000..7ef1568b3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_template.md @@ -0,0 +1,20 @@ +--- + +name: Feature request +about: Suggest an idea for this project +title: 'Feature Request' +labels: 'needs-triage,kind/feature' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 34c3c53d6c064f759b8def6eeffe4fa214db653b Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Wed, 26 Jan 2022 17:55:57 -0500 Subject: [PATCH 25/71] Reworked NetworkTestSpawnerComponent into Auto component Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- ...workTestSpawnerComponent.AutoComponent.xml | 18 ++++ .../PerfTest/NetworkPrefabSpawnerComponent.h | 4 +- .../PerfTest/NetworkTestSpawnerComponent.cpp | 85 +++++++------------ .../PerfTest/NetworkTestSpawnerComponent.h | 32 ++----- Gem/Code/Source/MultiplayerSampleModule.cpp | 3 +- Gem/Code/multiplayersample_files.cmake | 3 +- .../SpawningPerfTest/SpawningPerfTest.prefab | 23 +++-- Prefabs/Test_Net_Object.prefab | 7 ++ 8 files changed, 80 insertions(+), 95 deletions(-) create mode 100644 Gem/Code/Source/AutoGen/NetworkTestSpawnerComponent.AutoComponent.xml diff --git a/Gem/Code/Source/AutoGen/NetworkTestSpawnerComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkTestSpawnerComponent.AutoComponent.xml new file mode 100644 index 000000000..9146cc0d5 --- /dev/null +++ b/Gem/Code/Source/AutoGen/NetworkTestSpawnerComponent.AutoComponent.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h index c2ae149a2..c3d366398 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h +++ b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h @@ -18,11 +18,11 @@ namespace MultiplayerSample { public: AZ_COMPONENT(NetworkPrefabSpawnerComponent, "{7E48961B-7E39-4FBC-95E4-74B712229E9B}", Component); - + static void Reflect(AZ::ReflectContext* reflection); static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) { - provided.push_back(AZ_CRC_CE("NetworkPrefabSpawnerService")); + provided.push_back(AZ_CRC_CE("NetworkPrefabSpawnerComponent")); } void Activate() override; diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp index 5cd0ad0e8..650a3e895 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp +++ b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp @@ -5,94 +5,67 @@ * */ +#include #include #include -#include +#include #include #include #include #include - +#include #include "NetworkPrefabSpawnerComponent.h" #pragma optimize("", off) -namespace LmbrCentral -{ - class BoxShapeComponent; -} - namespace MultiplayerSample { - void NetworkTestSpawnerComponent::Reflect(AZ::ReflectContext* context) + NetworkTestSpawnerComponentController::NetworkTestSpawnerComponentController(NetworkTestSpawnerComponent& parent) + : NetworkTestSpawnerComponentControllerBase(parent) { - AZ::SerializeContext* serializeContext = azrtti_cast(context); - if (serializeContext) - { - serializeContext->Class() - ->Field("Enabled", &NetworkTestSpawnerComponent::m_enabled) - ->Field("Max Objects", &NetworkTestSpawnerComponent::m_maximumLiveCount) - ->Field("Spawn Period", &NetworkTestSpawnerComponent::m_spawnPeriod) - ->Version(1); - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - using namespace AZ::Edit; - editContext->Class("Network Prefab Spawn Tester", - "Various helpful test tools and behaviors to test multiplayer logic and performance.") - ->ClassElement(ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Category, "MultiplayerSample") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game")) - ->DataElement(nullptr, &NetworkTestSpawnerComponent::m_enabled, "Enabled", "Enables spawning of test prefabs") - ->DataElement(nullptr, &NetworkTestSpawnerComponent::m_spawnPeriod, "Spawn Period", "How often to spawn new prefab instance, in seconds") - ->Attribute(AZ::Edit::Attributes::Suffix, " seconds") - ->DataElement(nullptr, &NetworkTestSpawnerComponent::m_maximumLiveCount, "Max Objects", - "Maximum objects to keep alive, will delete older objects when the count goes above this value.") - ; - } - } } - void NetworkTestSpawnerComponent::Activate() + void NetworkTestSpawnerComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { - m_randomDistribution = std::uniform_real_distribution(-1000.f, 1000.f); + AZ::TickBus::Handler::BusConnect(); - if (const Multiplayer::NetBindComponent* netBindComponent = GetEntity()->FindComponent()) - { - if (netBindComponent->IsNetEntityRoleAuthority()) - { - AZ::TickBus::Handler::BusConnect(); - - m_currentCount = 0; - m_accumulatedTime = 0.f; - m_sinceLastSpawn = 0.f; - } - } + m_currentCount = 0; + m_accumulatedTime = 0.f; + m_sinceLastSpawn = 0.f; } - void NetworkTestSpawnerComponent::Deactivate() + void NetworkTestSpawnerComponentController::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { AZ::TickBus::Handler::BusDisconnect(); } - void NetworkTestSpawnerComponent::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) + void NetworkTestSpawnerComponentController::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) { m_accumulatedTime += deltaTime; - if (m_accumulatedTime > m_spawnPeriod) + if (m_accumulatedTime > 1.0f / aznumeric_cast(GetParent().GetSpawnPerSecond())) { m_accumulatedTime = 0.f; - if (NetworkPrefabSpawnerComponent* spawner = GetEntity()->FindComponent()) + if (NetworkPrefabSpawnerComponent* spawner = GetParent().GetNetworkPrefabSpawnerComponent()) { - AZ::Transform t = GetEntity()->GetTransform()->GetWorldTM(); - AZ::Vector3 randomPoint = AZ::Vector3::CreateZero(); + // ShapeComponentRequestsBus is designed in such a way that it's very difficult to use direct component interface instead of the EBus using ShapeBus = LmbrCentral::ShapeComponentRequestsBus; - ShapeBus::EventResult(randomPoint, GetEntityId(), &ShapeBus::Events::GenerateRandomPointInside, AZ::RandomDistributionType::UniformReal); + ShapeBus::EventResult(randomPoint, GetParent().GetEntityId(), &ShapeBus::Events::GenerateRandomPointInside, + AZ::RandomDistributionType::UniformReal); + + AZ::Transform t = GetEntity()->GetTransform()->GetWorldTM(); if (!randomPoint.IsZero()) { t.SetTranslation(randomPoint); + + // Create a random orientation for fun. + float randomAngles[3]; + randomAngles[0] = aznumeric_cast(GetNetworkRandomComponentController()->GetRandomUint64() % 180); + randomAngles[1] = aznumeric_cast(GetNetworkRandomComponentController()->GetRandomUint64() % 180); + randomAngles[2] = aznumeric_cast(GetNetworkRandomComponentController()->GetRandomUint64() % 180); + t.SetRotation(AZ::Quaternion::CreateFromEulerAnglesDegrees(AZ::Vector3::CreateFromFloat3(randomAngles))); } PrefabCallbacks callbacks; @@ -108,10 +81,10 @@ namespace MultiplayerSample m_currentCount++; - if (m_currentCount > m_maximumLiveCount) + if (m_currentCount > GetParent().GetMaxLiveCount()) { - m_spawnedObjects.pop_front(); - m_currentCount--; + m_spawnedObjects.pop_front(); // this destroys the prefab instance for this ticket + --m_currentCount; } } } diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.h b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.h index ecb1a57ec..ed758ef2b 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.h +++ b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.h @@ -7,34 +7,21 @@ #pragma once -#include -#include #include #include +#include namespace MultiplayerSample { - //! @class NetworkTestSpawnerComponent - class NetworkTestSpawnerComponent final - : public AZ::Component + class NetworkTestSpawnerComponentController + : public NetworkTestSpawnerComponentControllerBase , public AZ::TickBus::Handler { public: - AZ_COMPONENT(MultiplayerSample::NetworkTestSpawnerComponent, "{4F8A554C-99F3-4DDB-8313-3B2FD5F78843}"); + NetworkTestSpawnerComponentController(NetworkTestSpawnerComponent& parent); - static void Reflect(AZ::ReflectContext* context); - - static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) - { - required.push_back(AZ_CRC_CE("NetBindService")); - required.push_back(AZ_CRC_CE("NetworkPrefabSpawnerService")); - } - - //! AZ::Component overrides. - //! @{ - void Activate() override; - void Deactivate() override; - //! }@ + void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; + void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; //! AZ::TickBus overrides. //! @{ @@ -42,17 +29,10 @@ namespace MultiplayerSample //! }@ private: - bool m_enabled = false; - int m_maximumLiveCount = 0; - float m_spawnPeriod = 1.f; - int m_currentCount = 0; - float m_accumulatedTime = 0.f; float m_sinceLastSpawn = 0.f; AZStd::deque> m_spawnedObjects; - - std::uniform_real_distribution m_randomDistribution; }; } diff --git a/Gem/Code/Source/MultiplayerSampleModule.cpp b/Gem/Code/Source/MultiplayerSampleModule.cpp index b6174e0eb..2e83acb5e 100644 --- a/Gem/Code/Source/MultiplayerSampleModule.cpp +++ b/Gem/Code/Source/MultiplayerSampleModule.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -33,7 +33,6 @@ namespace MultiplayerSample ExampleFilteredEntityComponent::CreateDescriptor(), NetworkTestComponent::CreateDescriptor(), NetworkPrefabSpawnerComponent::CreateDescriptor(), - NetworkTestSpawnerComponent::CreateDescriptor(), }); CreateComponentDescriptors(m_descriptors); diff --git a/Gem/Code/multiplayersample_files.cmake b/Gem/Code/multiplayersample_files.cmake index 291a1173e..72d6005f0 100644 --- a/Gem/Code/multiplayersample_files.cmake +++ b/Gem/Code/multiplayersample_files.cmake @@ -1,6 +1,6 @@ # # Copyright (c) Contributors to the Open 3D Engine Project -# +# # SPDX-License-Identifier: Apache-2.0 OR MIT # # @@ -16,6 +16,7 @@ set(FILES Source/AutoGen/NetworkSimplePlayerCameraComponent.AutoComponent.xml Source/AutoGen/NetworkStressTestComponent.AutoComponent.xml Source/AutoGen/NetworkPlayerMovementComponent.AutoComponent.xml + Source/AutoGen/NetworkTestSpawnerComponent.AutoComponent.xml Source/Components/ExampleFilteredEntityComponent.h Source/Components/ExampleFilteredEntityComponent.cpp Source/Components/NetworkAiComponent.cpp diff --git a/Levels/SpawningPerfTest/SpawningPerfTest.prefab b/Levels/SpawningPerfTest/SpawningPerfTest.prefab index f636b1346..253b823b3 100644 --- a/Levels/SpawningPerfTest/SpawningPerfTest.prefab +++ b/Levels/SpawningPerfTest/SpawningPerfTest.prefab @@ -519,6 +519,16 @@ ] } }, + "Component_[11734110005037668943]": { + "$type": "GenericComponentWrapper", + "Id": 11734110005037668943, + "m_template": { + "$type": "MultiplayerSample::NetworkTestSpawnerComponent", + "Enabled": true, + "MaxLiveCount": 100, + "SpawnPerSecond": 10 + } + }, "Component_[12075594064273029366]": { "$type": "EditorVisibilityComponent", "Id": 12075594064273029366 @@ -565,14 +575,11 @@ "$type": "EditorEntitySortComponent", "Id": 16930831424390780459 }, - "Component_[1766674680697458302]": { + "Component_[17854143994569306422]": { "$type": "GenericComponentWrapper", - "Id": 1766674680697458302, + "Id": 17854143994569306422, "m_template": { - "$type": "MultiplayerSample::NetworkTestSpawnerComponent", - "Enabled": true, - "Max Objects": 1000, - "Spawn Period": 0.009999999776482582 + "$type": "MultiplayerSample::NetworkRandomComponent" } }, "Component_[194809454864350389]": { @@ -615,9 +622,9 @@ "Default Prefab": { "assetId": { "guid": "{997E5003-6C9F-56BA-BB11-97A228F4B888}", - "subId": 3333583332 + "subId": 2739063657 }, - "assetHint": "prefabs/test_net_object.network.spawnable" + "assetHint": "prefabs/test_net_object.spawnable" } } } diff --git a/Prefabs/Test_Net_Object.prefab b/Prefabs/Test_Net_Object.prefab index f18e2f0b4..9abfb8d79 100644 --- a/Prefabs/Test_Net_Object.prefab +++ b/Prefabs/Test_Net_Object.prefab @@ -96,6 +96,13 @@ "$type": "Multiplayer::NetworkTransformComponent" } }, + "Component_[15397597781278882914]": { + "$type": "GenericComponentWrapper", + "Id": 15397597781278882914, + "m_template": { + "$type": "Multiplayer::NetworkRigidBodyComponent" + } + }, "Component_[15646219890037406725]": { "$type": "SelectionComponent", "Id": 15646219890037406725 From 20ed4b027f58d8e30a2e62fb5d0fe2079a62ede2 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Wed, 26 Jan 2022 16:25:39 -0800 Subject: [PATCH 26/71] Update SystemComponent with OnPlayerJoin changes Signed-off-by: puvvadar --- .../ExampleFilteredEntityComponent.cpp | 4 +- .../NetworkPlayerSpawnerComponent.h | 2 +- .../MultiplayerSampleSystemComponent.cpp | 4 +- .../Source/MultiplayerSampleSystemComponent.h | 6 +-- Gem/Code/Source/Spawners/IPlayerSpawner.h | 40 ++++++++++++++++++ .../Source/Spawners/RoundRobinSpawner.cpp | 38 +++++++++++++++++ Gem/Code/Source/Spawners/RoundRobinSpawner.h | 42 +++++++++++++++++++ 7 files changed, 126 insertions(+), 10 deletions(-) create mode 100644 Gem/Code/Source/Spawners/IPlayerSpawner.h create mode 100644 Gem/Code/Source/Spawners/RoundRobinSpawner.cpp create mode 100644 Gem/Code/Source/Spawners/RoundRobinSpawner.h diff --git a/Gem/Code/Source/Components/ExampleFilteredEntityComponent.cpp b/Gem/Code/Source/Components/ExampleFilteredEntityComponent.cpp index 7174372df..ea3e083c6 100644 --- a/Gem/Code/Source/Components/ExampleFilteredEntityComponent.cpp +++ b/Gem/Code/Source/Components/ExampleFilteredEntityComponent.cpp @@ -43,12 +43,12 @@ namespace MultiplayerSample void ExampleFilteredEntityComponent::Activate() { - Multiplayer::GetMultiplayer()->SetFilterEntityManager( this ); + AZ::Interface::Register(this); } void ExampleFilteredEntityComponent::Deactivate() { - Multiplayer::GetMultiplayer()->SetFilterEntityManager( nullptr ); + AZ::Interface::Unregister(this); } bool ExampleFilteredEntityComponent::IsEntityFiltered( diff --git a/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h b/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h index 2468921d5..58fa78c30 100644 --- a/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h +++ b/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h @@ -22,7 +22,7 @@ namespace MultiplayerSample s_networkPlayerSpawnerComponentConcreteUuid, MultiplayerSample::NetworkPlayerSpawnerComponentBase); - NetworkPlayerSpawnerComponent(); + NetworkPlayerSpawnerComponent(){}; void OnInit() override; void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index 0bb59c6e9..ef44c0d84 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -113,9 +113,7 @@ namespace MultiplayerSample } AZStd::pair MultiplayerSampleSystemComponent::OnPlayerJoin( - uint64_t userId, - [[maybe_unused]] AzFramework::PlayerConnectionConfig config, - [[maybe_unused]] Multiplayer::LongNetworkString ticket) + uint64_t userId, [[maybe_unused]] const Multiplayer::MultiplayerAgentDatum& agentDatum) { auto sv_playerSpawnAssetLowerCase = static_cast(sv_playerSpawnAsset); AZStd::to_lower(sv_playerSpawnAssetLowerCase.begin(), sv_playerSpawnAssetLowerCase.end()); diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.h b/Gem/Code/Source/MultiplayerSampleSystemComponent.h index 997b00bda..5ee9b6de7 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.h +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.h @@ -22,6 +22,7 @@ namespace Multiplayer { struct EntityReplicationData; using ReplicationSet = AZStd::map; + struct MultiplayerAgentDatum; } namespace MultiplayerSample @@ -56,10 +57,7 @@ namespace MultiplayerSample //////////////////////////////////////////////////////////////////////// // IMultiplayerSpawner overrides - AZStd::pair OnPlayerJoin( - uint64_t userId, - AzFramework::PlayerConnectionConfig config, - Multiplayer::LongNetworkString ticket) override; + AZStd::pair OnPlayerJoin(uint64_t userId, const Multiplayer::MultiplayerAgentDatum& agentDatum) override; void OnPlayerLeave( Multiplayer::ConstNetworkEntityHandle entityHandle, const Multiplayer::ReplicationSet& replicationSet, diff --git a/Gem/Code/Source/Spawners/IPlayerSpawner.h b/Gem/Code/Source/Spawners/IPlayerSpawner.h new file mode 100644 index 000000000..7170deed3 --- /dev/null +++ b/Gem/Code/Source/Spawners/IPlayerSpawner.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace AZ +{ + class Transform; +} + +namespace MultiplayerSample +{ + class NetworkPlayerSpawnerComponent; + + //! @class IPlayerSpawner + //! @brief IPlayerSpawner coordinate NetworkPlayerSpawners + //! + //! IPlayerSpawner is an AZ::Interface that provides a registry for + //! NetworkPlayerSpawners which can then be queried when IMultiplayerSpawner + //! events fire. + + class IPlayerSpawner + { + public: + AZ_RTTI(IPlayerSpawner, "{48CE4CFF-594B-4C6F-B5E0-8290A72CFEF9}"); + virtual ~IPlayerSpawner() = default; + + virtual bool RegisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner) = 0; + virtual AZStd::pair GetNextPlayerSpawn() = 0; + virtual bool UnregisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner) = 0; + }; +} // namespace MultiplayerSample diff --git a/Gem/Code/Source/Spawners/RoundRobinSpawner.cpp b/Gem/Code/Source/Spawners/RoundRobinSpawner.cpp new file mode 100644 index 000000000..31d2a35f1 --- /dev/null +++ b/Gem/Code/Source/Spawners/RoundRobinSpawner.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +namespace MultiplayerSample +{ + bool RoundRobinSpawner::RegisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner) + { + if (!AZStd::find(m_spawners.begin(), m_spawners.end(), spawner)) + { + m_spawners.push_back(spawner); + return true; + } + + return false; + } + + AZStd::pair RoundRobinSpawner::GetNextPlayerSpawn() + { + return AZStd::make_pair(Multiplayer::PrefabEntityId(), AZ::Transform::CreateIdentity()); + } + + bool RoundRobinSpawner::UnregisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner) + { + if (AZStd::find(m_spawners.begin(), m_spawners.end(), spawner)) + { + m_spawners.erase(AZStd::remove(m_spawners.begin(), m_spawners.end(), spawner)); + return true; + } + + return false; + } +} // namespace MultiplayerSample diff --git a/Gem/Code/Source/Spawners/RoundRobinSpawner.h b/Gem/Code/Source/Spawners/RoundRobinSpawner.h new file mode 100644 index 000000000..10163698f --- /dev/null +++ b/Gem/Code/Source/Spawners/RoundRobinSpawner.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of + * this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +namespace AzFramework +{ + struct PlayerConnectionConfig; +} + +namespace Multiplayer +{ + struct EntityReplicationData; + using ReplicationSet = AZStd::map; +} // namespace Multiplayer + +namespace MultiplayerSample +{ + class RoundRobinSpawner + : public MultiplayerSample::IPlayerSpawner + { + public: + AZ_RTTI(RoundRobinSpawner, "{C934A204-D6F8-4A44-870B-DFE5B8C7BA6B}"); + + //////////////////////////////////////////////////////////////////////// + // IPlayerSpawner overrides + bool RegisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner) override; + AZStd::pair GetNextPlayerSpawn() override; + bool UnregisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner) override; + //////////////////////////////////////////////////////////////////////// + + private: + AZStd::vector m_spawners; + }; +} // namespace MultiplayerSample From 5f5d3e2fd3d8236bed0987cc8273c6af6bf45b72 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Wed, 26 Jan 2022 20:43:21 -0500 Subject: [PATCH 27/71] Code cleanup Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- .../NetworkPrefabSpawnerComponent.cpp | 46 ------------------- .../PerfTest/NetworkPrefabSpawnerComponent.h | 9 ---- 2 files changed, 55 deletions(-) diff --git a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp index 7c489262f..9c5a2a053 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp +++ b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp @@ -209,7 +209,6 @@ namespace MultiplayerSample else { AZ_Assert(asset, "AssetMap didn't contain the asset id for prefab spawning"); - } } @@ -237,49 +236,4 @@ namespace MultiplayerSample } } } - - void NetworkPrefabSpawnerComponent::OnAssetCanceled(AZ::Data::AssetId assetId) - { - AZ_Printf("TEST", "%s %s", __FUNCTION__, assetId.ToString().c_str()); - } - - void NetworkPrefabSpawnerComponent::OnAssetContainerReady(AZ::Data::Asset assetData) - { - AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); - } - - void NetworkPrefabSpawnerComponent::OnAssetError(AZ::Data::Asset assetData) - { - AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); - } - - void NetworkPrefabSpawnerComponent::OnAssetMoved(AZ::Data::Asset assetData, [[maybe_unused]] void* oldDataPointer) - { - AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); - } - - void NetworkPrefabSpawnerComponent::OnAssetPreReload(AZ::Data::Asset assetData) - { - AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); - } - - void NetworkPrefabSpawnerComponent::OnAssetReloadError(AZ::Data::Asset assetData) - { - AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); - } - - void NetworkPrefabSpawnerComponent::OnAssetReloaded(AZ::Data::Asset assetData) - { - AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); - } - - void NetworkPrefabSpawnerComponent::OnAssetSaved(AZ::Data::Asset assetData, [[maybe_unused]] bool isSuccessful) - { - AZ_Printf("TEST", "%s %s", __FUNCTION__, assetData.GetId().ToString().c_str()); - } - - void NetworkPrefabSpawnerComponent::OnAssetUnloaded(const AZ::Data::AssetId assetId, [[maybe_unused]] const AZ::Data::AssetType asset) - { - AZ_Printf("TEST", "%s %s", __FUNCTION__, assetId.ToString().c_str()); - } } diff --git a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h index c3d366398..d7fadb0cc 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h +++ b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h @@ -35,15 +35,6 @@ namespace MultiplayerSample // AssetBus void OnAssetReady(AZ::Data::Asset asset) override; - void OnAssetCanceled(AZ::Data::AssetId assetId) override; - void OnAssetContainerReady(AZ::Data::Asset asset) override; - void OnAssetError(AZ::Data::Asset asset) override; - void OnAssetMoved(AZ::Data::Asset asset, void* oldDataPointer) override; - void OnAssetPreReload(AZ::Data::Asset asset) override; - void OnAssetReloadError(AZ::Data::Asset asset) override; - void OnAssetReloaded(AZ::Data::Asset asset) override; - void OnAssetSaved(AZ::Data::Asset asset, bool isSuccessful) override; - void OnAssetUnloaded(const AZ::Data::AssetId assetId, const AZ::Data::AssetType assetType) override; private: AZ::Data::Asset m_defaultSpawnableAsset; From 12bd87ec24ce2d1fa002ffa20272daf54ab69e94 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Thu, 27 Jan 2022 10:43:12 -0500 Subject: [PATCH 28/71] Code cleanup Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- .../NetworkTestComponent.AutoComponent.xml | 15 +++++ .../NetworkPrefabSpawnerComponent.cpp | 6 ++ .../PerfTest/NetworkPrefabSpawnerComponent.h | 7 +++ .../PerfTest/NetworkTestComponent.cpp | 59 ++++++------------- .../PerfTest/NetworkTestComponent.h | 28 ++------- .../PerfTest/NetworkTestSpawnerComponent.cpp | 2 - Gem/Code/Source/MultiplayerSampleModule.cpp | 1 - Gem/Code/multiplayersample_files.cmake | 1 + .../SpawningPerfTest/SpawningPerfTest.prefab | 19 +++++- Prefabs/Test_Net_Object.prefab | 10 ++++ 10 files changed, 80 insertions(+), 68 deletions(-) create mode 100644 Gem/Code/Source/AutoGen/NetworkTestComponent.AutoComponent.xml diff --git a/Gem/Code/Source/AutoGen/NetworkTestComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkTestComponent.AutoComponent.xml new file mode 100644 index 000000000..09416fbdc --- /dev/null +++ b/Gem/Code/Source/AutoGen/NetworkTestComponent.AutoComponent.xml @@ -0,0 +1,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp index 9c5a2a053..26e45be44 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp +++ b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp @@ -1,3 +1,9 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ #include "NetworkPrefabSpawnerComponent.h" diff --git a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h index d7fadb0cc..77108aac5 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h +++ b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + #pragma once #include diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.cpp index be779f2b6..f9e242e22 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.cpp +++ b/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.cpp @@ -5,65 +5,42 @@ * */ -#include -#include +#include #include -#include -#include -#include namespace MultiplayerSample { - void NetworkTestComponent::Reflect(AZ::ReflectContext* context) + NetworkTestComponentController::NetworkTestComponentController(NetworkTestComponent& parent) + : NetworkTestComponentControllerBase(parent) { - AZ::SerializeContext* serializeContext = azrtti_cast(context); - if (serializeContext) - { - serializeContext->Class() - ->Field("Enable Movement", &NetworkTestComponent::m_enableMotion) - ->Field("Oscillator Amplitude", &NetworkTestComponent::m_oscillatorAmplitude) - ->Field("Oscillator Speed", &NetworkTestComponent::m_oscillatorSpeedFactor) - ->Version(1); - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - using namespace AZ::Edit; - editContext->Class("Network Test Helper", - "Various helpful test tools and behaviors to test multiplayer logic and performance.") - ->ClassElement(ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Category, "MultiplayerSample") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game")) - ->DataElement(nullptr, &NetworkTestComponent::m_enableMotion, "Enabled", "enabled oscillation along Z axis") - ->DataElement(nullptr, &NetworkTestComponent::m_oscillatorAmplitude, "Oscillator Amplitude", "amplitude along Z axis") - ->DataElement(nullptr, &NetworkTestComponent::m_oscillatorSpeedFactor, "Oscillator Speed", "speed factor along Z axis") - ; - } - } } - void NetworkTestComponent::Activate() + void NetworkTestComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { - if (const Multiplayer::NetBindComponent* netBindComponent = GetEntity()->FindComponent()) + if (GetParent().GetEnableHopping()) { - if (netBindComponent->IsNetEntityRoleAuthority()) - { - AZ::TickBus::Handler::BusConnect(); - m_startTranslation = GetEntity()->GetTransform()->GetWorldTranslation(); - } + m_accumulatedTime = 0.f; + AZ::TickBus::Handler::BusConnect(); } } - void NetworkTestComponent::Deactivate() + void NetworkTestComponentController::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { AZ::TickBus::Handler::BusDisconnect(); } - void NetworkTestComponent::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) + void NetworkTestComponentController::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) { m_accumulatedTime += deltaTime; - AZ::Vector3 copy = m_startTranslation; - copy.SetZ(copy.GetZ() + AZStd::sin(m_accumulatedTime * m_oscillatorSpeedFactor) * m_oscillatorAmplitude); - GetEntity()->GetTransform()->SetWorldTranslation(copy); + if (m_accumulatedTime > GetParent().GetHopPeriod()) + { + m_accumulatedTime = 0.f; + + if (PhysX::RigidBodyComponent* body = GetEntity()->FindComponent()) + { + body->ApplyLinearImpulse(AZ::Vector3::CreateAxisZ(GetParent().GetHopForce())); + } + } } } diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.h b/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.h index a829041b8..389c5e1fa 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.h +++ b/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.h @@ -7,31 +7,20 @@ #pragma once -#include #include +#include namespace MultiplayerSample { - //! @class NetworkTestComponent - class NetworkTestComponent final - : public AZ::Component + class NetworkTestComponentController + : public NetworkTestComponentControllerBase , public AZ::TickBus::Handler { public: - AZ_COMPONENT(MultiplayerSample::NetworkTestComponent, "{7FAA74C4-5A35-4602-95D9-E83DE9EC7B01}"); + NetworkTestComponentController(NetworkTestComponent& parent); - static void Reflect(AZ::ReflectContext* context); - - static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& provided) - { - provided.push_back(AZ_CRC_CE("NetBindService")); - } - - //! AZ::Component overrides. - //! @{ - void Activate() override; - void Deactivate() override; - //! }@ + void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; + void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; //! AZ::TickBus overrides. //! @{ @@ -39,11 +28,6 @@ namespace MultiplayerSample //! }@ private: - bool m_enableMotion = false; - float m_oscillatorAmplitude = 1.f; - float m_oscillatorSpeedFactor = 1.f; - float m_accumulatedTime = 0.f; - AZ::Vector3 m_startTranslation = AZ::Vector3::CreateZero(); }; } diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp index 650a3e895..d37644e21 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp +++ b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp @@ -16,8 +16,6 @@ #include #include "NetworkPrefabSpawnerComponent.h" -#pragma optimize("", off) - namespace MultiplayerSample { NetworkTestSpawnerComponentController::NetworkTestSpawnerComponentController(NetworkTestSpawnerComponent& parent) diff --git a/Gem/Code/Source/MultiplayerSampleModule.cpp b/Gem/Code/Source/MultiplayerSampleModule.cpp index 2e83acb5e..697411288 100644 --- a/Gem/Code/Source/MultiplayerSampleModule.cpp +++ b/Gem/Code/Source/MultiplayerSampleModule.cpp @@ -31,7 +31,6 @@ namespace MultiplayerSample m_descriptors.insert(m_descriptors.end(), { MultiplayerSampleSystemComponent::CreateDescriptor(), ExampleFilteredEntityComponent::CreateDescriptor(), - NetworkTestComponent::CreateDescriptor(), NetworkPrefabSpawnerComponent::CreateDescriptor(), }); diff --git a/Gem/Code/multiplayersample_files.cmake b/Gem/Code/multiplayersample_files.cmake index 72d6005f0..a4bafe48d 100644 --- a/Gem/Code/multiplayersample_files.cmake +++ b/Gem/Code/multiplayersample_files.cmake @@ -17,6 +17,7 @@ set(FILES Source/AutoGen/NetworkStressTestComponent.AutoComponent.xml Source/AutoGen/NetworkPlayerMovementComponent.AutoComponent.xml Source/AutoGen/NetworkTestSpawnerComponent.AutoComponent.xml + Source/AutoGen/NetworkTestComponent.AutoComponent.xml Source/Components/ExampleFilteredEntityComponent.h Source/Components/ExampleFilteredEntityComponent.cpp Source/Components/NetworkAiComponent.cpp diff --git a/Levels/SpawningPerfTest/SpawningPerfTest.prefab b/Levels/SpawningPerfTest/SpawningPerfTest.prefab index 253b823b3..22b30638d 100644 --- a/Levels/SpawningPerfTest/SpawningPerfTest.prefab +++ b/Levels/SpawningPerfTest/SpawningPerfTest.prefab @@ -525,7 +525,7 @@ "m_template": { "$type": "MultiplayerSample::NetworkTestSpawnerComponent", "Enabled": true, - "MaxLiveCount": 100, + "MaxLiveCount": 1000, "SpawnPerSecond": 10 } }, @@ -573,7 +573,10 @@ }, "Component_[16930831424390780459]": { "$type": "EditorEntitySortComponent", - "Id": 16930831424390780459 + "Id": 16930831424390780459, + "Child Entity Order": [ + "Instance_[414131786087]/ContainerEntity" + ] }, "Component_[17854143994569306422]": { "$type": "GenericComponentWrapper", @@ -630,5 +633,17 @@ } } } + }, + "Instances": { + "Instance_[414131786087]": { + "Source": "Prefabs/Test_Net_Object.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[10875373432506593388]/Parent Entity", + "value": "../Entity_[947961075516]" + } + ] + } } } \ No newline at end of file diff --git a/Prefabs/Test_Net_Object.prefab b/Prefabs/Test_Net_Object.prefab index 9abfb8d79..b347f8394 100644 --- a/Prefabs/Test_Net_Object.prefab +++ b/Prefabs/Test_Net_Object.prefab @@ -140,6 +140,16 @@ } ] }, + "Component_[2176242692874007681]": { + "$type": "GenericComponentWrapper", + "Id": 2176242692874007681, + "m_template": { + "$type": "MultiplayerSample::NetworkTestComponent", + "EnableHopping": true, + "HopPeriod": 4.0, + "HopForce": 10000.0 + } + }, "Component_[2286851697353605533]": { "$type": "EditorPendingCompositionComponent", "Id": 2286851697353605533 From 18ed336ec95759a05abcca8a98ac0f79707ad94e Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Thu, 27 Jan 2022 10:59:09 -0500 Subject: [PATCH 29/71] Adding missing header info Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Gem/Code/Include/NetworkPrefabSpawnerInterface.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Gem/Code/Include/NetworkPrefabSpawnerInterface.h b/Gem/Code/Include/NetworkPrefabSpawnerInterface.h index 2ae2ad581..264c2147c 100644 --- a/Gem/Code/Include/NetworkPrefabSpawnerInterface.h +++ b/Gem/Code/Include/NetworkPrefabSpawnerInterface.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + #pragma once #include From 191e9071ffd9b7a17c2d379873059a44aff2803e Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Thu, 27 Jan 2022 12:40:51 -0500 Subject: [PATCH 30/71] CR cleanup Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Gem/Code/Include/NetworkPrefabSpawnerInterface.h | 2 +- .../_savebackup/2022-01-20 [09.42.00]/tags.txt | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 Levels/SpawningPerfTest/_savebackup/2022-01-20 [09.42.00]/tags.txt diff --git a/Gem/Code/Include/NetworkPrefabSpawnerInterface.h b/Gem/Code/Include/NetworkPrefabSpawnerInterface.h index 264c2147c..8d890d6f1 100644 --- a/Gem/Code/Include/NetworkPrefabSpawnerInterface.h +++ b/Gem/Code/Include/NetworkPrefabSpawnerInterface.h @@ -29,7 +29,7 @@ namespace MultiplayerSample class NetworkPrefabSpawnerRequests { public: - AZ_RTTI(RecastO3DEGemRequests, "{82e5cfb5-6a1a-4bd1-b48d-cd817474d611}"); + AZ_RTTI(NetworkPrefabSpawnerRequests, "{82e5cfb5-6a1a-4bd1-b48d-cd817474d611}"); virtual ~NetworkPrefabSpawnerRequests() = default; virtual void SpawnPrefab(const AZ::Transform& worldTm, const char* assetPath, PrefabCallbacks callbacks) = 0; diff --git a/Levels/SpawningPerfTest/_savebackup/2022-01-20 [09.42.00]/tags.txt b/Levels/SpawningPerfTest/_savebackup/2022-01-20 [09.42.00]/tags.txt deleted file mode 100644 index 0d6c1880e..000000000 --- a/Levels/SpawningPerfTest/_savebackup/2022-01-20 [09.42.00]/tags.txt +++ /dev/null @@ -1,12 +0,0 @@ -0,0,0,0,0,0 -0,0,0,0,0,0 -0,0,0,0,0,0 -0,0,0,0,0,0 -0,0,0,0,0,0 -0,0,0,0,0,0 -0,0,0,0,0,0 -0,0,0,0,0,0 -0,0,0,0,0,0 -0,0,0,0,0,0 -0,0,0,0,0,0 -0,0,0,0,0,0 From 4e87c4df06e2079ad2f723c328184a35a1ecf658 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Thu, 27 Jan 2022 12:48:08 -0500 Subject: [PATCH 31/71] CR cleanup Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- .../PerfTest/NetworkPrefabSpawnerComponent.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp index 26e45be44..9a1998a02 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp +++ b/Gem/Code/Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp @@ -172,8 +172,9 @@ namespace MultiplayerSample void NetworkPrefabSpawnerComponent::CreateInstance(const SpawnRequest& request, const AssetItem* asset) { - AZ::Transform world = request.m_whereToSpawn; + AZ_Assert(asset, "AssetMap didn't contain the asset id for prefab spawning"); + AZ::Transform world = request.m_whereToSpawn; if (asset) { auto ticket = AZStd::make_shared(asset->m_spawnableAsset); @@ -200,6 +201,7 @@ namespace MultiplayerSample } }; + AZ_Assert(ticket->IsValid(), "Unable to instantiate spawnable asset"); if (ticket->IsValid()) { AzFramework::SpawnAllEntitiesOptionalArgs optionalArgs; @@ -207,14 +209,6 @@ namespace MultiplayerSample optionalArgs.m_completionCallback = AZStd::move(onSpawnedCallback); AzFramework::SpawnableEntitiesInterface::Get()->SpawnAllEntities(*ticket, AZStd::move(optionalArgs)); } - else - { - AZ_Assert(ticket->IsValid(), "Unable to instantiate spawnable asset"); - } - } - else - { - AZ_Assert(asset, "AssetMap didn't contain the asset id for prefab spawning"); } } From e8811d65712659b8fa69c2dbdea89aeb2e0f92a6 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Fri, 28 Jan 2022 11:13:56 -0800 Subject: [PATCH 32/71] Add RoundRobinSpawner and related Level updates Signed-off-by: puvvadar --- ...rkPlayerSpawnerComponent.AutoComponent.xml | 1 + .../NetworkPlayerSpawnerComponent.cpp | 12 + .../NetworkPlayerSpawnerComponent.h | 2 + .../MultiplayerSampleSystemComponent.cpp | 14 +- .../Source/Spawners/RoundRobinSpawner.cpp | 19 +- Gem/Code/Source/Spawners/RoundRobinSpawner.h | 1 + Levels/SampleBase/SampleBase.prefab | 422 +++++++++++++----- 7 files changed, 334 insertions(+), 137 deletions(-) diff --git a/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml index f2643fe5b..adf5ccc91 100644 --- a/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml @@ -11,4 +11,5 @@ + diff --git a/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.cpp b/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.cpp index d044dfcef..099b03843 100644 --- a/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.cpp +++ b/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.cpp @@ -6,11 +6,23 @@ * */ +#include + #include #include namespace MultiplayerSample { + void NetworkPlayerSpawnerComponent::NetworkPlayerSpawnerComponent::Reflect(AZ::ReflectContext* context) + { + AZ::SerializeContext* serializeContext = azrtti_cast(context); + if (serializeContext) + { + serializeContext->Class()->Version(1); + } + NetworkPlayerSpawnerComponentBase::Reflect(context); + } + void NetworkPlayerSpawnerComponent::OnInit() { ; diff --git a/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h b/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h index 58fa78c30..25d3dde08 100644 --- a/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h +++ b/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h @@ -22,6 +22,8 @@ namespace MultiplayerSample s_networkPlayerSpawnerComponentConcreteUuid, MultiplayerSample::NetworkPlayerSpawnerComponentBase); + static void Reflect(AZ::ReflectContext* context); + NetworkPlayerSpawnerComponent(){}; void OnInit() override; diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index ef44c0d84..6354dad9e 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -113,19 +113,9 @@ namespace MultiplayerSample } AZStd::pair MultiplayerSampleSystemComponent::OnPlayerJoin( - uint64_t userId, [[maybe_unused]] const Multiplayer::MultiplayerAgentDatum& agentDatum) + [[maybe_unused]] uint64_t userId, [[maybe_unused]] const Multiplayer::MultiplayerAgentDatum& agentDatum) { - auto sv_playerSpawnAssetLowerCase = static_cast(sv_playerSpawnAsset); - AZStd::to_lower(sv_playerSpawnAssetLowerCase.begin(), sv_playerSpawnAssetLowerCase.end()); - Multiplayer::PrefabEntityId playerPrefabEntityId(AZ::Name(sv_playerSpawnAssetLowerCase.c_str())); - - // Assuming userIds increase linearly (which is naive), spawn in rows of a prescribed size - const uint8_t spawnRowSize = 8; - AZ::Transform transform = AZ::Transform::CreateIdentity(); - transform.SetTranslation( - AZ::Vector3(aznumeric_cast(userId % spawnRowSize) * 32.f, aznumeric_cast(userId / spawnRowSize) * 32.f, 0)); - - return AZStd::pair(playerPrefabEntityId, transform); + return AZ::Interface::Get()->GetNextPlayerSpawn(); } void MultiplayerSampleSystemComponent::OnPlayerLeave( diff --git a/Gem/Code/Source/Spawners/RoundRobinSpawner.cpp b/Gem/Code/Source/Spawners/RoundRobinSpawner.cpp index 31d2a35f1..48bd55cee 100644 --- a/Gem/Code/Source/Spawners/RoundRobinSpawner.cpp +++ b/Gem/Code/Source/Spawners/RoundRobinSpawner.cpp @@ -5,13 +5,15 @@ * */ +#include +#include #include namespace MultiplayerSample { bool RoundRobinSpawner::RegisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner) { - if (!AZStd::find(m_spawners.begin(), m_spawners.end(), spawner)) + if (AZStd::find(m_spawners.begin(), m_spawners.end(), spawner) == m_spawners.end()) { m_spawners.push_back(spawner); return true; @@ -22,7 +24,20 @@ namespace MultiplayerSample AZStd::pair RoundRobinSpawner::GetNextPlayerSpawn() { - return AZStd::make_pair(Multiplayer::PrefabEntityId(), AZ::Transform::CreateIdentity()); + if (m_spawners.empty()) + { + AZLOG_WARN("No active NetworkPlayerSpawnerComponents were found on player spawn request.") + return AZStd::make_pair(Multiplayer::PrefabEntityId(), AZ::Transform::CreateIdentity()); + } + + NetworkPlayerSpawnerComponent* spawner = m_spawners[m_spawnIndex]; + m_spawnIndex = m_spawnIndex + 1 == m_spawners.size() ? 0 : m_spawnIndex + 1; + AZStd::string assetPath = spawner->GetAssetPath(); + AZStd::to_lower(assetPath.begin(), assetPath.end()); + Multiplayer::PrefabEntityId prefabEntityId(AZ::Name(assetPath.c_str())); + + return AZStd::make_pair( + prefabEntityId, spawner->GetEntity()->GetTransform()->GetWorldTM()); } bool RoundRobinSpawner::UnregisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner) diff --git a/Gem/Code/Source/Spawners/RoundRobinSpawner.h b/Gem/Code/Source/Spawners/RoundRobinSpawner.h index 10163698f..a67ab819e 100644 --- a/Gem/Code/Source/Spawners/RoundRobinSpawner.h +++ b/Gem/Code/Source/Spawners/RoundRobinSpawner.h @@ -38,5 +38,6 @@ namespace MultiplayerSample private: AZStd::vector m_spawners; + uint8_t m_spawnIndex = 0; }; } // namespace MultiplayerSample diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index 6d347e9b2..4dd0c49df 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -53,7 +53,21 @@ }, "Component_[8247764638131379605]": { "$type": "EditorEntitySortComponent", - "Id": 8247764638131379605 + "Id": 8247764638131379605, + "Child Entity Order": [ + "Entity_[1863191303392]", + "Entity_[14030996048227]", + "Instance_[2915620686179]/ContainerEntity", + "Instance_[2834016307555]/ContainerEntity", + "Entity_[412839637138]", + "Instance_[785316907363]/ContainerEntity", + "Instance_[3293577808227]/ContainerEntity", + "Entity_[830977005898]", + "Entity_[522980195737]", + "Entity_[600289607065]", + "Entity_[527275163033]", + "Entity_[673304051097]" + ] } } }, @@ -149,22 +163,9 @@ "$type": "EditorScriptCanvasComponent", "Id": 12802329719955739455, "m_name": "SpawnIfAuthority", - "m_assetHolder": { - "m_asset": { - "assetId": { - "guid": "{B605AD71-0689-5650-B3F5-558D471B6351}" - }, - "assetHint": "scriptcanvas/spawnifauthority.scriptcanvas" - } - }, "runtimeDataIsValid": true, - "runtimeDataOverrides": { - "source": { - "assetId": { - "guid": "{B605AD71-0689-5650-B3F5-558D471B6351}" - }, - "assetHint": "scriptcanvas/spawnifauthority.scriptcanvas" - } + "sourceHandle": { + "id": "{B605AD71-0689-5650-B3F5-558D471B6351}" } }, "Component_[15194128185768259769]": { @@ -296,112 +297,7 @@ } } } - }, - "defaultMaterialSlot": { - "materialAsset": { - "assetId": { - "guid": "{39704C53-AC3A-51BE-81EA-23CEA2455340}" - }, - "assetHint": "materials/defaultpbr.azmaterial" - } - }, - "materialSlots": [ - { - "id": { - "materialSlotStableId": 803645540 - } - }, - { - "id": { - "materialSlotStableId": 803645540 - } - }, - { - "id": { - "materialSlotStableId": 803645540 - } - }, - { - "id": { - "materialSlotStableId": 803645540 - } - }, - { - "id": { - "materialSlotStableId": 803645540 - } - }, - { - "id": { - "materialSlotStableId": 803645540 - } - }, - { - "materialAsset": { - "assetId": { - "guid": "{39704C53-AC3A-51BE-81EA-23CEA2455340}" - }, - "assetHint": "materials/defaultpbr.azmaterial" - } - } - ], - "materialSlotsByLod": [ - [ - { - "id": { - "lodIndex": 0, - "materialSlotStableId": 803645540 - } - } - ], - [ - { - "id": { - "lodIndex": 0, - "materialSlotStableId": 803645540 - } - } - ], - [ - { - "id": { - "lodIndex": 0, - "materialSlotStableId": 803645540 - } - } - ], - [ - { - "id": { - "lodIndex": 0, - "materialSlotStableId": 803645540 - } - } - ], - [ - { - "id": { - "lodIndex": 0, - "materialSlotStableId": 803645540 - } - } - ], - [ - { - "id": { - "lodIndex": 0, - "materialSlotStableId": 803645540 - } - } - ], - [ - { - "id": { - "lodIndex": 0 - } - } - ] - ] + } }, "Component_[1703359235958163404]": { "$type": "AZ::Render::EditorMeshComponent", @@ -465,6 +361,286 @@ } } }, + "Entity_[522980195737]": { + "Id": "Entity_[522980195737]", + "Name": "Spawner", + "Components": { + "Component_[10620106518871193371]": { + "$type": "EditorLockComponent", + "Id": 10620106518871193371 + }, + "Component_[12065531007728318804]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 12065531007728318804 + }, + "Component_[12288490232492385366]": { + "$type": "GenericComponentWrapper", + "Id": 12288490232492385366, + "m_template": { + "$type": "MultiplayerSample::NetworkPlayerSpawnerComponent", + "SnapToGround": true, + "AssetPath": "prefabs/player.network.spawnable" + } + }, + "Component_[12447752996362612657]": { + "$type": "EditorEntityIconComponent", + "Id": 12447752996362612657 + }, + "Component_[12847596421026527364]": { + "$type": "SelectionComponent", + "Id": 12847596421026527364 + }, + "Component_[13598691711255464741]": { + "$type": "EditorOnlyEntityComponent", + "Id": 13598691711255464741 + }, + "Component_[13899657516076530251]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 13899657516076530251, + "Parent Entity": "Entity_[356758116574]", + "Transform Data": { + "Translate": [ + 0.0, + 10.0, + 0.0 + ] + } + }, + "Component_[14573817142533140072]": { + "$type": "EditorInspectorComponent", + "Id": 14573817142533140072 + }, + "Component_[1549015690346168429]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1549015690346168429 + }, + "Component_[15944498823917725657]": { + "$type": "EditorEntitySortComponent", + "Id": 15944498823917725657 + }, + "Component_[5869030238385945252]": { + "$type": "GenericComponentWrapper", + "Id": 5869030238385945252, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[6432406141729708226]": { + "$type": "EditorVisibilityComponent", + "Id": 6432406141729708226 + } + } + }, + "Entity_[527275163033]": { + "Id": "Entity_[527275163033]", + "Name": "Spawner", + "Components": { + "Component_[10620106518871193371]": { + "$type": "EditorLockComponent", + "Id": 10620106518871193371 + }, + "Component_[12065531007728318804]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 12065531007728318804 + }, + "Component_[12288490232492385366]": { + "$type": "GenericComponentWrapper", + "Id": 12288490232492385366, + "m_template": { + "$type": "MultiplayerSample::NetworkPlayerSpawnerComponent", + "SnapToGround": true, + "AssetPath": "prefabs/player.network.spawnable" + } + }, + "Component_[12447752996362612657]": { + "$type": "EditorEntityIconComponent", + "Id": 12447752996362612657 + }, + "Component_[12847596421026527364]": { + "$type": "SelectionComponent", + "Id": 12847596421026527364 + }, + "Component_[13598691711255464741]": { + "$type": "EditorOnlyEntityComponent", + "Id": 13598691711255464741 + }, + "Component_[13899657516076530251]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 13899657516076530251, + "Parent Entity": "Entity_[356758116574]", + "Transform Data": { + "Translate": [ + 10.0, + 0.0, + 0.0 + ] + } + }, + "Component_[14573817142533140072]": { + "$type": "EditorInspectorComponent", + "Id": 14573817142533140072 + }, + "Component_[1549015690346168429]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1549015690346168429 + }, + "Component_[15944498823917725657]": { + "$type": "EditorEntitySortComponent", + "Id": 15944498823917725657 + }, + "Component_[5869030238385945252]": { + "$type": "GenericComponentWrapper", + "Id": 5869030238385945252, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[6432406141729708226]": { + "$type": "EditorVisibilityComponent", + "Id": 6432406141729708226 + } + } + }, + "Entity_[600289607065]": { + "Id": "Entity_[600289607065]", + "Name": "Spawner", + "Components": { + "Component_[10620106518871193371]": { + "$type": "EditorLockComponent", + "Id": 10620106518871193371 + }, + "Component_[12065531007728318804]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 12065531007728318804 + }, + "Component_[12288490232492385366]": { + "$type": "GenericComponentWrapper", + "Id": 12288490232492385366, + "m_template": { + "$type": "MultiplayerSample::NetworkPlayerSpawnerComponent", + "SnapToGround": true, + "AssetPath": "prefabs/player.network.spawnable" + } + }, + "Component_[12447752996362612657]": { + "$type": "EditorEntityIconComponent", + "Id": 12447752996362612657 + }, + "Component_[12847596421026527364]": { + "$type": "SelectionComponent", + "Id": 12847596421026527364 + }, + "Component_[13598691711255464741]": { + "$type": "EditorOnlyEntityComponent", + "Id": 13598691711255464741 + }, + "Component_[13899657516076530251]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 13899657516076530251, + "Parent Entity": "Entity_[356758116574]", + "Transform Data": { + "Translate": [ + 0.0, + -10.0, + 0.0 + ] + } + }, + "Component_[14573817142533140072]": { + "$type": "EditorInspectorComponent", + "Id": 14573817142533140072 + }, + "Component_[1549015690346168429]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1549015690346168429 + }, + "Component_[15944498823917725657]": { + "$type": "EditorEntitySortComponent", + "Id": 15944498823917725657 + }, + "Component_[5869030238385945252]": { + "$type": "GenericComponentWrapper", + "Id": 5869030238385945252, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[6432406141729708226]": { + "$type": "EditorVisibilityComponent", + "Id": 6432406141729708226 + } + } + }, + "Entity_[673304051097]": { + "Id": "Entity_[673304051097]", + "Name": "Spawner", + "Components": { + "Component_[10620106518871193371]": { + "$type": "EditorLockComponent", + "Id": 10620106518871193371 + }, + "Component_[12065531007728318804]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 12065531007728318804 + }, + "Component_[12288490232492385366]": { + "$type": "GenericComponentWrapper", + "Id": 12288490232492385366, + "m_template": { + "$type": "MultiplayerSample::NetworkPlayerSpawnerComponent", + "SnapToGround": true, + "AssetPath": "prefabs/player.network.spawnable" + } + }, + "Component_[12447752996362612657]": { + "$type": "EditorEntityIconComponent", + "Id": 12447752996362612657 + }, + "Component_[12847596421026527364]": { + "$type": "SelectionComponent", + "Id": 12847596421026527364 + }, + "Component_[13598691711255464741]": { + "$type": "EditorOnlyEntityComponent", + "Id": 13598691711255464741 + }, + "Component_[13899657516076530251]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 13899657516076530251, + "Parent Entity": "Entity_[356758116574]", + "Transform Data": { + "Translate": [ + -10.0, + 0.0, + 0.0 + ] + } + }, + "Component_[14573817142533140072]": { + "$type": "EditorInspectorComponent", + "Id": 14573817142533140072 + }, + "Component_[1549015690346168429]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1549015690346168429 + }, + "Component_[15944498823917725657]": { + "$type": "EditorEntitySortComponent", + "Id": 15944498823917725657 + }, + "Component_[5869030238385945252]": { + "$type": "GenericComponentWrapper", + "Id": 5869030238385945252, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[6432406141729708226]": { + "$type": "EditorVisibilityComponent", + "Id": 6432406141729708226 + } + } + }, "Entity_[830977005898]": { "Id": "Entity_[830977005898]", "Name": "Camera", @@ -519,7 +695,7 @@ "Id": 7092071161962745685, "Controller": { "Configuration": { - "EditorEntityId": 15375043528419945729 + "EditorEntityId": 15523728147827078032 } } }, From a11fda42099ac8c0448621498be6803083bd948c Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Thu, 3 Feb 2022 12:13:32 -0500 Subject: [PATCH 33/71] Addressing CR feedback Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- .../Include/NetworkPrefabSpawnerInterface.h | 19 ++++++++ ...kRandomImpulseComponent.AutoComponent.xml} | 4 +- .../NetworkRandomImpulseComponent.cpp | 47 +++++++++++++++++++ .../PerfTest/NetworkRandomImpulseComponent.h | 29 ++++++++++++ .../PerfTest/NetworkTestComponent.cpp | 46 ------------------ .../PerfTest/NetworkTestComponent.h | 33 ------------- .../PerfTest/NetworkTestSpawnerComponent.cpp | 7 +-- .../PerfTest/NetworkTestSpawnerComponent.h | 10 ++-- Gem/Code/Source/MultiplayerSampleModule.cpp | 2 +- Gem/Code/multiplayersample_files.cmake | 6 +-- 10 files changed, 108 insertions(+), 95 deletions(-) rename Gem/Code/Source/AutoGen/{NetworkTestComponent.AutoComponent.xml => NetworkRandomImpulseComponent.AutoComponent.xml} (83%) create mode 100644 Gem/Code/Source/Components/PerfTest/NetworkRandomImpulseComponent.cpp create mode 100644 Gem/Code/Source/Components/PerfTest/NetworkRandomImpulseComponent.h delete mode 100644 Gem/Code/Source/Components/PerfTest/NetworkTestComponent.cpp delete mode 100644 Gem/Code/Source/Components/PerfTest/NetworkTestComponent.h diff --git a/Gem/Code/Include/NetworkPrefabSpawnerInterface.h b/Gem/Code/Include/NetworkPrefabSpawnerInterface.h index 8d890d6f1..21119360c 100644 --- a/Gem/Code/Include/NetworkPrefabSpawnerInterface.h +++ b/Gem/Code/Include/NetworkPrefabSpawnerInterface.h @@ -32,8 +32,27 @@ namespace MultiplayerSample AZ_RTTI(NetworkPrefabSpawnerRequests, "{82e5cfb5-6a1a-4bd1-b48d-cd817474d611}"); virtual ~NetworkPrefabSpawnerRequests() = default; + /** + * \brief Spawn a prefab given its asset path at a specified transform. + * \param worldTm Where to spawn the instance. + * \param assetPath Path to .spawnable asset to spawn from. + * \param callbacks Optional structure for pre-activate and post-activate callbacks. + */ virtual void SpawnPrefab(const AZ::Transform& worldTm, const char* assetPath, PrefabCallbacks callbacks) = 0; + + /** + * \brief Spawn a prefab from spawnable asset at a specified transform. + * \param worldTm Where to spawn the instance. + * \param asset .spawnable asset to spawn from. + * \param callbacks Optional structure for pre-activate and post-activate callbacks. + */ virtual void SpawnPrefabAsset(const AZ::Transform& worldTm, const AZ::Data::Asset& asset, PrefabCallbacks callbacks) = 0; + + /** + * \brief Spawn a prefab instance from spawnable asset assigned in the spawner component. See @NetworkPrefabSpawnerComponent. + * \param worldTm Where to spawn the instance. + * \param callbacks Optional structure for pre-activate and post-activate callbacks. + */ virtual void SpawnDefaultPrefab(const AZ::Transform& worldTm, PrefabCallbacks callbacks) = 0; }; diff --git a/Gem/Code/Source/AutoGen/NetworkTestComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkRandomImpulseComponent.AutoComponent.xml similarity index 83% rename from Gem/Code/Source/AutoGen/NetworkTestComponent.AutoComponent.xml rename to Gem/Code/Source/AutoGen/NetworkRandomImpulseComponent.AutoComponent.xml index 09416fbdc..1ca45b8fe 100644 --- a/Gem/Code/Source/AutoGen/NetworkTestComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkRandomImpulseComponent.AutoComponent.xml @@ -1,11 +1,11 @@ diff --git a/Gem/Code/Source/Components/PerfTest/NetworkRandomImpulseComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkRandomImpulseComponent.cpp new file mode 100644 index 000000000..cf2eeddb6 --- /dev/null +++ b/Gem/Code/Source/Components/PerfTest/NetworkRandomImpulseComponent.cpp @@ -0,0 +1,47 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace MultiplayerSample +{ + NetworkRandomImpulseComponentController::NetworkRandomImpulseComponentController(NetworkRandomImpulseComponent& parent) + : NetworkRandomImpulseComponentControllerBase(parent) + , m_tickEvent{ [this] { TickEvent(); }, AZ::Name{ "NetworkRandomImpulseComponent" } } + { + } + + void NetworkRandomImpulseComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) + { + if (GetParent().GetEnableHopping()) + { + m_tickEvent.Enqueue(AZ::TimeMs{ 0 }, true); + m_accumulatedTime = 0.f; + } + } + + void NetworkRandomImpulseComponentController::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) + { + } + + void NetworkRandomImpulseComponentController::TickEvent() + { + const float deltaTime = static_cast(m_tickEvent.TimeInQueueMs()) / 1000.f; + m_accumulatedTime += deltaTime; + + if (m_accumulatedTime > GetParent().GetHopPeriod()) + { + m_accumulatedTime = 0.f; + + if (PhysX::RigidBodyComponent* body = GetEntity()->FindComponent()) + { + body->ApplyLinearImpulse(AZ::Vector3::CreateAxisZ(GetParent().GetHopForce())); + } + } + } +} diff --git a/Gem/Code/Source/Components/PerfTest/NetworkRandomImpulseComponent.h b/Gem/Code/Source/Components/PerfTest/NetworkRandomImpulseComponent.h new file mode 100644 index 000000000..4d0f6f6f8 --- /dev/null +++ b/Gem/Code/Source/Components/PerfTest/NetworkRandomImpulseComponent.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +namespace MultiplayerSample +{ + class NetworkRandomImpulseComponentController + : public NetworkRandomImpulseComponentControllerBase + { + public: + NetworkRandomImpulseComponentController(NetworkRandomImpulseComponent& parent); + + void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; + void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; + + private: + float m_accumulatedTime = 0.f; + + AZ::ScheduledEvent m_tickEvent; + void TickEvent(); + }; +} diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.cpp deleted file mode 100644 index f9e242e22..000000000 --- a/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include - -namespace MultiplayerSample -{ - NetworkTestComponentController::NetworkTestComponentController(NetworkTestComponent& parent) - : NetworkTestComponentControllerBase(parent) - { - } - - void NetworkTestComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) - { - if (GetParent().GetEnableHopping()) - { - m_accumulatedTime = 0.f; - AZ::TickBus::Handler::BusConnect(); - } - } - - void NetworkTestComponentController::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) - { - AZ::TickBus::Handler::BusDisconnect(); - } - - void NetworkTestComponentController::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) - { - m_accumulatedTime += deltaTime; - - if (m_accumulatedTime > GetParent().GetHopPeriod()) - { - m_accumulatedTime = 0.f; - - if (PhysX::RigidBodyComponent* body = GetEntity()->FindComponent()) - { - body->ApplyLinearImpulse(AZ::Vector3::CreateAxisZ(GetParent().GetHopForce())); - } - } - } -} diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.h b/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.h deleted file mode 100644 index 389c5e1fa..000000000 --- a/Gem/Code/Source/Components/PerfTest/NetworkTestComponent.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include - -namespace MultiplayerSample -{ - class NetworkTestComponentController - : public NetworkTestComponentControllerBase - , public AZ::TickBus::Handler - { - public: - NetworkTestComponentController(NetworkTestComponent& parent); - - void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; - void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; - - //! AZ::TickBus overrides. - //! @{ - void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - //! }@ - - private: - float m_accumulatedTime = 0.f; - }; -} diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp index d37644e21..607d099bc 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp +++ b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp @@ -20,12 +20,13 @@ namespace MultiplayerSample { NetworkTestSpawnerComponentController::NetworkTestSpawnerComponentController(NetworkTestSpawnerComponent& parent) : NetworkTestSpawnerComponentControllerBase(parent) + , m_tickEvent{ [this] { TickEvent(); }, AZ::Name{ "NetworkTestSpawnerComponent" } } { } void NetworkTestSpawnerComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { - AZ::TickBus::Handler::BusConnect(); + m_tickEvent.Enqueue(AZ::TimeMs{ 0 }, true); m_currentCount = 0; m_accumulatedTime = 0.f; @@ -34,11 +35,11 @@ namespace MultiplayerSample void NetworkTestSpawnerComponentController::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { - AZ::TickBus::Handler::BusDisconnect(); } - void NetworkTestSpawnerComponentController::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) + void NetworkTestSpawnerComponentController::TickEvent() { + const float deltaTime = static_cast(m_tickEvent.TimeInQueueMs()) / 1000.f; m_accumulatedTime += deltaTime; if (m_accumulatedTime > 1.0f / aznumeric_cast(GetParent().GetSpawnPerSecond())) diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.h b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.h index ed758ef2b..6183d49f1 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.h +++ b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.h @@ -7,7 +7,6 @@ #pragma once -#include #include #include @@ -15,7 +14,6 @@ namespace MultiplayerSample { class NetworkTestSpawnerComponentController : public NetworkTestSpawnerComponentControllerBase - , public AZ::TickBus::Handler { public: NetworkTestSpawnerComponentController(NetworkTestSpawnerComponent& parent); @@ -23,16 +21,14 @@ namespace MultiplayerSample void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; - //! AZ::TickBus overrides. - //! @{ - void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - //! }@ - private: int m_currentCount = 0; float m_accumulatedTime = 0.f; float m_sinceLastSpawn = 0.f; AZStd::deque> m_spawnedObjects; + + AZ::ScheduledEvent m_tickEvent; + void TickEvent(); }; } diff --git a/Gem/Code/Source/MultiplayerSampleModule.cpp b/Gem/Code/Source/MultiplayerSampleModule.cpp index 697411288..0473fb572 100644 --- a/Gem/Code/Source/MultiplayerSampleModule.cpp +++ b/Gem/Code/Source/MultiplayerSampleModule.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/Gem/Code/multiplayersample_files.cmake b/Gem/Code/multiplayersample_files.cmake index a4bafe48d..0a786501e 100644 --- a/Gem/Code/multiplayersample_files.cmake +++ b/Gem/Code/multiplayersample_files.cmake @@ -17,7 +17,7 @@ set(FILES Source/AutoGen/NetworkStressTestComponent.AutoComponent.xml Source/AutoGen/NetworkPlayerMovementComponent.AutoComponent.xml Source/AutoGen/NetworkTestSpawnerComponent.AutoComponent.xml - Source/AutoGen/NetworkTestComponent.AutoComponent.xml + Source/AutoGen/NetworkRandomImpulseComponent.AutoComponent.xml Source/Components/ExampleFilteredEntityComponent.h Source/Components/ExampleFilteredEntityComponent.cpp Source/Components/NetworkAiComponent.cpp @@ -36,8 +36,8 @@ set(FILES Source/Components/NetworkSimplePlayerCameraComponent.h Source/Components/PerfTest/NetworkPrefabSpawnerComponent.cpp Source/Components/PerfTest/NetworkPrefabSpawnerComponent.h - Source/Components/PerfTest/NetworkTestComponent.cpp - Source/Components/PerfTest/NetworkTestComponent.h + Source/Components/PerfTest/NetworkRandomImpulseComponent.cpp + Source/Components/PerfTest/NetworkRandomImpulseComponent.h Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp Source/Components/PerfTest/NetworkTestSpawnerComponent.h Source/Components/NetworkStressTestComponent.cpp From 8f3e910e4389602b29aa2ed268a6a9cc224583d5 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Thu, 3 Feb 2022 12:16:02 -0500 Subject: [PATCH 34/71] Updated prefabs Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Prefabs/Test_Net_Object.prefab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Prefabs/Test_Net_Object.prefab b/Prefabs/Test_Net_Object.prefab index b347f8394..28a6e52c8 100644 --- a/Prefabs/Test_Net_Object.prefab +++ b/Prefabs/Test_Net_Object.prefab @@ -144,7 +144,7 @@ "$type": "GenericComponentWrapper", "Id": 2176242692874007681, "m_template": { - "$type": "MultiplayerSample::NetworkTestComponent", + "$type": "MultiplayerSample::NetworkRandomImpulseComponent", "EnableHopping": true, "HopPeriod": 4.0, "HopForce": 10000.0 From 44ac76669a96c80a70b830fc720861ab51a1ad08 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Wed, 9 Feb 2022 12:50:18 -0800 Subject: [PATCH 35/71] Addressing various issues causing shot desyncs Signed-off-by: puvvadar --- .../NetworkWeaponsComponent.AutoComponent.xml | 1 + .../Components/NetworkWeaponsComponent.cpp | 35 ++++++++++--------- Gem/Code/Source/Weapons/SceneQuery.cpp | 6 ++-- Gem/Code/Source/Weapons/WeaponGathers.cpp | 8 ++--- Gem/Code/Source/Weapons/WeaponTypes.h | 3 +- 5 files changed, 29 insertions(+), 24 deletions(-) diff --git a/Gem/Code/Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml index 2015eb0ef..8128fe077 100644 --- a/Gem/Code/Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml @@ -16,6 +16,7 @@ + diff --git a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp index aa2ed47d2..80632679b 100644 --- a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp +++ b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp @@ -91,24 +91,10 @@ namespace MultiplayerSample void NetworkWeaponsComponent::ActivateWeaponWithParams(WeaponIndex weaponIndex, WeaponState& weaponState, const FireParams& fireParams, bool validateActivations) { - const uint32_t weaponIndexInt = aznumeric_cast(weaponIndex); - - // Temp hack for weapon firing due to late ebus binding in 1.14 - if (m_fireBoneJointIds[weaponIndexInt] == InvalidBoneId) - { - const char* fireBoneName = GetFireBoneNames(weaponIndexInt).c_str(); - m_fireBoneJointIds[weaponIndexInt] = GetNetworkAnimationComponent()->GetBoneIdByName(fireBoneName); - } - - AZ::Transform fireBoneTransform; - if (!GetNetworkAnimationComponent()->GetJointTransformById(m_fireBoneJointIds[weaponIndexInt], fireBoneTransform)) - { - AZLOG_WARN("Failed to get transform for fire bone %s, joint Id %u", GetFireBoneNames(weaponIndexInt).c_str(), m_fireBoneJointIds[weaponIndexInt]); - } - - const AZ::Vector3 position = fireBoneTransform.GetTranslation(); + const AZ::Vector3 position = fireParams.m_sourcePosition; const AZ::Quaternion orientation = AZ::Quaternion::CreateShortestArc(AZ::Vector3::CreateAxisX(), (fireParams.m_targetPosition - position).GetNormalized()); const AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation(orientation, position); + ActivateEvent activateEvent{ transform, fireParams.m_targetPosition, GetNetEntityId(), Multiplayer::InvalidNetEntityId }; IWeapon* weapon = GetWeapon(weaponIndex); @@ -335,6 +321,21 @@ namespace MultiplayerSample weaponInput->m_draw = m_weaponDrawn; weaponInput->m_firing = m_weaponFiring; + + uint32_t weaponIndexInt = 0; + if (weaponInput->m_firing.GetBit(weaponIndexInt)) + { + // Temp hack for weapon firing due to late ebus binding in 1.14 + const char* fireBoneName = GetFireBoneNames(weaponIndexInt).c_str(); + int32_t boneIdx = GetNetworkAnimationComponentController()->GetParent().GetBoneIdByName(fireBoneName); + + AZ::Transform fireBoneTransform; + if (!GetNetworkAnimationComponentController()->GetParent().GetJointTransformById(boneIdx, fireBoneTransform)) + { + AZLOG_WARN("Failed to get transform for fire bone joint Id %u", boneIdx); + } + weaponInput->m_fireTranslation = fireBoneTransform.GetTranslation(); + } } void NetworkWeaponsComponentController::ProcessInput(Multiplayer::NetworkInput& input, [[maybe_unused]] float deltaTime) @@ -362,7 +363,7 @@ namespace MultiplayerSample // TODO: This should probably be a physx raycast out to some maxDistance const AZ::Vector3 fwd = AZ::Vector3::CreateAxisY(); const AZ::Vector3 aimTarget = worldTm.GetTranslation() + aimRotation.TransformVector(fwd * 5.0f); - FireParams fireParams{ aimTarget, Multiplayer::InvalidNetEntityId }; + FireParams fireParams{ aimTarget, weaponInput->m_fireTranslation, Multiplayer::InvalidNetEntityId }; TryStartFire(aznumeric_cast(weaponIndexInt), fireParams); } } diff --git a/Gem/Code/Source/Weapons/SceneQuery.cpp b/Gem/Code/Source/Weapons/SceneQuery.cpp index 62d9c2ac0..0a1a6d9dc 100644 --- a/Gem/Code/Source/Weapons/SceneQuery.cpp +++ b/Gem/Code/Source/Weapons/SceneQuery.cpp @@ -13,6 +13,7 @@ #include #include #include +#include namespace MultiplayerSample { @@ -79,8 +80,9 @@ namespace MultiplayerSample auto ignoreEntitiesFilterCallback = [&filter, networkEntityManager](const AzPhysics::SimulatedBody* body, [[maybe_unused]] const Physics::Shape* shape) { - // Exclude the bodies from another rewind frame - if ((filter.m_rewindFrameId != Multiplayer::InvalidHostFrameId) + // Exclude the dynamic bodies from another rewind frame + if (filter.m_rewindFrameId != Multiplayer::InvalidHostFrameId + && body->GetNativeType() != PhysX::NativeTypeIdentifiers::RigidBodyStatic && (body->GetFrameId() != static_cast(filter.m_rewindFrameId))) { return AzPhysics::SceneQuery::QueryHitType::None; diff --git a/Gem/Code/Source/Weapons/WeaponGathers.cpp b/Gem/Code/Source/Weapons/WeaponGathers.cpp index 6c816015c..767dee4d5 100644 --- a/Gem/Code/Source/Weapons/WeaponGathers.cpp +++ b/Gem/Code/Source/Weapons/WeaponGathers.cpp @@ -109,14 +109,14 @@ namespace MultiplayerSample float currSegmentStartTime = inOutActiveShot.m_lifetimeSeconds; AZ::Vector3 currSegmentPosition = inOutActiveShot.m_initialTransform.GetTranslation() + (segmentStepOffset * currSegmentStartTime) + (gravity * 0.5f * currSegmentStartTime * currSegmentStartTime); + const AZ::Transform currSegTransform = AZ::Transform::CreateFromQuaternionAndTranslation(inOutActiveShot.m_initialTransform.GetRotation(), currSegmentPosition); + for (uint32_t segment = 0; segment < bg_MultitraceNumTraceSegments; ++segment) { float nextSegmentStartTime = currSegmentStartTime + segmentTickSize; AZ::Vector3 travelDistance = (segmentStepOffset * nextSegmentStartTime); // Total distance our shot has traveled as of this cast, ignoring arc-length due to gravity - AZ::Vector3 nextSegmentPosition = inOutActiveShot.m_initialTransform.GetTranslation() + travelDistance + (gravity * 0.5f * nextSegmentStartTime * nextSegmentStartTime); - - const AZ::Transform currSegTransform = AZ::Transform::CreateFromQuaternionAndTranslation(inOutActiveShot.m_initialTransform.GetRotation(), currSegmentPosition); - const AZ::Vector3 segSweep = nextSegmentPosition - currSegmentPosition; + AZ::Vector3 nextSegmentPosition = inOutActiveShot.m_initialTransform.GetTranslation() + travelDistance + (gravity * 0.5f * nextSegmentStartTime * nextSegmentStartTime); + const AZ::Vector3 segSweep = nextSegmentPosition - currSegmentPosition; IntersectFilter filter(currSegTransform, segSweep, AzPhysics::SceneQuery::QueryType::StaticAndDynamic, hitMultiple, collisionGroup, filteredNetEntityIds, gatherParams.GetCurrentShapeConfiguration()); diff --git a/Gem/Code/Source/Weapons/WeaponTypes.h b/Gem/Code/Source/Weapons/WeaponTypes.h index 022e598e8..a31d503b1 100644 --- a/Gem/Code/Source/Weapons/WeaponTypes.h +++ b/Gem/Code/Source/Weapons/WeaponTypes.h @@ -205,7 +205,8 @@ namespace MultiplayerSample //! Structure containing details for a single fire event. struct FireParams { - AZ::Vector3 m_targetPosition = AZ::Vector3::CreateZero(); // Location of the activate event. + AZ::Vector3 m_sourcePosition = AZ::Vector3::CreateZero(); // Source location of the activate event + AZ::Vector3 m_targetPosition = AZ::Vector3::CreateZero(); // Target location of the activate event. Multiplayer::NetEntityId m_targetId = Multiplayer::InvalidNetEntityId; // Entity Id of the target (for homing weapons) bool operator!=(const FireParams& rhs) const; From 9f7fc241355f94e3b5eb1f3d8c421c8ab0628d67 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Wed, 9 Feb 2022 14:59:51 -0800 Subject: [PATCH 36/71] Undo incorrect change in WeaponGathers Signed-off-by: puvvadar --- Gem/Code/Source/Weapons/WeaponGathers.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gem/Code/Source/Weapons/WeaponGathers.cpp b/Gem/Code/Source/Weapons/WeaponGathers.cpp index 767dee4d5..c98273f40 100644 --- a/Gem/Code/Source/Weapons/WeaponGathers.cpp +++ b/Gem/Code/Source/Weapons/WeaponGathers.cpp @@ -109,13 +109,14 @@ namespace MultiplayerSample float currSegmentStartTime = inOutActiveShot.m_lifetimeSeconds; AZ::Vector3 currSegmentPosition = inOutActiveShot.m_initialTransform.GetTranslation() + (segmentStepOffset * currSegmentStartTime) + (gravity * 0.5f * currSegmentStartTime * currSegmentStartTime); - const AZ::Transform currSegTransform = AZ::Transform::CreateFromQuaternionAndTranslation(inOutActiveShot.m_initialTransform.GetRotation(), currSegmentPosition); for (uint32_t segment = 0; segment < bg_MultitraceNumTraceSegments; ++segment) { float nextSegmentStartTime = currSegmentStartTime + segmentTickSize; AZ::Vector3 travelDistance = (segmentStepOffset * nextSegmentStartTime); // Total distance our shot has traveled as of this cast, ignoring arc-length due to gravity AZ::Vector3 nextSegmentPosition = inOutActiveShot.m_initialTransform.GetTranslation() + travelDistance + (gravity * 0.5f * nextSegmentStartTime * nextSegmentStartTime); + + const AZ::Transform currSegTransform = AZ::Transform::CreateFromQuaternionAndTranslation(inOutActiveShot.m_initialTransform.GetRotation(), currSegmentPosition); const AZ::Vector3 segSweep = nextSegmentPosition - currSegmentPosition; IntersectFilter filter(currSegTransform, segSweep, AzPhysics::SceneQuery::QueryType::StaticAndDynamic, From 65e3ffe36bce13f6ef1d1cad63b911011685ea5c Mon Sep 17 00:00:00 2001 From: puvvadar Date: Wed, 9 Feb 2022 15:02:00 -0800 Subject: [PATCH 37/71] Fix whitespacing issues Signed-off-by: puvvadar --- Gem/Code/Source/Weapons/WeaponGathers.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Gem/Code/Source/Weapons/WeaponGathers.cpp b/Gem/Code/Source/Weapons/WeaponGathers.cpp index c98273f40..ea02e337d 100644 --- a/Gem/Code/Source/Weapons/WeaponGathers.cpp +++ b/Gem/Code/Source/Weapons/WeaponGathers.cpp @@ -109,12 +109,11 @@ namespace MultiplayerSample float currSegmentStartTime = inOutActiveShot.m_lifetimeSeconds; AZ::Vector3 currSegmentPosition = inOutActiveShot.m_initialTransform.GetTranslation() + (segmentStepOffset * currSegmentStartTime) + (gravity * 0.5f * currSegmentStartTime * currSegmentStartTime); - for (uint32_t segment = 0; segment < bg_MultitraceNumTraceSegments; ++segment) { float nextSegmentStartTime = currSegmentStartTime + segmentTickSize; AZ::Vector3 travelDistance = (segmentStepOffset * nextSegmentStartTime); // Total distance our shot has traveled as of this cast, ignoring arc-length due to gravity - AZ::Vector3 nextSegmentPosition = inOutActiveShot.m_initialTransform.GetTranslation() + travelDistance + (gravity * 0.5f * nextSegmentStartTime * nextSegmentStartTime); + AZ::Vector3 nextSegmentPosition = inOutActiveShot.m_initialTransform.GetTranslation() + travelDistance + (gravity * 0.5f * nextSegmentStartTime * nextSegmentStartTime); const AZ::Transform currSegTransform = AZ::Transform::CreateFromQuaternionAndTranslation(inOutActiveShot.m_initialTransform.GetRotation(), currSegmentPosition); const AZ::Vector3 segSweep = nextSegmentPosition - currSegmentPosition; From 9ba607111564627ec97e701b913c1e2e4eac2179 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Wed, 9 Feb 2022 17:37:48 -0800 Subject: [PATCH 38/71] Correct reversed firing logic Signed-off-by: puvvadar --- Gem/Code/Source/Components/NetworkWeaponsComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp index 80632679b..29ffff2ca 100644 --- a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp +++ b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp @@ -363,7 +363,7 @@ namespace MultiplayerSample // TODO: This should probably be a physx raycast out to some maxDistance const AZ::Vector3 fwd = AZ::Vector3::CreateAxisY(); const AZ::Vector3 aimTarget = worldTm.GetTranslation() + aimRotation.TransformVector(fwd * 5.0f); - FireParams fireParams{ aimTarget, weaponInput->m_fireTranslation, Multiplayer::InvalidNetEntityId }; + FireParams fireParams{ weaponInput->m_fireTranslation, aimTarget, Multiplayer::InvalidNetEntityId }; TryStartFire(aznumeric_cast(weaponIndexInt), fireParams); } } From a886f91e4106a94f1980acdffc3a327ce610d325 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Thu, 10 Feb 2022 14:13:51 -0800 Subject: [PATCH 39/71] Add more informative debug shot arc coloring Signed-off-by: puvvadar --- Gem/Code/Source/Weapons/WeaponGathers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gem/Code/Source/Weapons/WeaponGathers.cpp b/Gem/Code/Source/Weapons/WeaponGathers.cpp index ea02e337d..9b47b386c 100644 --- a/Gem/Code/Source/Weapons/WeaponGathers.cpp +++ b/Gem/Code/Source/Weapons/WeaponGathers.cpp @@ -129,7 +129,7 @@ namespace MultiplayerSample &DebugDraw::DebugDrawRequests::DrawLineLocationToLocation, currSegmentPosition, nextSegmentPosition, - AZ::Colors::Red, + segment % 2 == 0 ? AZ::Colors::Red : AZ::Colors::Yellow, 10.0f ); } From ae35f7e03f9763b5d5b7fab3cee3e99643f65be3 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Thu, 10 Feb 2022 16:26:34 -0800 Subject: [PATCH 40/71] Add shot origin clamp Signed-off-by: puvvadar --- .../NetworkWeaponsComponent.AutoComponent.xml | 2 +- .../Source/Components/NetworkWeaponsComponent.cpp | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Gem/Code/Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml index 8128fe077..dedcc582c 100644 --- a/Gem/Code/Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml @@ -16,7 +16,7 @@ - + diff --git a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp index 29ffff2ca..04b9fc3a7 100644 --- a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp +++ b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp @@ -322,6 +322,7 @@ namespace MultiplayerSample weaponInput->m_draw = m_weaponDrawn; weaponInput->m_firing = m_weaponFiring; + // All weapon indices point to the same bone so only send one instance uint32_t weaponIndexInt = 0; if (weaponInput->m_firing.GetBit(weaponIndexInt)) { @@ -334,7 +335,7 @@ namespace MultiplayerSample { AZLOG_WARN("Failed to get transform for fire bone joint Id %u", boneIdx); } - weaponInput->m_fireTranslation = fireBoneTransform.GetTranslation(); + weaponInput->m_shotStartPosition = fireBoneTransform.GetTranslation(); } } @@ -363,7 +364,17 @@ namespace MultiplayerSample // TODO: This should probably be a physx raycast out to some maxDistance const AZ::Vector3 fwd = AZ::Vector3::CreateAxisY(); const AZ::Vector3 aimTarget = worldTm.GetTranslation() + aimRotation.TransformVector(fwd * 5.0f); - FireParams fireParams{ weaponInput->m_fireTranslation, aimTarget, Multiplayer::InvalidNetEntityId }; + AZ::Vector3 aimSource = weaponInput->m_shotStartPosition; + const float startPositionClampRange = 2.f; + AZ::Vector3 sourcePosDelta = (aimSource - worldTm.GetTranslation()); + if (sourcePosDelta.GetLength() > startPositionClampRange) + { + // Clamp the proposed source position to our tolerance + sourcePosDelta.Normalize(); + aimSource = worldTm.GetTranslation() + (sourcePosDelta * startPositionClampRange); + AZLOG_WARN("Shot origin was outside of clamp range, clamping to range extent"); + } + FireParams fireParams{ weaponInput->m_shotStartPosition, aimTarget, Multiplayer::InvalidNetEntityId }; TryStartFire(aznumeric_cast(weaponIndexInt), fireParams); } } From 479e53f0622ef1674e7d4782e8a5ae2b8899232f Mon Sep 17 00:00:00 2001 From: puvvadar Date: Thu, 10 Feb 2022 16:35:45 -0800 Subject: [PATCH 41/71] Base clamp off network bone position Signed-off-by: puvvadar --- .../Components/NetworkWeaponsComponent.cpp | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp index 04b9fc3a7..e74f920a8 100644 --- a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp +++ b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp @@ -326,7 +326,6 @@ namespace MultiplayerSample uint32_t weaponIndexInt = 0; if (weaponInput->m_firing.GetBit(weaponIndexInt)) { - // Temp hack for weapon firing due to late ebus binding in 1.14 const char* fireBoneName = GetFireBoneNames(weaponIndexInt).c_str(); int32_t boneIdx = GetNetworkAnimationComponentController()->GetParent().GetBoneIdByName(fireBoneName); @@ -365,14 +364,22 @@ namespace MultiplayerSample const AZ::Vector3 fwd = AZ::Vector3::CreateAxisY(); const AZ::Vector3 aimTarget = worldTm.GetTranslation() + aimRotation.TransformVector(fwd * 5.0f); AZ::Vector3 aimSource = weaponInput->m_shotStartPosition; - const float startPositionClampRange = 2.f; - AZ::Vector3 sourcePosDelta = (aimSource - worldTm.GetTranslation()); - if (sourcePosDelta.GetLength() > startPositionClampRange) + + const char* fireBoneName = GetFireBoneNames(weaponIndexInt).c_str(); + int32_t boneIdx = GetNetworkAnimationComponentController()->GetParent().GetBoneIdByName(fireBoneName); + + AZ::Transform fireBoneTransform; + if (!GetNetworkAnimationComponentController()->GetParent().GetJointTransformById(boneIdx, fireBoneTransform)) { - // Clamp the proposed source position to our tolerance - sourcePosDelta.Normalize(); - aimSource = worldTm.GetTranslation() + (sourcePosDelta * startPositionClampRange); - AZLOG_WARN("Shot origin was outside of clamp range, clamping to range extent"); + AZLOG_WARN("Failed to get transform for fire bone joint Id %u", boneIdx); + } + + // Validate the proposed start position is reasonably close to the related bone + float startPositionClampRange = .5f; + if ((fireBoneTransform.GetTranslation() - aimSource).GetLength() > startPositionClampRange) + { + aimSource = fireBoneTransform.GetTranslation(); + AZLOG_WARN("Shot origin was outside of clamp range, resetting to bone position"); } FireParams fireParams{ weaponInput->m_shotStartPosition, aimTarget, Multiplayer::InvalidNetEntityId }; TryStartFire(aznumeric_cast(weaponIndexInt), fireParams); From b203f26165463eb9ab6efd98106a183f87ad4579 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Fri, 11 Feb 2022 09:14:50 -0800 Subject: [PATCH 42/71] Switch to higher tolerance physics check during rewind filtering Signed-off-by: puvvadar --- Gem/Code/Source/Weapons/SceneQuery.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gem/Code/Source/Weapons/SceneQuery.cpp b/Gem/Code/Source/Weapons/SceneQuery.cpp index 0a1a6d9dc..b774141dd 100644 --- a/Gem/Code/Source/Weapons/SceneQuery.cpp +++ b/Gem/Code/Source/Weapons/SceneQuery.cpp @@ -80,9 +80,9 @@ namespace MultiplayerSample auto ignoreEntitiesFilterCallback = [&filter, networkEntityManager](const AzPhysics::SimulatedBody* body, [[maybe_unused]] const Physics::Shape* shape) { - // Exclude the dynamic bodies from another rewind frame - if (filter.m_rewindFrameId != Multiplayer::InvalidHostFrameId - && body->GetNativeType() != PhysX::NativeTypeIdentifiers::RigidBodyStatic + // Exclude bodies from another rewind frame + if (filter.m_rewindFrameId != Multiplayer::InvalidHostFrameId + && (body->GetFrameId() != AzPhysics::SimulatedBody::UndefinedFrameId) && (body->GetFrameId() != static_cast(filter.m_rewindFrameId))) { return AzPhysics::SceneQuery::QueryHitType::None; From 49f4b6f20b3b78920683469ca168d9ed8f454c94 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Mon, 14 Feb 2022 10:01:47 -0600 Subject: [PATCH 43/71] Adds console-command-file to VS debugger args Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Gem/Code/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gem/Code/CMakeLists.txt b/Gem/Code/CMakeLists.txt index 1d12725fc..669095899 100644 --- a/Gem/Code/CMakeLists.txt +++ b/Gem/Code/CMakeLists.txt @@ -77,3 +77,6 @@ ly_enable_gems(PROJECT_NAME MultiplayerSample GEM_FILE enabled_gems.cmake) if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) set_property(GLOBAL APPEND PROPERTY LY_LAUNCHER_SERVER_PROJECTS MultiplayerSample) endif() + +set_property(GLOBAL APPEND PROPERTY MultiplayerSample_GAMELAUNCHER_ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS "--console-command-file=\"client.cfg\"") +set_property(GLOBAL APPEND PROPERTY MultiplayerSample_SERVERLAUNCHER_ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS "--console-command-file=\"server.cfg\"") From 35f26b54c0f95dca40fff1131c1984130de514e5 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Mon, 14 Feb 2022 10:28:16 -0600 Subject: [PATCH 44/71] Refactored to use target instead of global property Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Gem/Code/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gem/Code/CMakeLists.txt b/Gem/Code/CMakeLists.txt index 669095899..e2a470299 100644 --- a/Gem/Code/CMakeLists.txt +++ b/Gem/Code/CMakeLists.txt @@ -78,5 +78,5 @@ if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) set_property(GLOBAL APPEND PROPERTY LY_LAUNCHER_SERVER_PROJECTS MultiplayerSample) endif() -set_property(GLOBAL APPEND PROPERTY MultiplayerSample_GAMELAUNCHER_ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS "--console-command-file=\"client.cfg\"") -set_property(GLOBAL APPEND PROPERTY MultiplayerSample_SERVERLAUNCHER_ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS "--console-command-file=\"server.cfg\"") +set_property(TARGET MultiplayerSample APPEND PROPERTY GAMELAUNCHER_ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS "--console-command-file=\"client.cfg\"") +set_property(TARGET MultiplayerSample APPEND PROPERTY SERVERLAUNCHER_ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS "--console-command-file=\"server.cfg\"") From 9509716505e6945a870a389564c001259b7b38d6 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Wed, 16 Feb 2022 10:03:35 -0800 Subject: [PATCH 45/71] Fix merge conflicts in mps_spawn_interface branch Signed-off-by: puvvadar --- Gem/Code/Source/Components/NetworkWeaponsComponent.cpp | 2 +- Gem/Code/Source/MultiplayerSampleSystemComponent.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp index e74f920a8..6e8d2a4be 100644 --- a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp +++ b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp @@ -375,7 +375,7 @@ namespace MultiplayerSample } // Validate the proposed start position is reasonably close to the related bone - float startPositionClampRange = .5f; + float startPositionClampRange = 1.f; if ((fireBoneTransform.GetTranslation() - aimSource).GetLength() > startPositionClampRange) { aimSource = fireBoneTransform.GetTranslation(); diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index 6354dad9e..c841d3e07 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include From b7d90f249125d9f6f7951cd4497be7e054342ba7 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Wed, 16 Feb 2022 13:15:22 -0800 Subject: [PATCH 46/71] Switch player spawner to Asset vs Asset Path Signed-off-by: puvvadar --- ...rkPlayerSpawnerComponent.AutoComponent.xml | 5 +- .../MultiplayerSampleSystemComponent.cpp | 3 - .../Source/Spawners/RoundRobinSpawner.cpp | 5 +- Levels/SampleBase/SampleBase.prefab | 314 +++++++++++++++++- 4 files changed, 317 insertions(+), 10 deletions(-) diff --git a/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml index adf5ccc91..b9c9e1512 100644 --- a/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml @@ -8,8 +8,11 @@ OverrideInclude="Source/Components/NetworkPlayerSpawnerComponent.h" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + + - + diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index c841d3e07..e2c7d4018 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -27,9 +27,6 @@ namespace MultiplayerSample { using namespace AzNetworking; - AZ_CVAR(AZ::CVarFixedString, sv_playerSpawnAsset, "prefabs/player.network.spawnable", nullptr, AZ::ConsoleFunctorFlags::DontReplicate, - "The spawnable to use when a new player connects"); - void MultiplayerSampleSystemComponent::Reflect(AZ::ReflectContext* context) { ReflectWeaponEnums(context); diff --git a/Gem/Code/Source/Spawners/RoundRobinSpawner.cpp b/Gem/Code/Source/Spawners/RoundRobinSpawner.cpp index 48bd55cee..fc457aea1 100644 --- a/Gem/Code/Source/Spawners/RoundRobinSpawner.cpp +++ b/Gem/Code/Source/Spawners/RoundRobinSpawner.cpp @@ -32,9 +32,8 @@ namespace MultiplayerSample NetworkPlayerSpawnerComponent* spawner = m_spawners[m_spawnIndex]; m_spawnIndex = m_spawnIndex + 1 == m_spawners.size() ? 0 : m_spawnIndex + 1; - AZStd::string assetPath = spawner->GetAssetPath(); - AZStd::to_lower(assetPath.begin(), assetPath.end()); - Multiplayer::PrefabEntityId prefabEntityId(AZ::Name(assetPath.c_str())); + // NetworkEntityManager currently operates against/validates AssetId or Path, opt for Path via Hint + Multiplayer::PrefabEntityId prefabEntityId(AZ::Name(spawner->GetSpawnableAsset().GetHint().c_str())); return AZStd::make_pair( prefabEntityId, spawner->GetEntity()->GetTransform()->GetWorldTM()); diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index 4bd960be3..ef4ed56e6 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -63,7 +63,11 @@ "Entity_[611359903594]", "Entity_[412839637138]", "Entity_[1863191303392]", - "Entity_[14030996048227]" + "Entity_[14030996048227]", + "Entity_[5919988826203]", + "Entity_[5924283793499]", + "Entity_[5997298237531]", + "Entity_[6070312681563]" ] } } @@ -163,7 +167,7 @@ "runtimeDataIsValid": true, "sourceHandle": { "id": "{B605AD71-0689-5650-B3F5-558D471B6351}", - "path": "scriptcanvas/spawnifauthority.scriptcanvas" + "path": "C:/Git/Spectra/o3de/MultiplayerSample/scriptcanvas/SpawnIfAuthority.scriptcanvas" } }, "Component_[15194128185768259769]": { @@ -331,6 +335,310 @@ } } }, + "Entity_[5919988826203]": { + "Id": "Entity_[5919988826203]", + "Name": "Spawer", + "Components": { + "Component_[10170158418943462909]": { + "$type": "GenericComponentWrapper", + "Id": 10170158418943462909, + "m_template": { + "$type": "MultiplayerSample::NetworkPlayerSpawnerComponent", + "SnapToGround": true, + "SpawnableAsset": { + "assetId": { + "guid": "{13BAFCBF-6669-5E4E-B3B0-8610349B2C01}", + "subId": 738868766 + }, + "assetHint": "prefabs/player.network.spawnable" + } + } + }, + "Component_[12821202692257528540]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12821202692257528540 + }, + "Component_[14597378810391071687]": { + "$type": "EditorLockComponent", + "Id": 14597378810391071687 + }, + "Component_[16396226858949964701]": { + "$type": "EditorVisibilityComponent", + "Id": 16396226858949964701 + }, + "Component_[17457334425592723879]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17457334425592723879, + "Parent Entity": "Entity_[356758116574]", + "Transform Data": { + "Translate": [ + 0.0, + -10.0, + 0.0 + ] + } + }, + "Component_[18034126654383632242]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18034126654383632242 + }, + "Component_[2447566750412767001]": { + "$type": "GenericComponentWrapper", + "Id": 2447566750412767001, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[2794843823854361819]": { + "$type": "EditorEntitySortComponent", + "Id": 2794843823854361819 + }, + "Component_[3595403615987753683]": { + "$type": "SelectionComponent", + "Id": 3595403615987753683 + }, + "Component_[6068793232317605117]": { + "$type": "EditorEntityIconComponent", + "Id": 6068793232317605117 + }, + "Component_[6441649010823970020]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6441649010823970020 + }, + "Component_[720388358424552920]": { + "$type": "EditorInspectorComponent", + "Id": 720388358424552920 + } + } + }, + "Entity_[5924283793499]": { + "Id": "Entity_[5924283793499]", + "Name": "Spawer", + "Components": { + "Component_[10170158418943462909]": { + "$type": "GenericComponentWrapper", + "Id": 10170158418943462909, + "m_template": { + "$type": "MultiplayerSample::NetworkPlayerSpawnerComponent", + "SnapToGround": true, + "SpawnableAsset": { + "assetId": { + "guid": "{13BAFCBF-6669-5E4E-B3B0-8610349B2C01}", + "subId": 738868766 + }, + "assetHint": "prefabs/player.network.spawnable" + } + } + }, + "Component_[12821202692257528540]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12821202692257528540 + }, + "Component_[14597378810391071687]": { + "$type": "EditorLockComponent", + "Id": 14597378810391071687 + }, + "Component_[16396226858949964701]": { + "$type": "EditorVisibilityComponent", + "Id": 16396226858949964701 + }, + "Component_[17457334425592723879]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17457334425592723879, + "Parent Entity": "Entity_[356758116574]", + "Transform Data": { + "Translate": [ + 10.0, + 0.0, + 0.0 + ] + } + }, + "Component_[18034126654383632242]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18034126654383632242 + }, + "Component_[2447566750412767001]": { + "$type": "GenericComponentWrapper", + "Id": 2447566750412767001, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[2794843823854361819]": { + "$type": "EditorEntitySortComponent", + "Id": 2794843823854361819 + }, + "Component_[3595403615987753683]": { + "$type": "SelectionComponent", + "Id": 3595403615987753683 + }, + "Component_[6068793232317605117]": { + "$type": "EditorEntityIconComponent", + "Id": 6068793232317605117 + }, + "Component_[6441649010823970020]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6441649010823970020 + }, + "Component_[720388358424552920]": { + "$type": "EditorInspectorComponent", + "Id": 720388358424552920 + } + } + }, + "Entity_[5997298237531]": { + "Id": "Entity_[5997298237531]", + "Name": "Spawer", + "Components": { + "Component_[10170158418943462909]": { + "$type": "GenericComponentWrapper", + "Id": 10170158418943462909, + "m_template": { + "$type": "MultiplayerSample::NetworkPlayerSpawnerComponent", + "SnapToGround": true, + "SpawnableAsset": { + "assetId": { + "guid": "{13BAFCBF-6669-5E4E-B3B0-8610349B2C01}", + "subId": 738868766 + }, + "assetHint": "prefabs/player.network.spawnable" + } + } + }, + "Component_[12821202692257528540]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12821202692257528540 + }, + "Component_[14597378810391071687]": { + "$type": "EditorLockComponent", + "Id": 14597378810391071687 + }, + "Component_[16396226858949964701]": { + "$type": "EditorVisibilityComponent", + "Id": 16396226858949964701 + }, + "Component_[17457334425592723879]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17457334425592723879, + "Parent Entity": "Entity_[356758116574]", + "Transform Data": { + "Translate": [ + 0.0, + 10.0, + 0.0 + ] + } + }, + "Component_[18034126654383632242]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18034126654383632242 + }, + "Component_[2447566750412767001]": { + "$type": "GenericComponentWrapper", + "Id": 2447566750412767001, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[2794843823854361819]": { + "$type": "EditorEntitySortComponent", + "Id": 2794843823854361819 + }, + "Component_[3595403615987753683]": { + "$type": "SelectionComponent", + "Id": 3595403615987753683 + }, + "Component_[6068793232317605117]": { + "$type": "EditorEntityIconComponent", + "Id": 6068793232317605117 + }, + "Component_[6441649010823970020]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6441649010823970020 + }, + "Component_[720388358424552920]": { + "$type": "EditorInspectorComponent", + "Id": 720388358424552920 + } + } + }, + "Entity_[6070312681563]": { + "Id": "Entity_[6070312681563]", + "Name": "Spawer", + "Components": { + "Component_[10170158418943462909]": { + "$type": "GenericComponentWrapper", + "Id": 10170158418943462909, + "m_template": { + "$type": "MultiplayerSample::NetworkPlayerSpawnerComponent", + "SnapToGround": true, + "SpawnableAsset": { + "assetId": { + "guid": "{13BAFCBF-6669-5E4E-B3B0-8610349B2C01}", + "subId": 738868766 + }, + "assetHint": "prefabs/player.network.spawnable" + } + } + }, + "Component_[12821202692257528540]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12821202692257528540 + }, + "Component_[14597378810391071687]": { + "$type": "EditorLockComponent", + "Id": 14597378810391071687 + }, + "Component_[16396226858949964701]": { + "$type": "EditorVisibilityComponent", + "Id": 16396226858949964701 + }, + "Component_[17457334425592723879]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17457334425592723879, + "Parent Entity": "Entity_[356758116574]", + "Transform Data": { + "Translate": [ + -10.0, + 0.0, + 0.0 + ] + } + }, + "Component_[18034126654383632242]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18034126654383632242 + }, + "Component_[2447566750412767001]": { + "$type": "GenericComponentWrapper", + "Id": 2447566750412767001, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[2794843823854361819]": { + "$type": "EditorEntitySortComponent", + "Id": 2794843823854361819 + }, + "Component_[3595403615987753683]": { + "$type": "SelectionComponent", + "Id": 3595403615987753683 + }, + "Component_[6068793232317605117]": { + "$type": "EditorEntityIconComponent", + "Id": 6068793232317605117 + }, + "Component_[6441649010823970020]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6441649010823970020 + }, + "Component_[720388358424552920]": { + "$type": "EditorInspectorComponent", + "Id": 720388358424552920 + } + } + }, "Entity_[611359903594]": { "Id": "Entity_[611359903594]", "Name": "Sky", @@ -492,7 +800,7 @@ "Id": 7092071161962745685, "Controller": { "Configuration": { - "EditorEntityId": 4798108558725889184 + "EditorEntityId": 15187897994861804639 } } }, From 9397e63e61a5b3f710c8f2e3aa268075dbef1a18 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Wed, 16 Feb 2022 15:14:22 -0800 Subject: [PATCH 47/71] Cleanup NetworkPlayerSpawnerComponent Signed-off-by: puvvadar --- Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h b/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h index 25d3dde08..fc4c2b94a 100644 --- a/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h +++ b/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h @@ -18,9 +18,9 @@ namespace MultiplayerSample { public: AZ_MULTIPLAYER_COMPONENT( - MultiplayerSample::NetworkPlayerSpawnerComponent, + NetworkPlayerSpawnerComponent, s_networkPlayerSpawnerComponentConcreteUuid, - MultiplayerSample::NetworkPlayerSpawnerComponentBase); + NetworkPlayerSpawnerComponentBase); static void Reflect(AZ::ReflectContext* context); From 67230de4c5f242fab96fb97ada5d088a3131dc82 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Tue, 22 Feb 2022 11:24:04 -0800 Subject: [PATCH 48/71] Resave SampleBase due to format issues around spawners Signed-off-by: puvvadar --- Levels/SampleBase/SampleBase.prefab | 88 ++++++++++++++--------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index ef4ed56e6..092c8b6c7 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -337,13 +337,21 @@ }, "Entity_[5919988826203]": { "Id": "Entity_[5919988826203]", - "Name": "Spawer", + "Name": "Spawner", "Components": { - "Component_[10170158418943462909]": { + "Component_[12821202692257528540]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12821202692257528540 + }, + "Component_[14597378810391071687]": { + "$type": "EditorLockComponent", + "Id": 14597378810391071687 + }, + "Component_[16196520229993883676]": { "$type": "GenericComponentWrapper", - "Id": 10170158418943462909, + "Id": 16196520229993883676, "m_template": { - "$type": "MultiplayerSample::NetworkPlayerSpawnerComponent", + "$type": "NetworkPlayerSpawnerComponent", "SnapToGround": true, "SpawnableAsset": { "assetId": { @@ -354,14 +362,6 @@ } } }, - "Component_[12821202692257528540]": { - "$type": "EditorPendingCompositionComponent", - "Id": 12821202692257528540 - }, - "Component_[14597378810391071687]": { - "$type": "EditorLockComponent", - "Id": 14597378810391071687 - }, "Component_[16396226858949964701]": { "$type": "EditorVisibilityComponent", "Id": 16396226858949964701 @@ -413,23 +413,8 @@ }, "Entity_[5924283793499]": { "Id": "Entity_[5924283793499]", - "Name": "Spawer", + "Name": "Spawner", "Components": { - "Component_[10170158418943462909]": { - "$type": "GenericComponentWrapper", - "Id": 10170158418943462909, - "m_template": { - "$type": "MultiplayerSample::NetworkPlayerSpawnerComponent", - "SnapToGround": true, - "SpawnableAsset": { - "assetId": { - "guid": "{13BAFCBF-6669-5E4E-B3B0-8610349B2C01}", - "subId": 738868766 - }, - "assetHint": "prefabs/player.network.spawnable" - } - } - }, "Component_[12821202692257528540]": { "$type": "EditorPendingCompositionComponent", "Id": 12821202692257528540 @@ -477,6 +462,21 @@ "$type": "EditorEntityIconComponent", "Id": 6068793232317605117 }, + "Component_[6416839191484803184]": { + "$type": "GenericComponentWrapper", + "Id": 6416839191484803184, + "m_template": { + "$type": "NetworkPlayerSpawnerComponent", + "SnapToGround": true, + "SpawnableAsset": { + "assetId": { + "guid": "{13BAFCBF-6669-5E4E-B3B0-8610349B2C01}", + "subId": 738868766 + }, + "assetHint": "prefabs/player.network.spawnable" + } + } + }, "Component_[6441649010823970020]": { "$type": "EditorOnlyEntityComponent", "Id": 6441649010823970020 @@ -489,13 +489,13 @@ }, "Entity_[5997298237531]": { "Id": "Entity_[5997298237531]", - "Name": "Spawer", + "Name": "Spawner", "Components": { - "Component_[10170158418943462909]": { + "Component_[10353920187632550272]": { "$type": "GenericComponentWrapper", - "Id": 10170158418943462909, + "Id": 10353920187632550272, "m_template": { - "$type": "MultiplayerSample::NetworkPlayerSpawnerComponent", + "$type": "NetworkPlayerSpawnerComponent", "SnapToGround": true, "SpawnableAsset": { "assetId": { @@ -565,13 +565,21 @@ }, "Entity_[6070312681563]": { "Id": "Entity_[6070312681563]", - "Name": "Spawer", + "Name": "Spawner", "Components": { - "Component_[10170158418943462909]": { + "Component_[12821202692257528540]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12821202692257528540 + }, + "Component_[14597378810391071687]": { + "$type": "EditorLockComponent", + "Id": 14597378810391071687 + }, + "Component_[16310256925382960666]": { "$type": "GenericComponentWrapper", - "Id": 10170158418943462909, + "Id": 16310256925382960666, "m_template": { - "$type": "MultiplayerSample::NetworkPlayerSpawnerComponent", + "$type": "NetworkPlayerSpawnerComponent", "SnapToGround": true, "SpawnableAsset": { "assetId": { @@ -582,14 +590,6 @@ } } }, - "Component_[12821202692257528540]": { - "$type": "EditorPendingCompositionComponent", - "Id": 12821202692257528540 - }, - "Component_[14597378810391071687]": { - "$type": "EditorLockComponent", - "Id": 14597378810391071687 - }, "Component_[16396226858949964701]": { "$type": "EditorVisibilityComponent", "Id": 16396226858949964701 From 459aaefb19df4b001d7b572f5a5560579336a39b Mon Sep 17 00:00:00 2001 From: puvvadar Date: Tue, 22 Feb 2022 14:26:48 -0800 Subject: [PATCH 49/71] Add rotation to spawners Signed-off-by: puvvadar --- Levels/SampleBase/SampleBase.prefab | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index 092c8b6c7..09f612501 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -436,6 +436,11 @@ 10.0, 0.0, 0.0 + ], + "Rotate": [ + 0.0, + 0.0, + 90.0 ] } }, @@ -527,6 +532,11 @@ 0.0, 10.0, 0.0 + ], + "Rotate": [ + 0.0, + 0.0, + 180.0 ] } }, @@ -603,6 +613,11 @@ -10.0, 0.0, 0.0 + ], + "Rotate": [ + 0.0, + 0.0, + 270.0 ] } }, From b04786ba65fbe05e1a3b2e9b652afe1eb37e759f Mon Sep 17 00:00:00 2001 From: puvvadar Date: Tue, 22 Feb 2022 15:54:21 -0800 Subject: [PATCH 50/71] Synchronize simple player camera aim angles Signed-off-by: puvvadar --- .../Source/Components/NetworkSimplePlayerCameraComponent.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp index ddeaa99ff..1d3b46e92 100644 --- a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp +++ b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp @@ -24,6 +24,10 @@ namespace MultiplayerSample void NetworkSimplePlayerCameraComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { + // Synchronize aim angles with initial transform + AZ::Vector3& aimAngles = ModifyAimAngles(); + aimAngles.SetZ(GetEntity()->GetTransform()->GetLocalRotation().GetZ()); + if (IsAutonomous()) { m_aiEnabled = FindComponent()->GetEnabled(); From ea37e96134d3c1bf111a3f9dbbc057d241bafa50 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Tue, 22 Feb 2022 19:30:51 -0500 Subject: [PATCH 51/71] Added a workaround switch in test to avoid issues with deactivating network entities. Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- ...workTestSpawnerComponent.AutoComponent.xml | 1 + .../NetworkRandomImpulseComponent.cpp | 3 +- .../PerfTest/NetworkTestSpawnerComponent.cpp | 69 ++++++++++--------- .../SpawningPerfTest/SpawningPerfTest.prefab | 9 +-- 4 files changed, 46 insertions(+), 36 deletions(-) diff --git a/Gem/Code/Source/AutoGen/NetworkTestSpawnerComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkTestSpawnerComponent.AutoComponent.xml index 9146cc0d5..c39b2fc3f 100644 --- a/Gem/Code/Source/AutoGen/NetworkTestSpawnerComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkTestSpawnerComponent.AutoComponent.xml @@ -12,6 +12,7 @@ + diff --git a/Gem/Code/Source/Components/PerfTest/NetworkRandomImpulseComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkRandomImpulseComponent.cpp index cf2eeddb6..d1d129e7a 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkRandomImpulseComponent.cpp +++ b/Gem/Code/Source/Components/PerfTest/NetworkRandomImpulseComponent.cpp @@ -40,7 +40,8 @@ namespace MultiplayerSample if (PhysX::RigidBodyComponent* body = GetEntity()->FindComponent()) { - body->ApplyLinearImpulse(AZ::Vector3::CreateAxisZ(GetParent().GetHopForce())); + const AZ::Quaternion rotation = GetEntity()->GetTransform()->GetWorldRotationQuaternion(); + body->ApplyLinearImpulse(rotation.TransformVector(AZ::Vector3::CreateAxisZ(GetParent().GetHopForce()))); } } } diff --git a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp index 607d099bc..f56d159a7 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp +++ b/Gem/Code/Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp @@ -26,7 +26,10 @@ namespace MultiplayerSample void NetworkTestSpawnerComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { - m_tickEvent.Enqueue(AZ::TimeMs{ 0 }, true); + if (GetParent().GetNetworkPrefabSpawnerComponent()) + { + m_tickEvent.Enqueue(AZ::TimeMs{ 0 }, true); + } m_currentCount = 0; m_accumulatedTime = 0.f; @@ -46,44 +49,48 @@ namespace MultiplayerSample { m_accumulatedTime = 0.f; - if (NetworkPrefabSpawnerComponent* spawner = GetParent().GetNetworkPrefabSpawnerComponent()) - { - AZ::Vector3 randomPoint = AZ::Vector3::CreateZero(); - // ShapeComponentRequestsBus is designed in such a way that it's very difficult to use direct component interface instead of the EBus - using ShapeBus = LmbrCentral::ShapeComponentRequestsBus; - ShapeBus::EventResult(randomPoint, GetParent().GetEntityId(), &ShapeBus::Events::GenerateRandomPointInside, - AZ::RandomDistributionType::UniformReal); + AZ::Vector3 randomPoint = AZ::Vector3::CreateZero(); + // ShapeComponentRequestsBus is designed in such a way that it's very difficult to use direct component interface instead of the EBus + using ShapeBus = LmbrCentral::ShapeComponentRequestsBus; + ShapeBus::EventResult(randomPoint, GetParent().GetEntityId(), &ShapeBus::Events::GenerateRandomPointInside, + AZ::RandomDistributionType::UniformReal); - AZ::Transform t = GetEntity()->GetTransform()->GetWorldTM(); - if (!randomPoint.IsZero()) - { - t.SetTranslation(randomPoint); + AZ::Transform t = GetEntity()->GetTransform()->GetWorldTM(); + if (!randomPoint.IsZero()) + { + t.SetTranslation(randomPoint); - // Create a random orientation for fun. - float randomAngles[3]; - randomAngles[0] = aznumeric_cast(GetNetworkRandomComponentController()->GetRandomUint64() % 180); - randomAngles[1] = aznumeric_cast(GetNetworkRandomComponentController()->GetRandomUint64() % 180); - randomAngles[2] = aznumeric_cast(GetNetworkRandomComponentController()->GetRandomUint64() % 180); - t.SetRotation(AZ::Quaternion::CreateFromEulerAnglesDegrees(AZ::Vector3::CreateFromFloat3(randomAngles))); - } + // Create a random orientation for fun. + float randomAngles[3]; + randomAngles[0] = aznumeric_cast(GetNetworkRandomComponentController()->GetRandomUint64() % 180); + randomAngles[1] = aznumeric_cast(GetNetworkRandomComponentController()->GetRandomUint64() % 180); + randomAngles[2] = aznumeric_cast(GetNetworkRandomComponentController()->GetRandomUint64() % 180); + t.SetRotation(AZ::Quaternion::CreateFromEulerAnglesDegrees(AZ::Vector3::CreateFromFloat3(randomAngles))); + } - PrefabCallbacks callbacks; - callbacks.m_onActivateCallback = [this]( - AZStd::shared_ptr&& ticket, - [[maybe_unused]] AzFramework::SpawnableConstEntityContainerView view) - { - m_spawnedObjects.push_back(move(ticket)); - }; + PrefabCallbacks callbacks; + callbacks.m_onActivateCallback = [this]( + AZStd::shared_ptr&& ticket, + [[maybe_unused]] AzFramework::SpawnableConstEntityContainerView view) + { + m_spawnedObjects.push_back(move(ticket)); + }; - spawner->SpawnDefaultPrefab(t, callbacks); - } + GetParent().GetNetworkPrefabSpawnerComponent()->SpawnDefaultPrefab(t, callbacks); m_currentCount++; - if (m_currentCount > GetParent().GetMaxLiveCount()) + if (m_currentCount >= GetParent().GetMaxLiveCount()) { - m_spawnedObjects.pop_front(); // this destroys the prefab instance for this ticket - --m_currentCount; + if (GetParent().GetRespawnEnabled()) + { + m_spawnedObjects.pop_front(); // this destroys the prefab instance for this ticket + --m_currentCount; + } + else + { + m_tickEvent.RemoveFromQueue(); + } } } } diff --git a/Levels/SpawningPerfTest/SpawningPerfTest.prefab b/Levels/SpawningPerfTest/SpawningPerfTest.prefab index 22b30638d..a3fda9f0b 100644 --- a/Levels/SpawningPerfTest/SpawningPerfTest.prefab +++ b/Levels/SpawningPerfTest/SpawningPerfTest.prefab @@ -525,8 +525,9 @@ "m_template": { "$type": "MultiplayerSample::NetworkTestSpawnerComponent", "Enabled": true, - "MaxLiveCount": 1000, - "SpawnPerSecond": 10 + "RespawnEnabled": false, + "MaxLiveCount": 20, + "SpawnPerSecond": 5 } }, "Component_[12075594064273029366]": { @@ -602,8 +603,8 @@ "BoxShape": { "Configuration": { "Dimensions": [ - 50.0, - 50.0, + 5.0, + 5.0, 1.0 ] } From 05269bb9050ccf25ab30231aa15ebbbea25c44a1 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Wed, 23 Feb 2022 14:51:19 -0800 Subject: [PATCH 52/71] Add immediate sync flag to Network SImple Player Camera Signed-off-by: puvvadar --- .../Source/Components/NetworkSimplePlayerCameraComponent.cpp | 5 ++++- .../Source/Components/NetworkSimplePlayerCameraComponent.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp index 1d3b46e92..de9526eed 100644 --- a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp +++ b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp @@ -27,6 +27,7 @@ namespace MultiplayerSample // Synchronize aim angles with initial transform AZ::Vector3& aimAngles = ModifyAimAngles(); aimAngles.SetZ(GetEntity()->GetTransform()->GetLocalRotation().GetZ()); + m_syncOrientationImmediate = true; if (IsAutonomous()) { @@ -71,11 +72,13 @@ namespace MultiplayerSample { const AZ::Quaternion targetRotation = AZ::Quaternion::CreateRotationZ(GetCameraYaw()) * AZ::Quaternion::CreateRotationX(GetCameraPitch()); const AZ::Quaternion currentRotation = m_activeCameraEntity->GetTransform()->GetWorldTM().GetRotation(); - const AZ::Quaternion aimRotation = currentRotation.Slerp(targetRotation, cl_cameraBlendSpeed).GetNormalized(); + const AZ::Quaternion aimRotation = m_syncOrientationImmediate ? + targetRotation : currentRotation.Slerp(targetRotation, cl_cameraBlendSpeed).GetNormalized(); const AZ::Vector3 targetTranslation = GetEntity()->GetTransform()->GetWorldTM().GetTranslation(); const AZ::Vector3 cameraOffset = aimRotation.TransformVector(cl_cameraOffset); const AZ::Transform cameraTransform = AZ::Transform::CreateFromQuaternionAndTranslation(aimRotation, targetTranslation + cameraOffset); m_activeCameraEntity->GetTransform()->SetWorldTM(cameraTransform); + m_syncOrientationImmediate = false; } } diff --git a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.h b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.h index a1e885895..42a781e48 100644 --- a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.h +++ b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.h @@ -35,5 +35,6 @@ namespace MultiplayerSample AZ::Entity* m_activeCameraEntity = nullptr; bool m_aiEnabled = false; + bool m_syncOrientationImmediate = false; }; } From 5d64f8337af289dad6b0d6b0ed138cbf6bc4a0e8 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Wed, 23 Feb 2022 14:55:29 -0800 Subject: [PATCH 53/71] Slight logic cleanup in NetSimplePlayerCamera Signed-off-by: puvvadar --- .../NetworkSimplePlayerCameraComponent.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp index de9526eed..c6f2a92d4 100644 --- a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp +++ b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp @@ -72,13 +72,20 @@ namespace MultiplayerSample { const AZ::Quaternion targetRotation = AZ::Quaternion::CreateRotationZ(GetCameraYaw()) * AZ::Quaternion::CreateRotationX(GetCameraPitch()); const AZ::Quaternion currentRotation = m_activeCameraEntity->GetTransform()->GetWorldTM().GetRotation(); - const AZ::Quaternion aimRotation = m_syncOrientationImmediate ? - targetRotation : currentRotation.Slerp(targetRotation, cl_cameraBlendSpeed).GetNormalized(); + AZ::Quaternion aimRotation; + if(m_syncOrientationImmediate) + { + aimRotation = targetRotation; + m_syncOrientationImmediate = false; + } + else + { + aimRotation = currentRotation.Slerp(targetRotation, cl_cameraBlendSpeed).GetNormalized(); + } const AZ::Vector3 targetTranslation = GetEntity()->GetTransform()->GetWorldTM().GetTranslation(); const AZ::Vector3 cameraOffset = aimRotation.TransformVector(cl_cameraOffset); const AZ::Transform cameraTransform = AZ::Transform::CreateFromQuaternionAndTranslation(aimRotation, targetTranslation + cameraOffset); m_activeCameraEntity->GetTransform()->SetWorldTM(cameraTransform); - m_syncOrientationImmediate = false; } } From 6758ee9c913fc2503985c3a00d8a0f4502a6f179 Mon Sep 17 00:00:00 2001 From: allisaurus <34254888+allisaurus@users.noreply.github.com> Date: Wed, 23 Feb 2022 17:07:06 -0800 Subject: [PATCH 54/71] Add editor.cfg to enable local server from editor (#116) Signed-off-by: allisaurus <34254888+allisaurus@users.noreply.github.com> --- README.md | 4 +++- editor.cfg | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 editor.cfg diff --git a/README.md b/README.md index 4d10c90da..30e89d3f9 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,9 @@ MultiplayerSample.ServerLauncher.exe --console-command-file=server.cfg #### Running the Server in the Editor -Refer to the O3DE document [Test Multiplayer Games in the O3DE Editor](https://o3de.org/docs/user-guide/gems/reference/multiplayer/multiplayer-gem/test-in-editor/), to set up required console variables (cvar) to support play in editor with servers. Ensure you configure ```editorsv_enabled``` and ```editorsv_launch``` as required. See the [Console Variable Tutorial](https://o3de.org/docs/user-guide/engine/cvars) for more details on setting and using cvars. +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](https://o3de.org/docs/user-guide/gems/reference/multiplayer/multiplayer-gem/test-in-editor/) for the complete list of console variables (cvar) which support play in the editor with servers. #### Running the Client diff --git a/editor.cfg b/editor.cfg new file mode 100644 index 000000000..10cabaeb8 --- /dev/null +++ b/editor.cfg @@ -0,0 +1 @@ +editorsv_enabled=true \ No newline at end of file From c9d46733c30464e0369900f3c95e6af477f3b0de Mon Sep 17 00:00:00 2001 From: puvvadar Date: Thu, 24 Feb 2022 14:55:40 -0800 Subject: [PATCH 55/71] Updates for OnPlayerJoin changes and fix camera sync Signed-off-by: puvvadar --- ...rkPlayerSpawnerComponent.AutoComponent.xml | 4 +-- ...plePlayerCameraComponent.AutoComponent.xml | 1 + .../NetworkSimplePlayerCameraComponent.cpp | 12 ++++++--- .../NetworkSimplePlayerCameraComponent.h | 1 - .../Components/NetworkWeaponsComponent.cpp | 5 ++-- .../MultiplayerSampleSystemComponent.cpp | 26 +++++++++++++++++-- .../Source/MultiplayerSampleSystemComponent.h | 2 +- 7 files changed, 38 insertions(+), 13 deletions(-) diff --git a/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml index b9c9e1512..3d5a9dbc2 100644 --- a/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml @@ -8,8 +8,8 @@ OverrideInclude="Source/Components/NetworkPlayerSpawnerComponent.h" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - + + diff --git a/Gem/Code/Source/AutoGen/NetworkSimplePlayerCameraComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkSimplePlayerCameraComponent.AutoComponent.xml index fd1324a42..d9eddc033 100644 --- a/Gem/Code/Source/AutoGen/NetworkSimplePlayerCameraComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkSimplePlayerCameraComponent.AutoComponent.xml @@ -13,4 +13,5 @@ + diff --git a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp index c6f2a92d4..5681028ed 100644 --- a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp +++ b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp @@ -24,10 +24,10 @@ namespace MultiplayerSample void NetworkSimplePlayerCameraComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { - // Synchronize aim angles with initial transform + // Synchronize aim angles with initial transform AZ::Vector3& aimAngles = ModifyAimAngles(); aimAngles.SetZ(GetEntity()->GetTransform()->GetLocalRotation().GetZ()); - m_syncOrientationImmediate = true; + SetSyncAimImmediate(true); if (IsAutonomous()) { @@ -73,10 +73,9 @@ namespace MultiplayerSample const AZ::Quaternion targetRotation = AZ::Quaternion::CreateRotationZ(GetCameraYaw()) * AZ::Quaternion::CreateRotationX(GetCameraPitch()); const AZ::Quaternion currentRotation = m_activeCameraEntity->GetTransform()->GetWorldTM().GetRotation(); AZ::Quaternion aimRotation; - if(m_syncOrientationImmediate) + if(GetSyncAimImmediate()) { aimRotation = targetRotation; - m_syncOrientationImmediate = false; } else { @@ -87,6 +86,11 @@ namespace MultiplayerSample const AZ::Transform cameraTransform = AZ::Transform::CreateFromQuaternionAndTranslation(aimRotation, targetTranslation + cameraOffset); m_activeCameraEntity->GetTransform()->SetWorldTM(cameraTransform); } + + if (GetSyncAimImmediate()) + { + SetSyncAimImmediate(false); + } } int NetworkSimplePlayerCameraComponentController::GetTickOrder() diff --git a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.h b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.h index 42a781e48..a1e885895 100644 --- a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.h +++ b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.h @@ -35,6 +35,5 @@ namespace MultiplayerSample AZ::Entity* m_activeCameraEntity = nullptr; bool m_aiEnabled = false; - bool m_syncOrientationImmediate = false; }; } diff --git a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp index 6e8d2a4be..34d98d252 100644 --- a/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp +++ b/Gem/Code/Source/Components/NetworkWeaponsComponent.cpp @@ -22,7 +22,7 @@ namespace MultiplayerSample AZ_CVAR(float, cl_WeaponsDrawDebugSize, 0.25f, nullptr, AZ::ConsoleFunctorFlags::Null, "The size of sphere to debug draw during weapon events"); AZ_CVAR(float, cl_WeaponsDrawDebugDurationSec, 10.0f, nullptr, AZ::ConsoleFunctorFlags::Null, "The number of seconds to display debug draw data"); AZ_CVAR(float, sv_WeaponsImpulseScalar, 750.0f, nullptr, AZ::ConsoleFunctorFlags::Null, "A fudge factor for imparting impulses on rigid bodies due to weapon hits"); - + AZ_CVAR(float, sv_WeaponsStartPositionClampRange, 1.f, nullptr, AZ::ConsoleFunctorFlags::Null, "A fudge factor between the where the client and server say a shot started"); void NetworkWeaponsComponent::NetworkWeaponsComponent::Reflect(AZ::ReflectContext* context) { AZ::SerializeContext* serializeContext = azrtti_cast(context); @@ -375,8 +375,7 @@ namespace MultiplayerSample } // Validate the proposed start position is reasonably close to the related bone - float startPositionClampRange = 1.f; - if ((fireBoneTransform.GetTranslation() - aimSource).GetLength() > startPositionClampRange) + if ((fireBoneTransform.GetTranslation() - aimSource).GetLength() > sv_WeaponsStartPositionClampRange) { aimSource = fireBoneTransform.GetTranslation(); AZLOG_WARN("Shot origin was outside of clamp range, resetting to bone position"); diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index e2c7d4018..3e9d548d5 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -108,10 +108,32 @@ namespace MultiplayerSample return AZ::TICK_PLACEMENT + 2; } - AZStd::pair MultiplayerSampleSystemComponent::OnPlayerJoin( + Multiplayer::NetworkEntityHandle MultiplayerSampleSystemComponent::OnPlayerJoin( [[maybe_unused]] uint64_t userId, [[maybe_unused]] const Multiplayer::MultiplayerAgentDatum& agentDatum) { - return AZ::Interface::Get()->GetNextPlayerSpawn(); + AZStd::pair entityParams = AZ::Interface::Get()->GetNextPlayerSpawn(); + + Multiplayer::INetworkEntityManager::EntityList entityList = + AZ::Interface::Get()->GetNetworkEntityManager()->CreateEntitiesImmediate( + entityParams.first, Multiplayer::NetEntityRole::Authority, entityParams.second, Multiplayer::AutoActivate::DoNotActivate); + + for (Multiplayer::NetworkEntityHandle subEntity : entityList) + { + subEntity.Activate(); + } + + Multiplayer::NetworkEntityHandle controlledEntity; + if (!entityList.empty()) + { + controlledEntity = entityList[0]; + } + else + { + AZLOG_WARN("Attempt to spawn prefab %s failed. Check that prefab is network enabled.", + entityParams.first.m_prefabName.GetCStr()); + } + + return controlledEntity; } void MultiplayerSampleSystemComponent::OnPlayerLeave( diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.h b/Gem/Code/Source/MultiplayerSampleSystemComponent.h index 5ee9b6de7..0b22cbe48 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.h +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.h @@ -57,7 +57,7 @@ namespace MultiplayerSample //////////////////////////////////////////////////////////////////////// // IMultiplayerSpawner overrides - AZStd::pair OnPlayerJoin(uint64_t userId, const Multiplayer::MultiplayerAgentDatum& agentDatum) override; + Multiplayer::NetworkEntityHandle OnPlayerJoin(uint64_t userId, const Multiplayer::MultiplayerAgentDatum& agentDatum) override; void OnPlayerLeave( Multiplayer::ConstNetworkEntityHandle entityHandle, const Multiplayer::ReplicationSet& replicationSet, From b1dc11d62f1da0db23d9ea18fd1262daeb89b9f8 Mon Sep 17 00:00:00 2001 From: kberg-amzn Date: Thu, 3 Mar 2022 13:44:31 -0800 Subject: [PATCH 56/71] Adding configuration options that allow the stress test to autospawn a number of entities at a given interval without imgui interaction Signed-off-by: kberg-amzn --- ...tworkStressTestComponent.AutoComponent.xml | 5 ++++ .../Components/NetworkStressTestComponent.cpp | 24 +++++++++++++++++++ .../Components/NetworkStressTestComponent.h | 7 +++++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Gem/Code/Source/AutoGen/NetworkStressTestComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkStressTestComponent.AutoComponent.xml index 9b043a79b..bdbf80718 100644 --- a/Gem/Code/Source/AutoGen/NetworkStressTestComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkStressTestComponent.AutoComponent.xml @@ -8,7 +8,12 @@ OverrideInclude="Source/Components/NetworkStressTestComponent.h" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + + + + diff --git a/Gem/Code/Source/Components/NetworkStressTestComponent.cpp b/Gem/Code/Source/Components/NetworkStressTestComponent.cpp index cfc6996cf..7d004c352 100644 --- a/Gem/Code/Source/Components/NetworkStressTestComponent.cpp +++ b/Gem/Code/Source/Components/NetworkStressTestComponent.cpp @@ -36,6 +36,13 @@ namespace MultiplayerSample { } + NetworkStressTestComponentController::NetworkStressTestComponentController(NetworkStressTestComponent& owner) + : NetworkStressTestComponentControllerBase(owner) + , m_autoSpawnTimer([this]() { HandleSpawnAiEntity(); }, AZ::Name("StressTestSpawner Event")) + { + ; + } + void NetworkStressTestComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { #ifdef IMGUI_ENABLED @@ -53,6 +60,11 @@ namespace MultiplayerSample default: break; } + + if (GetAutoSpawnIntervalMs() > AZ::Time::ZeroTimeMs) + { + m_autoSpawnTimer.Enqueue(GetAutoSpawnIntervalMs(), true); + } } void NetworkStressTestComponentController::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) @@ -62,6 +74,12 @@ namespace MultiplayerSample #endif } + void NetworkStressTestComponentController::HandleSpawnAiEntity() + { + const uint64_t seed = m_seed == 0 ? static_cast(AZ::Interface::Get()->GetElapsedTimeMs()) : m_seed; + HandleSpawnAIEntity(nullptr, m_fireIntervalMinMs, m_fireIntervalMaxMs, m_actionIntervalMinMs, m_actionIntervalMaxMs, seed, m_teamID); + } + #if defined(IMGUI_ENABLED) void NetworkStressTestComponentController::OnImGuiMainMenuUpdate() { @@ -144,6 +162,12 @@ namespace MultiplayerSample const uint64_t& seed, [[maybe_unused]] const int& teamId) { + if (GetSpawnCount() > GetMaxSpawns()) + { + return; + } + ModifySpawnCount()++; + static Multiplayer::PrefabEntityId prefabId(AZ::Name{ "prefabs/player.network.spawnable" }); Multiplayer::INetworkEntityManager::EntityList entityList = diff --git a/Gem/Code/Source/Components/NetworkStressTestComponent.h b/Gem/Code/Source/Components/NetworkStressTestComponent.h index dabb36dcf..f539b15f8 100644 --- a/Gem/Code/Source/Components/NetworkStressTestComponent.h +++ b/Gem/Code/Source/Components/NetworkStressTestComponent.h @@ -39,9 +39,13 @@ namespace MultiplayerSample public: using NetworkStressTestComponentControllerBase::NetworkStressTestComponentControllerBase; + NetworkStressTestComponentController(NetworkStressTestComponent& owner); + void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; + void HandleSpawnAiEntity(); + void HandleSpawnAIEntity( AzNetworking::IConnection* invokingConnection, const float& fireIntervalMinMs, @@ -61,6 +65,7 @@ namespace MultiplayerSample void DrawEntitySpawner(); bool m_displayEntitySpawner = false; +#endif bool m_isServer = false; int m_quantity = 1; float m_fireIntervalMinMs = 100.f; @@ -69,6 +74,6 @@ namespace MultiplayerSample float m_actionIntervalMaxMs = 10000.f; uint64_t m_seed = 0; int m_teamID = 0; -#endif + AZ::ScheduledEvent m_autoSpawnTimer; }; } // namespace MultiplayerSample From c4dbb7e4d75b22cd93cc8af825bf2af74ff75e6c Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Mon, 7 Mar 2022 12:19:32 -0500 Subject: [PATCH 57/71] Keep editing ticking option Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- editor.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor.cfg b/editor.cfg index 10cabaeb8..322bd9efe 100644 --- a/editor.cfg +++ b/editor.cfg @@ -1 +1,2 @@ -editorsv_enabled=true \ No newline at end of file +editorsv_enabled=true +ed_KeepEditorAlive=true From 8f40c460c010b0fe4a3da4003803b13833fddd43 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Mon, 7 Mar 2022 12:25:03 -0500 Subject: [PATCH 58/71] Correcting case Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- editor.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor.cfg b/editor.cfg index 322bd9efe..b8050b381 100644 --- a/editor.cfg +++ b/editor.cfg @@ -1,2 +1,2 @@ editorsv_enabled=true -ed_KeepEditorAlive=true +ed_keepEditorAlive=true From 7d99f74ba9091f08ba2cb0253320510d17a2f4a3 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Thu, 10 Mar 2022 18:05:42 -0500 Subject: [PATCH 59/71] Added gem_name as per new gem definition requirements Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Gem/gem.json | 1 + 1 file changed, 1 insertion(+) diff --git a/Gem/gem.json b/Gem/gem.json index 38ac5289a..5f93ac094 100644 --- a/Gem/gem.json +++ b/Gem/gem.json @@ -1,4 +1,5 @@ { + "gem_name": "MultiplayerSample", "GemFormatVersion": 4, "Uuid": "8d7f210742af4b8c8813d593f4c46cf2", "Name": "MultiplayerSample", From d569fbb4d2f3b7a937dfc1c3b8f4bfad9acf2b0b Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:43:10 -0600 Subject: [PATCH 60/71] Updated the MultiplayerSample gem.json to be O3DE format Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Gem/gem.json | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/Gem/gem.json b/Gem/gem.json index 5f93ac094..e7c5f7a3f 100644 --- a/Gem/gem.json +++ b/Gem/gem.json @@ -1,11 +1,21 @@ { "gem_name": "MultiplayerSample", - "GemFormatVersion": 4, - "Uuid": "8d7f210742af4b8c8813d593f4c46cf2", - "Name": "MultiplayerSample", - "DisplayName": "MultiplayerSample", - "Summary": "MultiplayerSample Project Gem..", - "Tags": ["Game"], - "IconPath": "preview.png", - "IsGameGem": true + "display_name": "MultiplayerSample", + "license": "What license MultiplayerSample uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for MultiplayerSample goes here: i.e. http://www.mydomain.com", + "type": "", + "summary": "A short description of MultiplayerSample.", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + "MultiplayerSample" + ], + "icon_path": "preview.png", + "requirements": "", + "documentation_url": "", + "dependencies": [ + ] } From 515ffe927cda4432dd7599a49481fa362fc55bc5 Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Fri, 11 Mar 2022 15:00:46 -0800 Subject: [PATCH 61/71] Rename iOS cmake file Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- ...tiplayer_ios_files.cmake => multiplayersample_ios_files.cmake} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Gem/Code/Platform/iOS/{multiplayer_ios_files.cmake => multiplayersample_ios_files.cmake} (100%) diff --git a/Gem/Code/Platform/iOS/multiplayer_ios_files.cmake b/Gem/Code/Platform/iOS/multiplayersample_ios_files.cmake similarity index 100% rename from Gem/Code/Platform/iOS/multiplayer_ios_files.cmake rename to Gem/Code/Platform/iOS/multiplayersample_ios_files.cmake From d635324227153a65c01e8a0c5c44dd71ac17491d Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Mon, 14 Mar 2022 20:11:28 -0400 Subject: [PATCH 62/71] Editor server to set to hidden, rhi as null mode for faster startup Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- editor.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editor.cfg b/editor.cfg index b8050b381..798a91574 100644 --- a/editor.cfg +++ b/editor.cfg @@ -1,2 +1,4 @@ editorsv_enabled=true ed_keepEditorAlive=true +editorsv_hidden=true +editorsv_rhi_override=null From 6de7136c6e95c7d962b2e17a1b1f073dabf20c6f Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Tue, 15 Mar 2022 14:34:29 -0500 Subject: [PATCH 63/71] Moved the AssetProcessorGamePlatformConfig.setreg file to the Registry folder. Renamed the the AssetProcessorGamePlatformConfig.setreg to assetprocessor_settings.setreg to be inline with the Default project template. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../assetsprocessor_settings.setreg | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename AssetProcessorGamePlatformConfig.setreg => Registry/assetsprocessor_settings.setreg (100%) diff --git a/AssetProcessorGamePlatformConfig.setreg b/Registry/assetsprocessor_settings.setreg similarity index 100% rename from AssetProcessorGamePlatformConfig.setreg rename to Registry/assetsprocessor_settings.setreg From 30541b97bee857c5713d0386ff81750b120dbfb9 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Tue, 15 Mar 2022 14:45:24 -0500 Subject: [PATCH 64/71] Removed the assets_scan_folder.setreg file as it is no supported for adding scan folders to the AssetProcessor. Enabled the MaterialEditor and UiBasics gems to allow the AP to pick up their ScanFolders via their .Builders targets. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Gem/Code/enabled_gems.cmake | 2 ++ Registry/assets_scan_folders.setreg | 17 ----------------- 2 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 Registry/assets_scan_folders.setreg diff --git a/Gem/Code/enabled_gems.cmake b/Gem/Code/enabled_gems.cmake index 7ac743b38..1a2447251 100644 --- a/Gem/Code/enabled_gems.cmake +++ b/Gem/Code/enabled_gems.cmake @@ -50,4 +50,6 @@ set(ENABLED_GEMS StartingPointInput EditorPythonBindings PrefabBuilder + MaterialEditor + UiBasics ) \ No newline at end of file diff --git a/Registry/assets_scan_folders.setreg b/Registry/assets_scan_folders.setreg deleted file mode 100644 index fd65cdd30..000000000 --- a/Registry/assets_scan_folders.setreg +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Amazon": - { - "Gems": - { - "MultiplayerSample.Assets": - { - "SourcePaths": - [ - "Gems/Atom/Tools/MaterialEditor", - "Gems/PhysicsEntities", - "Gems/UiBasics" - ] - } - } - } -} \ No newline at end of file From 9f0d624b820961cf98ce2a3dd7b36d6a16cb7e13 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Tue, 15 Mar 2022 14:47:45 -0500 Subject: [PATCH 65/71] Updated the README.md to account for the correct source folder path to specify in order to work in a project-centric workflow. Refreshed the project.json file to use the O3DE fields. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Platform/Android/android_project.json | 9 +++++++++ README.md | 8 ++++---- project.json | 27 ++++++++++++++------------- 3 files changed, 27 insertions(+), 17 deletions(-) create mode 100644 Platform/Android/android_project.json diff --git a/Platform/Android/android_project.json b/Platform/Android/android_project.json new file mode 100644 index 000000000..b523525b4 --- /dev/null +++ b/Platform/Android/android_project.json @@ -0,0 +1,9 @@ +{ + "Tags": ["Android"], + "android_settings" : { + "package_name" : "org.o3de.multiplayersample", + "version_number" : 1, + "version_name" : "1.0.0.0", + "orientation" : "landscape" + } +} diff --git a/README.md b/README.md index 30e89d3f9..325b6252d 100644 --- a/README.md +++ b/README.md @@ -63,10 +63,10 @@ This option will output all the project binaries in the project's build folder e ```shell # example configure command -> cmake c:/path/to/o3de -B c:/path/to/o3de-multiplayersample/build -G "Visual Studio 16" -DLY_3RDPARTY_PATH="c:/3rdparty" -DLY_PROJECTS="c:/path/to/o3de-multiplayersample" +> 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 --target Editor MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher --config profile -- /m /nologo +> 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 @@ -75,10 +75,10 @@ This option will output all the project and engine binaries in the engine's buil ```shell # example configure command -> cmake c:/path/to/o3de -B c:/path/to/o3de/build -G "Visual Studio 16" -DLY_3RDPARTY_PATH="c:/3rdparty" -DLY_PROJECTS="c:/path/to/o3de-multiplayersample" +> 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 --target Editor MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher --config profile -- /m /nologo +> 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 diff --git a/project.json b/project.json index 9bbb1be58..9b73c2571 100644 --- a/project.json +++ b/project.json @@ -1,16 +1,17 @@ { "project_name": "MultiplayerSample", - "product_name": "MultiplayerSample", - "executable_name": "MultiplayerSampleLauncher", - "modules": [], "project_id": "{16D27830-D7FF-4124-B20B-2CF0387E8C7D}", - "android_settings": { - "package_name": "com.o3de.yourgame", - "version_number": 1, - "version_name": "1.0.0.0", - "orientation": "landscape" - }, - "xenia_settings": {}, - "provo_settings": {}, - "engine": "o3de" -} \ No newline at end of file + "origin": "The primary repo for MultiplayerSample goes here: i.e. http://www.mydomain.com", + "license": "What license MultiplayerSample uses goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT etc.", + "display_name": "MultiplayerSample", + "summary": "A short description of MultiplayerSample.", + "canonical_tags": [ + "Project" + ], + "user_tags": [ + "MultiplayerSample" + ], + "icon_path": "preview.png", + "engine": "o3de", + "external_subdirectories": [] +} From 6f22a47c74a0786f6e4be256cfac7cb94a121558 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Tue, 15 Mar 2022 15:08:02 -0500 Subject: [PATCH 66/71] Added o3de_restricted_path call to match the DefaultProject Template Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Gem/CMakeLists.txt | 4 ++++ Gem/Code/enabled_gems.cmake | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Gem/CMakeLists.txt b/Gem/CMakeLists.txt index 34bce0825..8f713099e 100644 --- a/Gem/CMakeLists.txt +++ b/Gem/CMakeLists.txt @@ -5,4 +5,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gem/Code/enabled_gems.cmake b/Gem/Code/enabled_gems.cmake index 1a2447251..2ab980723 100644 --- a/Gem/Code/enabled_gems.cmake +++ b/Gem/Code/enabled_gems.cmake @@ -52,4 +52,4 @@ set(ENABLED_GEMS PrefabBuilder MaterialEditor UiBasics -) \ No newline at end of file +) From a977d1c62a42ff317e573d74eed0cf08c3cd12f9 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Tue, 15 Mar 2022 15:47:47 -0500 Subject: [PATCH 67/71] Updated the origin, license and summaryfields in the MultiplayerSample project project.json file. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- project.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project.json b/project.json index 9b73c2571..44aa1cac6 100644 --- a/project.json +++ b/project.json @@ -1,10 +1,10 @@ { "project_name": "MultiplayerSample", "project_id": "{16D27830-D7FF-4124-B20B-2CF0387E8C7D}", - "origin": "The primary repo for MultiplayerSample goes here: i.e. http://www.mydomain.com", - "license": "What license MultiplayerSample uses goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT etc.", + "origin": "https://github.com/o3de/o3de-multiplayersample", + "license": "For terms please see the LICENSE*.TXT file at the root of this distribution.", "display_name": "MultiplayerSample", - "summary": "A short description of MultiplayerSample.", + "summary": "A simple third-person multiplayer sample for O3DE.", "canonical_tags": [ "Project" ], From cd1f18c9b34a776854863997796c11981ff7a5a8 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Tue, 15 Mar 2022 19:41:28 -0500 Subject: [PATCH 68/71] Updated the MultiplayerSampleData ScanFolder to use a portable reference to the Atom gem. Replaced the Atom_AtomBridge dependency with Atom. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Gem/Code/enabled_gems.cmake | 2 +- Registry/assetsprocessor_settings.setreg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gem/Code/enabled_gems.cmake b/Gem/Code/enabled_gems.cmake index 2ab980723..4881e076a 100644 --- a/Gem/Code/enabled_gems.cmake +++ b/Gem/Code/enabled_gems.cmake @@ -39,7 +39,7 @@ set(ENABLED_GEMS LmbrCentral LyShine HttpRequestor - Atom_AtomBridge + Atom AWSCore AWSClientAuth AWSMetrics diff --git a/Registry/assetsprocessor_settings.setreg b/Registry/assetsprocessor_settings.setreg index d8c084827..b948fcc09 100644 --- a/Registry/assetsprocessor_settings.setreg +++ b/Registry/assetsprocessor_settings.setreg @@ -9,7 +9,7 @@ "ignore": true }, "ScanFolder MultiplayerSampleData": { - "watch": "@ENGINEROOT@/Gems/Atom/TestData", + "watch": "@GEMROOT:Atom@/TestData", "recursive": 1, "order": 1000 }, From 46b4b7145acfbd8ff04bebcfcf91eb2d31c722b9 Mon Sep 17 00:00:00 2001 From: allisaurus <34254888+allisaurus@users.noreply.github.com> Date: Thu, 17 Mar 2022 14:50:25 -0700 Subject: [PATCH 69/71] Update spawn nodes in SpawnIfAuthority (#132) Signed-off-by: allisaurus <34254888+allisaurus@users.noreply.github.com> --- scriptcanvas/SpawnIfAuthority.scriptcanvas | 944 ++++++++++++++------- 1 file changed, 644 insertions(+), 300 deletions(-) diff --git a/scriptcanvas/SpawnIfAuthority.scriptcanvas b/scriptcanvas/SpawnIfAuthority.scriptcanvas index d58dd5d11..9770c150d 100644 --- a/scriptcanvas/SpawnIfAuthority.scriptcanvas +++ b/scriptcanvas/SpawnIfAuthority.scriptcanvas @@ -5,22 +5,54 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 5748427407530 + "id": 744312986674 }, "Name": "SpawnIfAuthority", "Components": { "Component_[11160906310313544800]": { "$type": "EditorGraphVariableManagerComponent", - "Id": 11160906310313544800 + "Id": 11160906310313544800, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{DA8B04C5-A23C-40E0-8577-56A74B6B2086}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{A96A5037-AD0D-43B6-9948-ED63438C4A52}" + }, + "isNullPointer": false, + "$type": "SpawnableAsset", + "value": { + "Asset": { + "assetId": { + "guid": "{13BAFCBF-6669-5E4E-B3B0-8610349B2C01}", + "subId": 1084915735 + }, + "assetHint": "prefabs/player.spawnable" + } + } + }, + "VariableId": { + "m_id": "{DA8B04C5-A23C-40E0-8577-56A74B6B2086}" + }, + "VariableName": "Player" + } + } + ] + } }, "Component_[13752069858907098540]": { - "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "$type": "EditorGraph", "Id": 13752069858907098540, "m_graphData": { "m_nodes": [ { "Id": { - "id": 5752722374826 + "id": 770082790450 }, "Name": "EBusEventHandler", "Components": { @@ -199,7 +231,6 @@ ], "Datums": [ { - "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 1 }, @@ -262,117 +293,46 @@ }, { "Id": { - "id": 5757017342122 + "id": 765787823154 }, - "Name": "SC-Node(Gate)", + "Name": "SC-Node(SpawnNodeableNode)", "Components": { - "Component_[3937387805246265595]": { - "$type": "Gate", - "Id": 3937387805246265595, + "Component_[12697291398119811480]": { + "$type": "SpawnNodeableNode", + "Id": 12697291398119811480, "Slots": [ { "id": { - "m_id": "{CACFB235-8553-4A31-8595-779028A50CA1}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - null - ], - "slotName": "Condition", - "toolTip": "If true the node will signal the Output and proceed execution", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 2 - }, - "DataType": 1 - }, - { - "id": { - "m_id": "{FC311D8E-B2BA-4E16-8E0C-04077CE752D1}" + "m_id": "{69AD9BD3-9556-414B-BC97-C487EA487ABC}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "In", - "toolTip": "Input signal", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{3CDC2B4A-25B9-4CAD-9F7D-38C3D212F40F}" + "slotName": "Request Spawn", + "DisplayGroup": { + "Value": 929942742 }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "True", - "toolTip": "Signaled if the condition provided evaluates to true.", "Descriptor": { - "ConnectionType": 2, + "ConnectionType": 1, "SlotType": 1 } }, { "id": { - "m_id": "{30A9F4B8-6B5F-4A1F-9C02-208E272E64BF}" + "m_id": "{96A2379F-1147-4A20-B843-ED1621A32A4C}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "False", - "toolTip": "Signaled if the condition provided evaluates to false.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - } - ], - "Datums": [ - { - "isOverloadedStorage": false, - "scriptCanvasType": { - "m_type": 0 - }, - "isNullPointer": false, - "$type": "bool", - "value": false, - "label": "Condition" - } - ] - } - } - }, - { - "Id": { - "id": 5761312309418 - }, - "Name": "SC-Node(IsNetEntityRoleAuthority)", - "Components": { - "Component_[4365307061596592024]": { - "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", - "Id": 4365307061596592024, - "Slots": [ - { - "id": { - "m_id": "{291E3577-8AA2-495B-AEB0-483D2A17B0C4}" + "slotName": "SpawnTicket", + "toolTip": "Ticket instance assosiated with spawnable asset.", + "DisplayGroup": { + "Value": 929942742 }, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - null - ], - "slotName": "EntityID: 0", "Descriptor": { "ConnectionType": 1, "SlotType": 2 @@ -381,118 +341,55 @@ }, { "id": { - "m_id": "{FD0F08BD-2B4C-49F8-84E0-A60CF854D157}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "In", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{25AA7A16-F5D8-4014-B829-0BD0EEA6B555}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Out", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{ABAE4BDB-E6F7-44DE-814F-838208D47892}" + "m_id": "{08965288-5365-4117-AFD0-BB44F679B07C}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "Result: Boolean", - "DisplayDataType": { - "m_type": 0 + "slotName": "ParentId", + "toolTip": "Optional parent to assign spawned container entity to.", + "DisplayGroup": { + "Value": 929942742 }, "Descriptor": { - "ConnectionType": 2, + "ConnectionType": 1, "SlotType": 2 }, "DataType": 1 - } - ], - "Datums": [ - { - "isOverloadedStorage": false, - "scriptCanvasType": { - "m_type": 1 - }, - "isNullPointer": false, - "$type": "EntityId", - "value": { - "id": 2901262558 - }, - "label": "EntityID: 0" - } - ], - "methodType": 2, - "methodName": "IsNetEntityRoleAuthority", - "className": "NetBindComponent", - "resultSlotIDs": [ - {} - ], - "prettyClassName": "NetBindComponent" - } - } - }, - { - "Id": { - "id": 5769902244010 - }, - "Name": "SC-Node(SpawnNodeableNode)", - "Components": { - "Component_[4496831673767245008]": { - "$type": "SpawnNodeableNode", - "Id": 4496831673767245008, - "Slots": [ + }, { "id": { - "m_id": "{DF59D0F1-A4E3-401F-A6AB-F558CC35B7E1}" + "m_id": "{411AC6D8-74DF-4CF5-AFE5-32F716F733F9}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "Request Spawn", + "slotName": "Local Translation", + "toolTip": "Position to spawn.", "DisplayGroup": { "Value": 929942742 }, "Descriptor": { "ConnectionType": 1, - "SlotType": 1 - } + "SlotType": 2 + }, + "DataType": 1 }, { "id": { - "m_id": "{34B6FC60-FD4D-4CA9-AE6A-F6A8C21646F7}" + "m_id": "{5C241B17-6DEB-47A2-AE97-44F91FADE6ED}" }, "contracts": [ { "$type": "SlotTypeContract" - }, - null + } ], - "slotName": "Translation", - "toolTip": "Position to spawn", + "slotName": "Local Rotation", + "toolTip": "Rotation of spawn (in degrees).", "DisplayGroup": { "Value": 929942742 }, @@ -504,16 +401,15 @@ }, { "id": { - "m_id": "{9A1ADEF9-5F78-49E9-8806-3F20B7812BB2}" + "m_id": "{BB8D6323-5AE0-485A-A7B1-58080E96FB36}" }, "contracts": [ { "$type": "SlotTypeContract" - }, - null + } ], - "slotName": "Rotation", - "toolTip": "Rotation of spawn (in degrees)", + "slotName": "Local Scale", + "toolTip": "Scale of spawn.", "DisplayGroup": { "Value": 929942742 }, @@ -525,65 +421,69 @@ }, { "id": { - "m_id": "{C9C0D916-C823-4E34-A651-3A0386337BD7}" + "m_id": "{AFE3244F-ECC3-4F37-82D2-5F2024D69D6D}" }, "contracts": [ { "$type": "SlotTypeContract" - }, - null + } ], - "slotName": "Scale", - "toolTip": "Scale of spawn", + "slotName": "Spawn Requested", "DisplayGroup": { "Value": 929942742 }, "Descriptor": { - "ConnectionType": 1, - "SlotType": 2 - }, - "DataType": 1 + "ConnectionType": 2, + "SlotType": 1 + } }, { "id": { - "m_id": "{A5E747BD-9403-48D3-8812-8C3A2BBB6DBE}" + "m_id": "{A10B2BEC-5D3D-45C9-B4B1-CD54FC5BF7DA}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "Spawn Requested", + "slotName": "On Spawn Completed", + "toolTip": "Called when spawning entities is completed.", "DisplayGroup": { - "Value": 929942742 + "Value": 3165055374 }, "Descriptor": { "ConnectionType": 2, "SlotType": 1 - } + }, + "IsLatent": true }, { "id": { - "m_id": "{D68BDC57-A68B-4E72-8DB8-FD2919960C2E}" + "m_id": "{18C15A57-8AC8-456F-B475-BF0C8B167B81}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "On Spawn", + "slotName": "SpawnTicket", + "toolTip": "Ticket instance of the spawn result.", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{2B5EB938-8962-4A43-A97B-112F398C604B}" + }, "DisplayGroup": { - "Value": 3873466122 + "Value": 3165055374 }, "Descriptor": { "ConnectionType": 2, - "SlotType": 1 + "SlotType": 2 }, - "IsLatent": true + "DataType": 1 }, { "id": { - "m_id": "{90AEB43E-0C16-4AD3-95C7-4EED42B5E777}" + "m_id": "{2F264F33-94A6-477B-82BD-E79A9B9BA798}" }, "contracts": [ { @@ -597,7 +497,7 @@ "m_azType": "{4841CFF0-7A5C-519C-BD16-D3625E99605E}" }, "DisplayGroup": { - "Value": 3873466122 + "Value": 3165055374 }, "Descriptor": { "ConnectionType": 2, @@ -608,7 +508,26 @@ ], "Datums": [ { - "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{2B5EB938-8962-4A43-A97B-112F398C604B}" + }, + "isNullPointer": false, + "$type": "SpawnTicketInstance", + "label": "SpawnTicket" + }, + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "ParentId" + }, + { "scriptCanvasType": { "m_type": 8 }, @@ -619,10 +538,9 @@ 0.0, 0.0 ], - "label": "Translation" + "label": "Local Translation" }, { - "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 8 }, @@ -633,77 +551,82 @@ 0.0, 0.0 ], - "label": "Rotation" + "label": "Local Rotation" }, { - "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 3 }, "isNullPointer": false, "$type": "double", "value": 1.0, - "label": "Scale" + "label": "Local Scale" } ], - "nodeable": { - "m_spawnableAsset": { - "assetId": { - "guid": "{F6990C4F-540A-56EF-8C07-3ECECB09BBE7}", - "subId": 2960582392 - }, - "assetHint": "prefabs/filteredgroup.spawnable" - } - }, "slotExecutionMap": { "ins": [ { "_slotId": { - "m_id": "{DF59D0F1-A4E3-401F-A6AB-F558CC35B7E1}" + "m_id": "{69AD9BD3-9556-414B-BC97-C487EA487ABC}" }, "_inputs": [ { "_slotId": { - "m_id": "{34B6FC60-FD4D-4CA9-AE6A-F6A8C21646F7}" + "m_id": "{96A2379F-1147-4A20-B843-ED1621A32A4C}" + } + }, + { + "_slotId": { + "m_id": "{08965288-5365-4117-AFD0-BB44F679B07C}" + } + }, + { + "_slotId": { + "m_id": "{411AC6D8-74DF-4CF5-AFE5-32F716F733F9}" } }, { "_slotId": { - "m_id": "{9A1ADEF9-5F78-49E9-8806-3F20B7812BB2}" + "m_id": "{5C241B17-6DEB-47A2-AE97-44F91FADE6ED}" } }, { "_slotId": { - "m_id": "{C9C0D916-C823-4E34-A651-3A0386337BD7}" + "m_id": "{BB8D6323-5AE0-485A-A7B1-58080E96FB36}" } } ], "_outs": [ { "_slotId": { - "m_id": "{A5E747BD-9403-48D3-8812-8C3A2BBB6DBE}" + "m_id": "{AFE3244F-ECC3-4F37-82D2-5F2024D69D6D}" }, "_name": "Spawn Requested", - "_interfaceSourceId": "{6867F7E3-1800-0000-8066-F7E318000000}" + "_interfaceSourceId": "{E9ECDA1C-0000-0000-C769-D15EF77F0000}" } ], - "_interfaceSourceId": "{00000002-F3FF-FFFF-3900-000000000000}" + "_interfaceSourceId": "{406E6F35-F501-0000-7B7E-9CF4FE7F0000}" } ], "latents": [ { "_slotId": { - "m_id": "{D68BDC57-A68B-4E72-8DB8-FD2919960C2E}" + "m_id": "{A10B2BEC-5D3D-45C9-B4B1-CD54FC5BF7DA}" }, - "_name": "On Spawn", + "_name": "On Spawn Completed", "_outputs": [ { "_slotId": { - "m_id": "{90AEB43E-0C16-4AD3-95C7-4EED42B5E777}" + "m_id": "{18C15A57-8AC8-456F-B475-BF0C8B167B81}" + } + }, + { + "_slotId": { + "m_id": "{2F264F33-94A6-477B-82BD-E79A9B9BA798}" } } ], - "_interfaceSourceId": "{00000002-F3FF-FFFF-3900-000000000000}" + "_interfaceSourceId": "{406E6F35-F501-0000-7B7E-9CF4FE7F0000}" } ] } @@ -712,17 +635,17 @@ }, { "Id": { - "id": 5765607276714 + "id": 761492855858 }, - "Name": "SC-Node(GetWorldTranslation)", + "Name": "SC-Node(Gate)", "Components": { - "Component_[970016012553935437]": { - "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", - "Id": 970016012553935437, + "Component_[3937387805246265595]": { + "$type": "Gate", + "Id": 3937387805246265595, "Slots": [ { "id": { - "m_id": "{0BB7FEE4-214C-4FF3-A72F-7802D3E40AC3}" + "m_id": "{CACFB235-8553-4A31-8595-779028A50CA1}" }, "contracts": [ { @@ -730,7 +653,8 @@ }, null ], - "slotName": "EntityID: 0", + "slotName": "Condition", + "toolTip": "If true the node will signal the Output and proceed execution", "Descriptor": { "ConnectionType": 1, "SlotType": 2 @@ -739,7 +663,338 @@ }, { "id": { - "m_id": "{65AD80A5-A210-42D6-895B-160DF013A626}" + "m_id": "{FC311D8E-B2BA-4E16-8E0C-04077CE752D1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3CDC2B4A-25B9-4CAD-9F7D-38C3D212F40F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "True", + "toolTip": "Signaled if the condition provided evaluates to true.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{30A9F4B8-6B5F-4A1F-9C02-208E272E64BF}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "False", + "toolTip": "Signaled if the condition provided evaluates to false.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 0 + }, + "isNullPointer": false, + "$type": "bool", + "value": false, + "label": "Condition" + } + ] + } + } + }, + { + "Id": { + "id": 757197888562 + }, + "Name": "SC-Node(CreateSpawnTicketNodeableNode)", + "Components": { + "Component_[436207136216439706]": { + "$type": "CreateSpawnTicketNodeableNode", + "Id": 436207136216439706, + "Slots": [ + { + "id": { + "m_id": "{828860F9-BB5B-4909-BB68-E125DAED686A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Create Ticket", + "DisplayGroup": { + "Value": 3070342103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{45C69FD9-8392-4CA5-96E9-2AA18D5404D5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Prefab", + "toolTip": "Prefab source asset to spawn", + "DisplayGroup": { + "Value": 3070342103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{DA8B04C5-A23C-40E0-8577-56A74B6B2086}" + } + }, + { + "id": { + "m_id": "{F4DF48F9-8707-4067-BF70-E6240EF7DD2F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Ticket Created", + "DisplayGroup": { + "Value": 3070342103 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{73DE083D-0C34-48C5-93A3-05E05A84B2DE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "SpawnTicket", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{2B5EB938-8962-4A43-A97B-112F398C604B}" + }, + "DisplayGroup": { + "Value": 3070342103 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{A96A5037-AD0D-43B6-9948-ED63438C4A52}" + }, + "isNullPointer": false, + "$type": "SpawnableAsset", + "label": "Prefab" + } + ], + "slotExecutionMap": { + "ins": [ + { + "_slotId": { + "m_id": "{828860F9-BB5B-4909-BB68-E125DAED686A}" + }, + "_inputs": [ + { + "_slotId": { + "m_id": "{45C69FD9-8392-4CA5-96E9-2AA18D5404D5}" + } + } + ], + "_outs": [ + { + "_slotId": { + "m_id": "{F4DF48F9-8707-4067-BF70-E6240EF7DD2F}" + }, + "_name": "Ticket Created", + "_outputs": [ + { + "_slotId": { + "m_id": "{73DE083D-0C34-48C5-93A3-05E05A84B2DE}" + } + } + ], + "_interfaceSourceId": "{F03F3EB7-F201-0000-708A-EFD929000000}" + } + ], + "_interfaceSourceId": "{C00593B8-F201-0000-406E-6F35F5010000}" + } + ] + } + } + } + }, + { + "Id": { + "id": 752902921266 + }, + "Name": "SC-Node(IsNetEntityRoleAuthority)", + "Components": { + "Component_[4365307061596592024]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 4365307061596592024, + "Slots": [ + { + "id": { + "m_id": "{291E3577-8AA2-495B-AEB0-483D2A17B0C4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "EntityID: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{FD0F08BD-2B4C-49F8-84E0-A60CF854D157}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{25AA7A16-F5D8-4014-B829-0BD0EEA6B555}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{ABAE4BDB-E6F7-44DE-814F-838208D47892}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Boolean", + "DisplayDataType": { + "m_type": 0 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "EntityID: 0" + } + ], + "methodType": 2, + "methodName": "IsNetEntityRoleAuthority", + "className": "NetBindComponent", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "NetBindComponent" + } + } + }, + { + "Id": { + "id": 748607953970 + }, + "Name": "SC-Node(GetWorldTranslation)", + "Components": { + "Component_[970016012553935437]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 970016012553935437, + "Slots": [ + { + "id": { + "m_id": "{0BB7FEE4-214C-4FF3-A72F-7802D3E40AC3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "EntityID: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{65AD80A5-A210-42D6-895B-160DF013A626}" }, "contracts": [ { @@ -789,7 +1044,6 @@ ], "Datums": [ { - "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 1 }, @@ -798,7 +1052,7 @@ "value": { "id": 2901262558 }, - "label": "Source" + "label": "EntityID: 0" } ], "methodType": 0, @@ -815,7 +1069,7 @@ "m_connections": [ { "Id": { - "id": 5774197211306 + "id": 774377757746 }, "Name": "srcEndpoint=(EntityBus Handler: ExecutionSlot:OnEntityActivated), destEndpoint=(IsNetEntityRoleAuthority: In)", "Components": { @@ -824,7 +1078,7 @@ "Id": 623912724610228967, "sourceEndpoint": { "nodeId": { - "id": 5752722374826 + "id": 770082790450 }, "slotId": { "m_id": "{FCEA454C-727C-4D5E-BC15-AB56BA5A39AE}" @@ -832,7 +1086,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 5761312309418 + "id": 752902921266 }, "slotId": { "m_id": "{FD0F08BD-2B4C-49F8-84E0-A60CF854D157}" @@ -843,7 +1097,7 @@ }, { "Id": { - "id": 5778492178602 + "id": 778672725042 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Out), destEndpoint=(If: In)", "Components": { @@ -852,7 +1106,7 @@ "Id": 15117390462186534323, "sourceEndpoint": { "nodeId": { - "id": 5761312309418 + "id": 752902921266 }, "slotId": { "m_id": "{25AA7A16-F5D8-4014-B829-0BD0EEA6B555}" @@ -860,7 +1114,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 5757017342122 + "id": 761492855858 }, "slotId": { "m_id": "{FC311D8E-B2BA-4E16-8E0C-04077CE752D1}" @@ -871,7 +1125,7 @@ }, { "Id": { - "id": 5782787145898 + "id": 782967692338 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Result: Boolean), destEndpoint=(If: Condition)", "Components": { @@ -880,7 +1134,7 @@ "Id": 11157494866445858874, "sourceEndpoint": { "nodeId": { - "id": 5761312309418 + "id": 752902921266 }, "slotId": { "m_id": "{ABAE4BDB-E6F7-44DE-814F-838208D47892}" @@ -888,7 +1142,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 5757017342122 + "id": 761492855858 }, "slotId": { "m_id": "{CACFB235-8553-4A31-8595-779028A50CA1}" @@ -899,7 +1153,7 @@ }, { "Id": { - "id": 5787082113194 + "id": 787262659634 }, "Name": "srcEndpoint=(If: True), destEndpoint=(GetWorldTranslation: In)", "Components": { @@ -908,7 +1162,7 @@ "Id": 8173811067217743380, "sourceEndpoint": { "nodeId": { - "id": 5757017342122 + "id": 761492855858 }, "slotId": { "m_id": "{3CDC2B4A-25B9-4CAD-9F7D-38C3D212F40F}" @@ -916,7 +1170,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 5765607276714 + "id": 748607953970 }, "slotId": { "m_id": "{65AD80A5-A210-42D6-895B-160DF013A626}" @@ -927,16 +1181,72 @@ }, { "Id": { - "id": 5791377080490 + "id": 791557626930 + }, + "Name": "srcEndpoint=(CreateSpawnTicket: Ticket Created), destEndpoint=(Spawn: Request Spawn)", + "Components": { + "Component_[6427710639037589106]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6427710639037589106, + "sourceEndpoint": { + "nodeId": { + "id": 757197888562 + }, + "slotId": { + "m_id": "{F4DF48F9-8707-4067-BF70-E6240EF7DD2F}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 765787823154 + }, + "slotId": { + "m_id": "{69AD9BD3-9556-414B-BC97-C487EA487ABC}" + } + } + } + } + }, + { + "Id": { + "id": 795852594226 + }, + "Name": "srcEndpoint=(CreateSpawnTicket: SpawnTicket), destEndpoint=(Spawn: SpawnTicket)", + "Components": { + "Component_[767872420311571744]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 767872420311571744, + "sourceEndpoint": { + "nodeId": { + "id": 757197888562 + }, + "slotId": { + "m_id": "{73DE083D-0C34-48C5-93A3-05E05A84B2DE}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 765787823154 + }, + "slotId": { + "m_id": "{96A2379F-1147-4A20-B843-ED1621A32A4C}" + } + } + } + } + }, + { + "Id": { + "id": 800147561522 }, - "Name": "srcEndpoint=(GetWorldTranslation: Out), destEndpoint=(Spawn: Request Spawn)", + "Name": "srcEndpoint=(GetWorldTranslation: Out), destEndpoint=(CreateSpawnTicket: Create Ticket)", "Components": { - "Component_[4443120657995663120]": { + "Component_[12817578276561072748]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 4443120657995663120, + "Id": 12817578276561072748, "sourceEndpoint": { "nodeId": { - "id": 5765607276714 + "id": 748607953970 }, "slotId": { "m_id": "{F17998D4-1F55-4C29-B7EC-493804BB3BB5}" @@ -944,10 +1254,10 @@ }, "targetEndpoint": { "nodeId": { - "id": 5769902244010 + "id": 757197888562 }, "slotId": { - "m_id": "{DF59D0F1-A4E3-401F-A6AB-F558CC35B7E1}" + "m_id": "{828860F9-BB5B-4909-BB68-E125DAED686A}" } } } @@ -955,16 +1265,16 @@ }, { "Id": { - "id": 5795672047786 + "id": 804442528818 }, - "Name": "srcEndpoint=(GetWorldTranslation: Result: Vector3), destEndpoint=(Spawn: Translation)", + "Name": "srcEndpoint=(GetWorldTranslation: Result: Vector3), destEndpoint=(Spawn: Local Translation)", "Components": { - "Component_[9076934972907588967]": { + "Component_[12001439484058061595]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 9076934972907588967, + "Id": 12001439484058061595, "sourceEndpoint": { "nodeId": { - "id": 5765607276714 + "id": 748607953970 }, "slotId": { "m_id": "{A9DEC503-1141-44C2-9BA6-E740B716CB92}" @@ -972,10 +1282,10 @@ }, "targetEndpoint": { "nodeId": { - "id": 5769902244010 + "id": 765787823154 }, "slotId": { - "m_id": "{34B6FC60-FD4D-4CA9-AE6A-F6A8C21646F7}" + "m_id": "{411AC6D8-74DF-4CF5-AFE5-32F716F733F9}" } } } @@ -989,20 +1299,20 @@ "_runtimeVersion": 1, "_fileVersion": 1 }, - "m_variableCounter": 1, + "m_variableCounter": 2, "GraphCanvasData": [ { "Key": { - "id": 5748427407530 + "id": 744312986674 }, "Value": { "ComponentData": { "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { "$type": "SceneComponentSaveData", "ViewParams": { - "Scale": 0.8121803, - "AnchorX": -145.28793334960938, - "AnchorY": -414.9324951171875 + "Scale": 0.6287510700734436, + "AnchorX": 206.75909423828125, + "AnchorY": -79.5227279663086 } } } @@ -1010,41 +1320,38 @@ }, { "Key": { - "id": 5752722374826 + "id": 748607953970 }, "Value": { "ComponentData": { "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { "$type": "NodeSaveData" }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 40.0, - 80.0 - ] - }, - "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { - "$type": "EBusHandlerNodeDescriptorSaveData", - "EventIds": [ - { - "Value": 245425936 - } + 1160.0, + 140.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{856AC888-5242-45FE-98C8-9551CDF90181}" + "PersistentId": "{CAA0267A-E7EA-44EC-BD83-523ACFF940EF}" } } } }, { "Key": { - "id": 5757017342122 + "id": 752902921266 }, "Value": { "ComponentData": { @@ -1053,28 +1360,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "LogicNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 860.0, - 160.0 + 380.0, + 140.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{8784A9E8-C08C-4833-8707-522A51518804}" + "PersistentId": "{98476AAD-4352-4408-BBBC-FDDA49B35675}" } } } }, { "Key": { - "id": 5761312309418 + "id": 757197888562 }, "Value": { "ComponentData": { @@ -1083,29 +1391,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "DefaultNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 380.0, - 140.0 + 1620.0, + 80.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{98476AAD-4352-4408-BBBC-FDDA49B35675}" + "PersistentId": "{A4F278B3-739C-41FD-B86E-C595CDE7B724}" } } } }, { "Key": { - "id": 5765607276714 + "id": 761492855858 }, "Value": { "ComponentData": { @@ -1114,29 +1421,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "LogicNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1160.0, - 140.0 + 860.0, + 160.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{CAA0267A-E7EA-44EC-BD83-523ACFF940EF}" + "PersistentId": "{8784A9E8-C08C-4833-8707-522A51518804}" } } } }, { "Key": { - "id": 5769902244010 + "id": 765787823154 }, "Value": { "ComponentData": { @@ -1150,8 +1456,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1620.0, - 160.0 + 2060.0, + 100.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1159,7 +1465,41 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{B99F9431-776B-4AB3-A837-C3EA12625D30}" + "PersistentId": "{D6CB7292-715A-4087-826E-CA637D30FDFA}" + } + } + } + }, + { + "Key": { + "id": 770082790450 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 40.0, + 80.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 245425936 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{856AC888-5242-45FE-98C8-9551CDF90181}" } } } @@ -1167,6 +1507,10 @@ ], "StatisticsHelper": { "InstanceCounter": [ + { + "Key": 2970552779286763396, + "Value": 1 + }, { "Key": 5842116761103598202, "Value": 1 From 56a293748dcb670a8d1664124b0298ee181fbf69 Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Thu, 17 Mar 2022 17:02:17 -0700 Subject: [PATCH 70/71] Copy config files and images from AutomatedTesting to MultiplayerSample to fix the iOS image asset issue during the build Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- .../Contents.json | 202 +++++------- .../AppIcon.appiconset/iPadAppIcon152x152.png | 3 + .../AppIcon.appiconset/iPadAppIcon76x76.png | 3 + .../iPadProAppIcon167x167.png | 3 + .../iPadSettingsIcon29x29.png | 3 + .../iPadSettingsIcon58x58.png | 3 + .../iPadSpotlightIcon40x40.png | 3 + .../iPadSpotlightIcon80x80.png | 3 + .../iPhoneAppIcon120x120.png | 3 + .../iPhoneAppIcon180x180.png | 3 + .../iPhoneSettingsIcon58x58.png | 3 + .../iPhoneSettingsIcon87x87.png | 3 + .../iPhoneSpotlightIcon120x120.png | 3 + .../iPhoneSpotlightIcon80x80.png | 3 + .../iPadAppIcon152x152.png | 3 - .../iPadAppIcon76x76.png | 3 - .../iPadProAppIcon167x167.png | 3 - .../iPadSettingsIcon29x29.png | 3 - .../iPadSettingsIcon58x58.png | 3 - .../iPadSpotlightIcon40x40.png | 3 - .../iPadSpotlightIcon80x80.png | 3 - .../iPhoneAppIcon120x120.png | 3 - .../iPhoneAppIcon180x180.png | 3 - .../iPhoneSettingsIcon58x58.png | 3 - .../iPhoneSettingsIcon87x87.png | 3 - .../iPhoneSpotlightIcon120x120.png | 3 - .../iPhoneSpotlightIcon80x80.png | 3 - .../IOSLauncher/Images.xcassets/Contents.json | 6 - .../LaunchImage.launchimage/Contents.json | 293 ++++++++---------- .../iPadLaunchImage1024x768.png | 4 +- .../iPadLaunchImage1536x2048.png | 4 +- .../iPadLaunchImage2048x1536.png | 4 +- .../iPadLaunchImage768x1024.png | 4 +- .../iPhoneLaunchImage640x1136.png | 4 +- .../iPhoneLaunchImage640x960.png | 4 +- .../Contents.json | 86 +++++ .../iPadAppIcon152x152.png | 3 + .../iPadAppIcon76x76.png | 3 + .../iPadProAppIcon167x167.png | 3 + .../iPadSettingsIcon29x29.png | 3 + .../iPadSettingsIcon58x58.png | 3 + .../iPadSpotlightIcon40x40.png | 3 + .../iPadSpotlightIcon80x80.png | 3 + .../iPhoneAppIcon120x120.png | 3 + .../iPhoneAppIcon180x180.png | 3 + .../iPhoneSettingsIcon58x58.png | 3 + .../iPhoneSettingsIcon87x87.png | 3 + .../iPhoneSpotlightIcon120x120.png | 3 + .../iPhoneSpotlightIcon80x80.png | 3 + 49 files changed, 386 insertions(+), 342 deletions(-) rename Gem/Resources/IOSLauncher/Images.xcassets/{CMakeTestbedAppIcon.appiconset => AppIcon.appiconset}/Contents.json (72%) create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon152x152.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon76x76.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadProAppIcon167x167.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon29x29.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon58x58.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon40x40.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon80x80.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon120x120.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon180x180.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon58x58.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon87x87.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon120x120.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon80x80.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadAppIcon152x152.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadAppIcon76x76.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadProAppIcon167x167.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSettingsIcon29x29.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSettingsIcon58x58.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSpotlightIcon40x40.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSpotlightIcon80x80.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneAppIcon120x120.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneAppIcon180x180.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSettingsIcon58x58.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSettingsIcon87x87.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSpotlightIcon120x120.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSpotlightIcon80x80.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/Contents.json create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/Contents.json create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadAppIcon152x152.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadAppIcon76x76.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadProAppIcon167x167.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSettingsIcon29x29.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSettingsIcon58x58.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSpotlightIcon40x40.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSpotlightIcon80x80.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneAppIcon120x120.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneAppIcon180x180.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSettingsIcon58x58.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSettingsIcon87x87.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSpotlightIcon120x120.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSpotlightIcon80x80.png diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/Contents.json b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 72% rename from Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/Contents.json rename to Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/Contents.json index 09621469c..c639f3ac5 100644 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/Contents.json +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,116 +1,86 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "iPhoneNotificationIcon40x40.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "iPhoneNotificationIcon60x60.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "iPhoneSettingsIcon58x58.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "iPhoneSettingsIcon87x87.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "iPhoneSpotlightIcon80x80.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "iPhoneSpotlightIcon120x120.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "iPhoneAppIcon120x120.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "iPhoneAppIcon180x180.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "iPadNotificationIcon20x20.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "iPadNotificationIcon40x40.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "iPadSettingsIcon29x29.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "iPadSettingsIcon58x58.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "iPadSpotlightIcon40x40.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "iPadSpotlightIcon80x80.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "iPadAppIcon76x76.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "iPadAppIcon152x152.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "iPadProAppIcon167x167.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "iOSAppStoreIcon1024x1024.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file +{ + "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "iPhoneSettingsIcon58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "iPhoneSettingsIcon87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "iPhoneSpotlightIcon80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "iPhoneSpotlightIcon120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "iPhoneAppIcon120x120.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "iPhoneAppIcon180x180.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "iPadSettingsIcon29x29.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "iPadSettingsIcon58x58.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "iPadSpotlightIcon40x40.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "iPadSpotlightIcon80x80.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "iPadAppIcon76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "iPadAppIcon152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "iPadProAppIcon167x167.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon152x152.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon152x152.png new file mode 100644 index 000000000..ad1889441 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon152x152.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebfc95bd4c0cbcc53d0ef9d314d26e09a347a22dabbf210597f405d9ed8646bf +size 7729 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon76x76.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon76x76.png new file mode 100644 index 000000000..888d8cf78 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon76x76.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99cb7da9282cfcfa64598455827f27ca6791d45ca0d2c3c2dc090d82468dac03 +size 4447 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadProAppIcon167x167.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadProAppIcon167x167.png new file mode 100644 index 000000000..86aa72016 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadProAppIcon167x167.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:101568e946f1d4cea86d666187bbf71116bbf62e6eaf6d80bc3c5e2e184bdb15 +size 7938 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon29x29.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon29x29.png new file mode 100644 index 000000000..79331c29b --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon29x29.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf930ffd4efb0b7b627e05aac6e0f56252ea206623e8b5d097d803aa315cdfb8 +size 1812 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon58x58.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon58x58.png new file mode 100644 index 000000000..27c4aaef2 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon58x58.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba5fea53b349e254b4625035a308d5731cb06f6d0adc278874d14db2627962cb +size 3424 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon40x40.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon40x40.png new file mode 100644 index 000000000..df1630a95 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon40x40.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf087f357cd439d14651073ac079542c60f0648a30dced2a8d19912124b3f8b6 +size 2310 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon80x80.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon80x80.png new file mode 100644 index 000000000..4b7f5d631 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon80x80.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:421ad4db14c28ed18666158f9ec30747c5b8c757405c1efb32442978911b0c06 +size 4437 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon120x120.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon120x120.png new file mode 100644 index 000000000..674c6da12 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon120x120.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d0044ebf7e0a5dd23ed64a1289c705d8f6c3c41a62d65e5a1371058855b8cec +size 6546 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon180x180.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon180x180.png new file mode 100644 index 000000000..c0c10c239 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon180x180.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b8717c5f2109dfce1bf7b017278059d4915b524a6eb7e83cfb1926e54ed6869 +size 7383 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon58x58.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon58x58.png new file mode 100644 index 000000000..27c4aaef2 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon58x58.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba5fea53b349e254b4625035a308d5731cb06f6d0adc278874d14db2627962cb +size 3424 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon87x87.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon87x87.png new file mode 100644 index 000000000..9093e1386 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon87x87.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a32908a839a6cb0ca2a76d6aa60376ba8a14b4428f06c13149ec277514eb5676 +size 4533 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon120x120.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon120x120.png new file mode 100644 index 000000000..674c6da12 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon120x120.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d0044ebf7e0a5dd23ed64a1289c705d8f6c3c41a62d65e5a1371058855b8cec +size 6546 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon80x80.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon80x80.png new file mode 100644 index 000000000..4b7f5d631 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon80x80.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:421ad4db14c28ed18666158f9ec30747c5b8c757405c1efb32442978911b0c06 +size 4437 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadAppIcon152x152.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadAppIcon152x152.png deleted file mode 100644 index b0dd493c1..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadAppIcon152x152.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e4901093fa6190bf37291b0fb6de23fba1be8ebbd742775a8565a4106722fbb6 -size 31942 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadAppIcon76x76.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadAppIcon76x76.png deleted file mode 100644 index 21aa62e96..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadAppIcon76x76.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e4ae97c4f44910121a61686862c8342ce598db4cdf9d46b29e96d3cb9e43bd06 -size 22158 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadProAppIcon167x167.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadProAppIcon167x167.png deleted file mode 100644 index 6b696a84b..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadProAppIcon167x167.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:061e2d0ce8dc852dd298c80f2aed5fee8ea4b87511c00662aa2d00922c0ba3c2 -size 30162 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSettingsIcon29x29.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSettingsIcon29x29.png deleted file mode 100644 index f3dfa0583..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSettingsIcon29x29.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0fb4b4b77620d99dae7473b7bd8affe14630419835bd5719167ed200e657fa4f -size 17504 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSettingsIcon58x58.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSettingsIcon58x58.png deleted file mode 100644 index 5325b805f..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSettingsIcon58x58.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8aa9b1194f3244025578225a6a87cbc2dd12c70955ff615c8af640ea7f1334f1 -size 19619 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSpotlightIcon40x40.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSpotlightIcon40x40.png deleted file mode 100644 index 98d845583..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSpotlightIcon40x40.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0c25ffb1af8160b3202977de8c32aaa235e22c643ffd8004e4546c96868ef3b9 -size 18317 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSpotlightIcon80x80.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSpotlightIcon80x80.png deleted file mode 100644 index 7482f6c89..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPadSpotlightIcon80x80.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2db961b8f922a552d8ad374fdb56029efd4049a6cde10399b3d961242c82ce53 -size 22571 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneAppIcon120x120.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneAppIcon120x120.png deleted file mode 100644 index da987b86f..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneAppIcon120x120.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f39d897a57d4da0a70ede7c91339660b28e9d8c57b3e7d749807b13baa4b85f3 -size 28559 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneAppIcon180x180.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneAppIcon180x180.png deleted file mode 100644 index 205e025c3..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneAppIcon180x180.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:263b75d58328499eef1f8fa2e64c30706f546badcc0c4464a043b231da93cd0d -size 34969 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSettingsIcon58x58.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSettingsIcon58x58.png deleted file mode 100644 index 0deb4f4f3..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSettingsIcon58x58.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33522ad8a8e826b22dd9ad214f56e63e24bf55c00bd8c845925d848b855dfb48 -size 19619 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSettingsIcon87x87.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSettingsIcon87x87.png deleted file mode 100644 index 78591751d..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSettingsIcon87x87.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f405c9f3d908d038aea26049e533b0d10955adfac370c7b3b80209997ea706d0 -size 24407 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSpotlightIcon120x120.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSpotlightIcon120x120.png deleted file mode 100644 index 034dcb9fe..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSpotlightIcon120x120.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d110f6e151799a2327bcdf5ef94d6fc82b114783a8cc973a8915896679ba4a80 -size 28559 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSpotlightIcon80x80.png b/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSpotlightIcon80x80.png deleted file mode 100644 index f0fa89149..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/CMakeTestbedAppIcon.appiconset/iPhoneSpotlightIcon80x80.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:db8f00568fad4e49b05249aaa7a48c9fbf85c8b7a78489c83dc9b8161778bcef -size 22571 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/Contents.json b/Gem/Resources/IOSLauncher/Images.xcassets/Contents.json deleted file mode 100644 index 73c00596a..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json index f836f07ee..2c0906a94 100644 --- a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json +++ b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -1,169 +1,124 @@ -{ - "images" : [ - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "2436h", - "filename" : "iPhoneLaunchImage1125x2436.png", - "minimum-system-version" : "11.0", - "orientation" : "portrait", - "scale" : "3x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "2436h", - "filename" : "iPhoneLaunchImage2436x1125.png", - "minimum-system-version" : "11.0", - "orientation" : "landscape", - "scale" : "3x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "736h", - "filename" : "iPhoneLaunchImage1242x2208.png", - "minimum-system-version" : "8.0", - "orientation" : "portrait", - "scale" : "3x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "736h", - "filename" : "iPhoneLaunchImage2208x1242.png", - "minimum-system-version" : "8.0", - "orientation" : "landscape", - "scale" : "3x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "667h", - "filename" : "iPhoneLaunchImage750x1334.png", - "minimum-system-version" : "8.0", - "orientation" : "portrait", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "iPhoneLaunchImage640x960.png", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "retina4", - "filename" : "iPhoneLaunchImage640x1136.png", - "minimum-system-version" : "7.0", - "orientation" : "portrait", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "filename" : "iPadLaunchImage768x1024.png", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "filename" : "iPadLaunchImage1024x768.png", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "filename" : "iPadLaunchImage1536x2048.png", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "filename" : "iPadLaunchImage2048x1536.png", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "iPhoneLaunchImage640x960.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "retina4", + "filename" : "iPhoneLaunchImage640x1136.png", + "minimum-system-version" : "7.0", + "orientation" : "portrait", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "iPadLaunchImage768x1024.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "iPadLaunchImage1024x768.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "iPadLaunchImage1536x2048.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "iPadLaunchImage2048x1536.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png index 1249ef370..9f586d6af 100644 --- a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png +++ b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:31afa7ed44c5d9844c8d6ce08beccac482c3f43590869a3d190d06e2df377ccc -size 137472 +oid sha256:a4018d9df45b4a04d4cf24a40fe01aa7e30e44a9fdd8ad9a41b0d87791786c12 +size 30442 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png index cdb6d5a82..c978631c2 100644 --- a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png +++ b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0aac8ef9899442820bec0df8bf6434a46cc787d57c5d6d38a04727b8dc310048 -size 338281 +oid sha256:2eea06cb8ad05acefe9664551af5645d52d9763b82473b1fd4a2b2b6f62e96d3 +size 53550 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png index 954d3084c..a52e832a4 100644 --- a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png +++ b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c07495891f15b138ba09f142777b0f43217bf8be05cbb74ba938319f3425980c -size 321125 +oid sha256:90991aca91ab7222fdb85c03947cff38f549a6492551e7447e0c8f55022aae48 +size 52467 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png index 021319fbc..3e441fab3 100644 --- a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png +++ b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d6bf6acb92421a453a36fc143ab6cefda14d631ea5e6dbf95c6e252a445fcbac -size 144797 +oid sha256:6c8439a64d18dbff17dd67f6405bf49f99695e9b22fc2cc541dc72c6e3167307 +size 30564 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png index a15fd777f..e662e9675 100644 --- a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png +++ b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e9ad650fda925b1c076a67d1ef70315fe4f14db888c9fd36ee4eba1d18c1e7d1 -size 166749 +oid sha256:f752615184160d7a78f28d9eef354c86e544f11eb1dde9f651d7acd315b3f2e6 +size 35934 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png index 2855f4069..2753529fc 100644 --- a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png +++ b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:16f6e9d7bd15fc528d934c252213de8792812e708b1810191c5f1767f7165852 -size 142331 +oid sha256:1a43f1d893e85aa99d335a657ec0f6c13a741db976c033451ab9a2328b8a5970 +size 35559 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/Contents.json b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/Contents.json new file mode 100644 index 000000000..c639f3ac5 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/Contents.json @@ -0,0 +1,86 @@ +{ + "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "iPhoneSettingsIcon58x58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "iPhoneSettingsIcon87x87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "iPhoneSpotlightIcon80x80.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "iPhoneSpotlightIcon120x120.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "iPhoneAppIcon120x120.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "iPhoneAppIcon180x180.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "iPadSettingsIcon29x29.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "iPadSettingsIcon58x58.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "iPadSpotlightIcon40x40.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "iPadSpotlightIcon80x80.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "iPadAppIcon76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "iPadAppIcon152x152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "iPadProAppIcon167x167.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadAppIcon152x152.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadAppIcon152x152.png new file mode 100644 index 000000000..ad1889441 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadAppIcon152x152.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebfc95bd4c0cbcc53d0ef9d314d26e09a347a22dabbf210597f405d9ed8646bf +size 7729 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadAppIcon76x76.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadAppIcon76x76.png new file mode 100644 index 000000000..888d8cf78 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadAppIcon76x76.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99cb7da9282cfcfa64598455827f27ca6791d45ca0d2c3c2dc090d82468dac03 +size 4447 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadProAppIcon167x167.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadProAppIcon167x167.png new file mode 100644 index 000000000..86aa72016 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadProAppIcon167x167.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:101568e946f1d4cea86d666187bbf71116bbf62e6eaf6d80bc3c5e2e184bdb15 +size 7938 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSettingsIcon29x29.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSettingsIcon29x29.png new file mode 100644 index 000000000..79331c29b --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSettingsIcon29x29.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf930ffd4efb0b7b627e05aac6e0f56252ea206623e8b5d097d803aa315cdfb8 +size 1812 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSettingsIcon58x58.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSettingsIcon58x58.png new file mode 100644 index 000000000..27c4aaef2 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSettingsIcon58x58.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba5fea53b349e254b4625035a308d5731cb06f6d0adc278874d14db2627962cb +size 3424 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSpotlightIcon40x40.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSpotlightIcon40x40.png new file mode 100644 index 000000000..df1630a95 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSpotlightIcon40x40.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf087f357cd439d14651073ac079542c60f0648a30dced2a8d19912124b3f8b6 +size 2310 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSpotlightIcon80x80.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSpotlightIcon80x80.png new file mode 100644 index 000000000..4b7f5d631 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPadSpotlightIcon80x80.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:421ad4db14c28ed18666158f9ec30747c5b8c757405c1efb32442978911b0c06 +size 4437 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneAppIcon120x120.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneAppIcon120x120.png new file mode 100644 index 000000000..674c6da12 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneAppIcon120x120.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d0044ebf7e0a5dd23ed64a1289c705d8f6c3c41a62d65e5a1371058855b8cec +size 6546 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneAppIcon180x180.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneAppIcon180x180.png new file mode 100644 index 000000000..c0c10c239 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneAppIcon180x180.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b8717c5f2109dfce1bf7b017278059d4915b524a6eb7e83cfb1926e54ed6869 +size 7383 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSettingsIcon58x58.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSettingsIcon58x58.png new file mode 100644 index 000000000..27c4aaef2 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSettingsIcon58x58.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba5fea53b349e254b4625035a308d5731cb06f6d0adc278874d14db2627962cb +size 3424 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSettingsIcon87x87.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSettingsIcon87x87.png new file mode 100644 index 000000000..9093e1386 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSettingsIcon87x87.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a32908a839a6cb0ca2a76d6aa60376ba8a14b4428f06c13149ec277514eb5676 +size 4533 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSpotlightIcon120x120.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSpotlightIcon120x120.png new file mode 100644 index 000000000..674c6da12 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSpotlightIcon120x120.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d0044ebf7e0a5dd23ed64a1289c705d8f6c3c41a62d65e5a1371058855b8cec +size 6546 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSpotlightIcon80x80.png b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSpotlightIcon80x80.png new file mode 100644 index 000000000..4b7f5d631 --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/iPhoneSpotlightIcon80x80.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:421ad4db14c28ed18666158f9ec30747c5b8c757405c1efb32442978911b0c06 +size 4437 From 3f1497c2bea72cc22c6946db3147d066daa1242b Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Fri, 18 Mar 2022 12:11:58 -0700 Subject: [PATCH 71/71] Copy config files and icons from default project template Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- .../AppIcon.appiconset/Contents.json | 86 ------------------- .../AppIcon.appiconset/iPadAppIcon152x152.png | 3 - .../AppIcon.appiconset/iPadAppIcon76x76.png | 3 - .../iPadProAppIcon167x167.png | 3 - .../iPadSettingsIcon29x29.png | 3 - .../iPadSettingsIcon58x58.png | 3 - .../iPadSpotlightIcon40x40.png | 3 - .../iPadSpotlightIcon80x80.png | 3 - .../iPhoneAppIcon120x120.png | 3 - .../iPhoneAppIcon180x180.png | 3 - .../iPhoneSettingsIcon58x58.png | 3 - .../iPhoneSettingsIcon87x87.png | 3 - .../iPhoneSpotlightIcon120x120.png | 3 - .../iPhoneSpotlightIcon80x80.png | 3 - .../IOSLauncher/Images.xcassets/Contents.json | 6 ++ .../LaunchImage.launchimage/Contents.json | 47 +++++++++- .../Contents.json | 32 ++++++- 17 files changed, 83 insertions(+), 127 deletions(-) delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon152x152.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon76x76.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadProAppIcon167x167.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon29x29.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon58x58.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon40x40.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon80x80.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon120x120.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon180x180.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon58x58.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon87x87.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon120x120.png delete mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon80x80.png create mode 100644 Gem/Resources/IOSLauncher/Images.xcassets/Contents.json diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/Contents.json b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index c639f3ac5..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "images" : [ - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "iPhoneSettingsIcon58x58.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "iPhoneSettingsIcon87x87.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "iPhoneSpotlightIcon80x80.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "iPhoneSpotlightIcon120x120.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "iPhoneAppIcon120x120.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "iPhoneAppIcon180x180.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "iPadSettingsIcon29x29.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "iPadSettingsIcon58x58.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "iPadSpotlightIcon40x40.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "iPadSpotlightIcon80x80.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "iPadAppIcon76x76.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "iPadAppIcon152x152.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "iPadProAppIcon167x167.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon152x152.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon152x152.png deleted file mode 100644 index ad1889441..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon152x152.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ebfc95bd4c0cbcc53d0ef9d314d26e09a347a22dabbf210597f405d9ed8646bf -size 7729 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon76x76.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon76x76.png deleted file mode 100644 index 888d8cf78..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon76x76.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:99cb7da9282cfcfa64598455827f27ca6791d45ca0d2c3c2dc090d82468dac03 -size 4447 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadProAppIcon167x167.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadProAppIcon167x167.png deleted file mode 100644 index 86aa72016..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadProAppIcon167x167.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:101568e946f1d4cea86d666187bbf71116bbf62e6eaf6d80bc3c5e2e184bdb15 -size 7938 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon29x29.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon29x29.png deleted file mode 100644 index 79331c29b..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon29x29.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cf930ffd4efb0b7b627e05aac6e0f56252ea206623e8b5d097d803aa315cdfb8 -size 1812 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon58x58.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon58x58.png deleted file mode 100644 index 27c4aaef2..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon58x58.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba5fea53b349e254b4625035a308d5731cb06f6d0adc278874d14db2627962cb -size 3424 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon40x40.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon40x40.png deleted file mode 100644 index df1630a95..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon40x40.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cf087f357cd439d14651073ac079542c60f0648a30dced2a8d19912124b3f8b6 -size 2310 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon80x80.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon80x80.png deleted file mode 100644 index 4b7f5d631..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon80x80.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:421ad4db14c28ed18666158f9ec30747c5b8c757405c1efb32442978911b0c06 -size 4437 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon120x120.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon120x120.png deleted file mode 100644 index 674c6da12..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon120x120.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0d0044ebf7e0a5dd23ed64a1289c705d8f6c3c41a62d65e5a1371058855b8cec -size 6546 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon180x180.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon180x180.png deleted file mode 100644 index c0c10c239..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon180x180.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3b8717c5f2109dfce1bf7b017278059d4915b524a6eb7e83cfb1926e54ed6869 -size 7383 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon58x58.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon58x58.png deleted file mode 100644 index 27c4aaef2..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon58x58.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba5fea53b349e254b4625035a308d5731cb06f6d0adc278874d14db2627962cb -size 3424 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon87x87.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon87x87.png deleted file mode 100644 index 9093e1386..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon87x87.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a32908a839a6cb0ca2a76d6aa60376ba8a14b4428f06c13149ec277514eb5676 -size 4533 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon120x120.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon120x120.png deleted file mode 100644 index 674c6da12..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon120x120.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0d0044ebf7e0a5dd23ed64a1289c705d8f6c3c41a62d65e5a1371058855b8cec -size 6546 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon80x80.png b/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon80x80.png deleted file mode 100644 index 4b7f5d631..000000000 --- a/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon80x80.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:421ad4db14c28ed18666158f9ec30747c5b8c757405c1efb32442978911b0c06 -size 4437 diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/Contents.json b/Gem/Resources/IOSLauncher/Images.xcassets/Contents.json new file mode 100644 index 000000000..b2cf3951c --- /dev/null +++ b/Gem/Resources/IOSLauncher/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json index 2c0906a94..33464839d 100644 --- a/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json +++ b/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -1,5 +1,50 @@ { "images" : [ + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "2436h", + "filename" : "iPhoneLaunchImage1125x2436.png", + "minimum-system-version" : "11.0", + "orientation" : "portrait", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "2436h", + "filename" : "iPhoneLaunchImage2436x1125.png", + "minimum-system-version" : "11.0", + "orientation" : "landscape", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "736h", + "filename" : "iPhoneLaunchImage1242x2208.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "736h", + "filename" : "iPhoneLaunchImage2208x1242.png", + "minimum-system-version" : "8.0", + "orientation" : "landscape", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "667h", + "filename" : "iPhoneLaunchImage750x1334.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "2x" + }, { "orientation" : "portrait", "idiom" : "iphone", @@ -121,4 +166,4 @@ "version" : 1, "author" : "xcode" } -} +} \ No newline at end of file diff --git a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/Contents.json b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/Contents.json index c639f3ac5..ca307f412 100644 --- a/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/Contents.json +++ b/Gem/Resources/IOSLauncher/Images.xcassets/MultiplayerSampleAppIcon.appiconset/Contents.json @@ -1,5 +1,17 @@ { "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "iPhoneNotificationIcon40x40.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "iPhoneNotificationIcon60x60.png", + "scale" : "3x" + }, { "size" : "29x29", "idiom" : "iphone", @@ -36,6 +48,18 @@ "filename" : "iPhoneAppIcon180x180.png", "scale" : "3x" }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "iPadNotificationIcon20x20.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "iPadNotificationIcon40x40.png", + "scale" : "2x" + }, { "size" : "29x29", "idiom" : "ipad", @@ -77,10 +101,16 @@ "idiom" : "ipad", "filename" : "iPadProAppIcon167x167.png", "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "iOSAppStoreIcon1024x1024.png", + "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } -} +} \ No newline at end of file