Skip to content

KTStephano/StarvationEvasion

 
 

Repository files navigation

Starvation Evasion Simulator, Server and Visualizer

JavaDoc

Table of Contents

  1. Overview
  2. [Compilation and Project Configuration](#Compilation and Project Configuration)
  3. [Starting up the Game](#Starting up the Game)

Overview

The Starvation Evasion Game is a multiplayer Client/Server game.
First, the server should be started on one machine. The server will create an instance of the simulator and manage client connections. The server then starts n=0 through 7 AI clients and waits for 7-n player client connections.

Each player client is started on a separate computer and connects to the server via TCP/IP.

Compilation and Project Configuration

  • Libraries: javafx-mx, sqlite-jdbc-3.8.11.2
  • Source Folders: src, libs
  • Resource Folders: data, assets
  • Run Folder: bin
  • Dependencies: JDK 1.8, javafx-mx, sqlite-jdbc-3.8.11.2

Starting up the Game

The client entry point is:
starvationevasion.client.UpdateLoop Running this should ask you for single or multi-player. Multi-player will attempt to connect to foodgame.cs.unm.edu:5555. Assuming the server is up and running, this will work.

Selecting single player requires that you first start a local server. the server entry point is: starvationevasion.server.Server. The default port is 5555.

Server

Take a look at it here.

Compiling A Lightweight Server.jar/Ai.jar

If you build a .jar file to run the server, as of writing it results in a .jar that is about 800 mb in size. To reduce the overhead in pushing updated Server.jar files to the repository, it is necessary to modify the result to include only what is needed.

  1. Build an executable .jar file that points to starvationevasion.server.Server
  2. Rename it "Server.jar" and move it to the top-level folder for the project (StarvationEvasion - not the package)
  3. Open Server.jar inside of something like 7zip so that you can modify its contents.
  4. Remove the following folders: ActionButtons, cardImages, farmProductIcons, sim/climate, visResources, starvationevasion/client
  5. Remove the following files: background.png, Mollweide_projection.jpg, WorldMap_MollweideProjection.png, WorldMap_MollweideProjection2.png, WorldMap_MollweideProjection_With_Region_Boarders_Added.png
  6. Remove any additional jars that are irrelevant, such as previous server or ai jars that you may have made in the past. These folders are usually found in your output file folder.

At the time of writing, this could reduce the .jar file from about 800 mb to ~15 mb. This makes it much more reasonable to rebuild and push to github.

Compiling Server.jar/Ai.jar Using ZipSurgeon

If you want to instead build the Server/AI jar files using the ZipSurgeon, first build an executable jar that points to starvationevasion.server.Server.

Go to starvationevasion.util.ZipSurgeon - open its command line arguments and add the following:

"" "" ""

The quotes enable you to insert file paths with spaces. When you run the ZipSurgeon, it will crawl through the existing executable jar and make a copy of it as it does this. It uses the blacklist file as a list ot keywords to help it figure out which zip entries to keep and which to ignore.

The blacklist file for building the Server/AI jars is called "ServerBlacklist.txt" and it is inside the root directory (StarvationEvasion).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 95.8%
  • JavaScript 2.1%
  • HTML 1.6%
  • Other 0.5%