Code Monkey home page Code Monkey logo

Comments (2)

alanmur avatar alanmur commented on June 17, 2024

Hello, I tried to reproduce your issue, but I did not encounter it when I tried. I did log my repro steps (shown at the end of this post).
I don't know if you tried to build the project with the included build script. This automatically does some required steps, like downloading and building the GameLift SDK which is then put into the Assets\Plugins directory for use by Unity, and it also does a Unity build for both the game server and the game client. You are using a much newer version of Unity than the sample (or GameLift SDK) was created with, and Unity keeps making breaking changes, so keeping up with that can be a problem. I will list the steps you probably need to take, but include the steps I took for my own successful build as additional reference.

  1. Install Unity, and Visual Studio 2019 Community edition which the Unity installer includes as an option.
  2. Restart your computer to finish installation of Visual Studio 2019
  3. Run the Visual Studio 2019 installer, and make sure the .NET Desktop development workload is installed. Probably restart again.
  4. Clone the GitHub repository.
  5. Open the project in Unity using the Unity Hub to find it. (Ignore safe mode if it says anything about that, and do not try to build the player).
  6. Close Unity Editor.
  7. Run the Build\build.bat file.
  8. Everything should work. The result should look like this at the end.

BUILDING Server
The system cannot find the path specified.
USING "C:\Program Files\Unity\2021.1.26f1\Editor\Unity.exe" TO BUILD
BUILD COMPLETED SUCCESSFULLY. SEE C:\Users\alanmur\AppData\Local\Unity\Editor\Editor.log

BUILDING Client
The system cannot find the path specified.
USING "C:\Program Files\Unity\2021.1.26f1\Editor\Unity.exe" TO BUILD
BUILD COMPLETED SUCCESSFULLY. SEE C:\Users\alanmur\AppData\Local\Unity\Editor\Editor.log

IF you get the same error as I do in my STEP 11 below, then take the same steps (exactly) to remediate.

Then follow the rest of the instructions in the readme to deploy the server and connect using the client.

For additional reference, here are the steps that I took.

GOOD LUCK! Let me know if that helps, or if I can assist further.

  1. I downloaded the same version of Unity as you are using.

  2. I restarted the computer after Visual Studio 2019 Community had installed.

  3. I cloned the repository into a directory on my computer.

  4. I ran the Build\build.bat file in the terminal. This downloaded the GameLift Server SDK 4.0.0.
    This project targets .NET Framework 4.5, which is no longer supported with a Dev Pack.

  5. I opened the following file in the Visual Studio 2019 that was installed.
    aws-samples\amazon-gamelift-unity\SDK\GameLift_04_16_2020\GameLift-SDK-Release-4.0.0\GameLift-CSharp-ServerSDK-4.0.0\GameLiftServerSDKNet45.sln

  6. I chose to retarget the project to .NET 4.6.1. Visual Studio asked me to install the .NET for Desktop Visual Studio workload. (Weirdly enough this installed the .NET 4.5 targeting pack).

  7. I built the GameLift SDK in Visual Studio 2019 to validate that we are successful.

  8. I retargeted the GameLift SDK project BACK to 4.5, and it built now. You must already have got this far.

  9. I went back to the command line and ran the Build\build.bat file.

  10. buildconfig.bat couldn't find Unity. I manually set the file in buildconfig.bat by addiong this at line 86:

IF EXIST "%ProgramFiles%\Unity\2021.1.26f1\Editor\Unity.exe" SET UNITYEXE="%ProgramFiles%\Unity\2021.1.26f1\Editor\Unity.exe"
  1. I went back to the command line and ran the Build\build.bat file. I got this error in the Editor.log.

Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform. Only one assembly with the same name is allowed per platform. (C:/aws-samples/amazon-gamelift-unity/Library/PackageCache/[email protected]/Runtime/Newtonsoft.Json.dll)
Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform. Only one assembly with the same name is allowed per platform. (Assets/Plugins/Newtonsoft.Json.dll)
Scripts have compiler errors.

  1. To fix that, I went into aws-samples\amazon-gamelift-unity\Assets\Plugins and deleted the Newtonsoft.Json.dll.meta and Newtonsoft.Json.dll files.

  2. From the command line at aws-samples\amazon-gamelift-unity\Build I used
    buildconfig.bat Server
    to build the server (success). Capitalized S in Server is required!

  3. From the command line at aws-samples\amazon-gamelift-unity\Build I used
    buildconfig.bat Client
    to build the client (success). Capitalized C in Client is required.

The project build is complete now and you can deploy the server with the deploy.bat script according to the instructions in the readme.

from amazon-gamelift-unity.

EdevJogos avatar EdevJogos commented on June 17, 2024

Hi, thanks for the detailed guide, i'll try it out.

from amazon-gamelift-unity.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.