jnorman-us / broadside.io

Another old repo from college. Not finished

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broadside.IO Github Repository

...is a MOBA/RTS style game. Read the game concept document: Google Doc

Code Documentation

Because this is a web-based .IO game, the frontend code has to be written in HTML/CSS/JS. We chose node.js for our project so that we could have uniformity between the frontend and backend code. So this is your typical MERN stack project:

  • MongoDB
  • Express JS
  • React JS
  • Node JS

Installation

Because everything is based around node.js, installation of the project is rather simple.

1. Installing Node.js

First, we'll go ahead and install node.js version 13.14.0 from this website: nodejs.org. Download the version for your operating system. Once installed, you should have nodejs v13.14.0 and npm v6.14.4.

2. Cloning the Git Repository

Second, clone the repository from git using the following command in Git Bash.

git clone https://github.com/josephnormandev/broadside.io.git

3. Installing all of the Dependencies

Because we're using NPM (node package manager), keeping track of dependencies is extremely simple. In your command prompt, navigate to the directory you just cloned (should be called broadside.io). Then descend into the following folders and execute the commands:

broadside.io/frontend

npm i

broadside.io/server

npm i

It's that easy!

4. Downloading the config.json file

The config.json file contains passwords to the database, default port numbers, and paths for certain files. There is a version for our own personal development use and another version for the production server. Here's the link for the config.json


Then, paste that file into: broadside.io/server/config.json

5. Executing the Program

Because we're using NPM, running a simple command can launch the server locally.


In a terminal window, navigate to broadside.io/server and execute this command:

npm start

Then in a second terminal window, navigate to broadside.io/frontend and execute this command:

npm start

Do not close these windows because they are both actively hosting the development server, which has two parts:

  1. The backend, started by the first command
  2. The frontend, started by the second command

That's all there is to it. If you want to see what's being hosted, go to your web browser and navigate to the following URL

Structure

This project has been split up into several different parts because of the different functions that the code must accomplish:

  1. Frontend is the client code that is run on everyone's browser as a webpage. This code contains different React user interfaces for logging in, registering, queueing, and playing the game. There is game code on here that is only used to render the game state as received from the server.
  2. Game is OUTDATED, but it used to be the common library that held the playable game. This would be hosted in the Server code and played on the Frontend code. Since the Frontend is inherently different from the Server, I decided to split the code base, so this is just legacy code.
  3. Server is the code that is run remotely on a host server. This code contains the API for keeping track of players, and contains game instances. Each game instance has a few players connected to it and a physics engine to keep track of the game state.
  4. Terrain-Generator uses a simple noise map generator to create terrain in a digestible json format. This is only temporary code because terrains will have to be generated by hand in the future. But it's here for testing until we get maps designed.

For a production build, the React Frontend can be compiled and served by the Server. This Frontend/Server unit is what is currently running on jnorman.dev and forms a part in this expandable structure:

Frontend

About

Another old repo from college. Not finished


Languages

Language:JavaScript 98.8%Language:HTML 1.2%