sg495 593be7624e Implemented selective loading/unloading of worlds. Summary of changes:
1. Database is now iteratively updated, rather than dropped and recreated every time the universe is saved.
2. A single connection to the database is opened at server creation time, and used throughout.
3. Worlds, users and server information are now stored with appropriate IDs, so that they can be suitably updated. The world ID can be computed from world coordinates alone.
4. After saving, a world is unloaded from memory if it doesn't contain any updatable objects, and if all of its neighbours are either:  (i) uncharted; (ii) not loaded in memory; (iii) without any updatable objects. This ensures that world unloading/reloading cannot be spammed by a single bot repeatedly transitioning in/out of an otherwise empty world.
5. The instance method GameUniverse.getWorld(int,int,boolean) first checks the world with given coordinates is in memory, then tries to load it from database, and only then creates a new one (if required by the boolean flag).
6. Worlds are now stored in a Hashtable indexed by world ID, for faster retrieval.
2018-01-08 18:23:10 +01:00
2018-01-04 17:49:02 +11:00
2017-12-29 10:00:19 -06:00
2018-01-03 20:07:48 -05:00
2017-12-31 08:34:17 +00:00
2017-11-12 09:32:08 -05:00

Live demo

Program the 8086-like microprocessor of a robot in a grid-based multiplayer world. The game is web based so no installation is required. In its current state, players can walk around the game universe and collect Biomass blobs & Iron/copper ore using the online code editor.

screenshot from 2017-11-12 13-01-43

Wiki: GitHub Chat: Slack

VS Code Extensions

Deploying the server

Note: You can find the frontend here

Linux (Ubuntu 16.04)

# Install tools
sudo apt install git maven openjdk-8-jdk

# Obtain source files
git clone https://github.com/simon987/Much-Assembly-Required.git

# Build
cd Much-Assembly-Required
mvn package

# Run
cd target
java -jar server-1.2a.jar

Windows (tested on Windows 10)

Installation instructions:

  1. Download the JDK from here. Install the JDK and update your PATH and JAVA_HOME enviroment variables.
  2. Download Maven from here. Install Maven (following the README) and update your PATH enviroment variable.
  3. Download Mongo DB Community from here. Install Mongo DB following the instructions here. Update your PATH enviroment variable.

Building instructions:

:: Builds the server
cd Much-Assembly-Required
mvn package

Running instructions:

  1. In one Command Prompt window, run Mongo DB:
:: Runs Mongo DB
mongod
  1. In a second Command Prompt window, run the MAR server:
:: Runs the MAR server
cd Much-Assembly-Required\target
java -jar server-1.2a.jar
  1. Run the frontend, following the instructions that you can find here.

Docker

Requirements

  1. Docker Compose (and dependencies)

Installation

Once Docker and Docker Compose are installed, you can build and start this application by running the following command inside this application's directory:

docker-compose up

This will start MySQL and then build and run this application. It will be available via http://localhost.

Note that there is currently no frontend web application serving the WebSocket feed served by the Server application!

Description
Languages
Java 87.3%
TypeScript 11.7%
CSS 0.9%