Skip to content

Compilation

Mark Guevara edited this page Mar 9, 2021 · 13 revisions

Client Compilation

Prebuilt versions are located here:

Windows: https://github.com/cs130-w21/13/tree/master/client/Builds/Windows

Mac: https://github.com/cs130-w21/13/tree/master/client/Builds/Mac.app/Contents

The client is written in Unity, a game engine which simplifies many actions in our game such as managing sprites on a screen and animating objects. While this proved useful for our project, it also makes compilation a very manual process, because Unity's CI/CD pipeline is a paid service and we are using the free version of the software.

To compile the client, you must first install the correct version of Unity: LTS Release 2019.4.18f1. This is most easily done by installing Unity Hub, a manager for multiple version installations of Unity, then finding the corresponding release version in this list of Unity Versions.

First, clone this repo onto your machine.

Once installed, within Unity Hub, press 'Add' and select the folder 13/client/CS130_Team13/ as the source folder for the project.

Now, you can open the project in Unity by selecting it in the Unity Hub menu.

One you have opened the project in Unity, you should see the project files open in your Unity editor.

To compile, select File -> Build Settings, select Scenes/OpenScene and Game, choose 'PC, Mac, & Linux Standalone' as your build platform, then press Build.

Note: You can also find a compiled version of the game on the repo.

Client Side communication Setup

Note: These are not needed to play the game anymore but to test the server on its own they will be needed..

How to start up this server

cd server ==> make sure that path ends with 13\server, or 13/server on UNIX npm install npm run watch-node

Multiplayer Development Instructions

In Unity, use ParallelSync to run two different clients with Debug at once If confused what it does, watch 4 minute video, https://www.youtube.com/watch?v=9r-hwXPJIMo&ab_channel=JasonWeimann, to understand On top bar in Unity, go to ParallelSync > Clones Manager > Add new clone > Open in New Editor

Server prep

Run npm install Run npm run watch-node everytime you want to reset the game (will be changed in future) In VSCode, you can have a terminal as part of the screen so that you don't have to have a thousand tabs Checkout index.ts, server.ts for the socket code (may possibly add other files in future) Modify server.ts (or add new ts files and import them in the index.ts file!)

Client Prep

Checkout Asset/Scripts/RemoteController script for client socket info (and change if you'd like) Run scene "Sockets" in both Unity's and check out Console for debug info Currently, RemoteController.cs is attached to the RemoteController GameObject

Run Tests

From 13\server, run npm test.