aws-samples / amazon-gamelift-unity

A multi-player game sample (server and client), developed with the Unity game engine, illustrating basic integration with Amazon GameLift. View the sample source code or build the project and experiment with game server deployment on the Amazon GameLift service.
Apache License 2.0
82 stars 22 forks source link

Automatic Build & Deploy scripts are not working with recent Unity versions #1

Closed Reelie closed 5 years ago

Reelie commented 5 years ago

Hello there! I'm new on the entire Gamelift technology, and I'm trying to learn how to use it with Unity. First of all, thanks for that wonderful project with a great step-by-step guide.

In your tutorial, it seems that the buildconfig.bat script is no longer working with the version on Unity I am currently using: 2019.1.4f1. Your script currently does the following when looking for the Unity.exe file in order to build the project:

IF EXIST "%ProgramFiles(x86)%\Unity\Editor\Unity.exe" SET UNITYEXE="%ProgramFiles(x86)%\Unity\Editor\Unity.exe" IF EXIST "%ProgramFiles%\Unity\Editor\Unity.exe" SET UNITYEXE="%ProgramFiles%\Unity\Editor\Unity.exe"

but my Unity EXE file is located at %ProgramFiles%\Unity\Hub\Editor\2019.1.4f1\Editor\Unity.exe. That being said, I managed to make it work so far by change that line of code.

However, when I'm trying to deploy a fleet on Gamelift, the script deploy.bat also encounters an error when trying to take the build result from the precedent step. That time, it's the --root-path %ABS_ROOT%\Output\Server\Image argument that causes a problem when executing the DeployTool.exe. Since this repertory doesn't exist in the 2019.1.4f1 project folder architecture, I couldn't manage to find what tweak I could do to make the script work because I don't know what the program wants to do with that folder.

Thanks a lot! -Élie

alanmur commented 5 years ago

Hello @Reelie , Do you have the output from the failing deploy.bat execution for me to look at? This will help me reproduce your problem and offer a fix. Thank you, Al Murray :) Amazon Game Tech

Reelie commented 5 years ago

It simply does not find the repertory passed in argument : %ABS_ROOT%\Output\Server\Image My guess is that the newest Unity versions doesn't build the same output than it did before.

Well, here's the error log I'm getting

Exception non gérée : System.IO.DirectoryNotFoundException: Impossible de trouver une partie du chemin d'accès '[...]\GameliftTesting\Output\Server\Image'. à System.IO.Error.WinIOError(Int32 errorCode, String maybeFullPath) à System.IO.FileSystemEnumerableIterator1.CommonInit() à System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) à System.IO.DirectoryInfo.EnumerateFileSystemInfos(String searchPattern, SearchOption searchOption) à System.IO.Compression.ZipFile.DoCreateFromDirectory(String sourceDirectoryName, String destinationArchiveFileName, Nullable1 compressionLevel, Boolean includeBaseDirectory, Encoding entryNameEncoding) à DeployTool.Program.ZipBuild(String rootpath) dans [...]\GameliftTesting\DeployTool\Program.cs:ligne 181 à DeployTool.Program.d4.MoveNext() dans [...]\GameliftTesting\DeployTool\Program.cs:ligne 154 --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée --- à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) à DeployTool.Program.d__3.MoveNext() dans [...]\GameliftTesting\DeployTool\Program.cs:ligne 109 --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée --- à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) à DeployTool.Program.Main(String[] args) dans [...]\GameliftTesting\DeployTool\Program.cs:ligne 26

Thank you! :) -Élie

Patryk-Szylin commented 5 years ago

Same problem here, @Reelie did you manage to fix it ?

Reelie commented 5 years ago

Not yet, I was still waiting for @alanmur to see if he can find a workaround if possible :)

alanmur commented 5 years ago

I am looking at this issue. Hopefully I should be able to resolve this week.

alanmur commented 5 years ago

Hey @Reelie and @Patryk-Szylin The latest commits now upgrades the project to Unity 2019.1.8f1 I trust this resolves your problem. Open a new issue if you have any problems. Al Murray :) Solutions Architect Amazon Game Tech