Welcome to the "Game". At the moment there is no good name for this project because it seems to be very difficult to find one. If you have a good and unique name feel free to tell it to us.
- The Idea of the Game
- Architecture of the Game
- Getting started
- Development CLI
- Toolchain
- Best practices
Planed is a MMORPG which takes place on an infinite procedural generated map. On this map are some predefined cities which have a certain amount of players can start in. If the amount is reached a new city will be created.
There are also generated caves, rivers biomes and resources which the players can use to discover and experience the map or to build things like bridges, armors, potions or other interesting things.
To have a little bit more action in the game there will be special places called instances which offers special challenges and teamwork with other players. There are also bosses which can drop some items of interests.
In this case the player itself is a godlike creature like in Dungeon Keeper or War for the overworld and commands his own creatures like skeletons, orcs or other crazy creatures and especially a unique mastermonster which can learn everything if it is possible in this game. This will use an artificial neural network so that the player can tell the monster what is right and what is wrong.
Every monster has it's unique skill in fighting, profession and behavior which includes interaction with other monsters. The player can tell a monster what to do in a way like SIMS does. This offers especially in a fighting situation much more possibilities to act strategical than in other real time strategy games.
To manage all these creatures, the player builds a dungeon with a core where the monsters can life and work for the player. But it should also be possible to play as a caravan, which carries the core through the world instead of building a dungeon. To create necessary things the player can build in this case a temporary base.
The focus in this game should be on:
- Interaction with the environment and monsters
- Beauty and pragmatism of the dungeon or caravan
- Success in instances
- Alliances with other players, especially for caravans
- Crafting including the dismantling of resources
- Trading with other players and even individual monsters
- Trading among the monsters itself
and way more which can be read in the WIKI
The Game will be a browser game based on TypeScript/AssemblyScript/JavaScript/WebAssembly, WebGL, WebAudio, ServiceWorker, WebRTC, WebSockets and the libraries Three.js or Babylon.js. Which library will be taken depends on number of tutorials, simplicity and possibilities.
Most of the communication for this game should be among the clients via WebRTC to reduce the server load and outsourcing complex calculation which appears very often. To improve the performance on client side, we will use ServiceWorkers and WebWorkers. ServiceWorkers for caching and faster startup of the mobile app via manifest file and WebWorkers for multi threading. Very complex calculations should also be compiled to WebAssembly on client and server side. for this we use AssemblyScript.
Another speedup will be Redis which will be used as a cache, session storage and many other temporary things.
To persist the data we will use ArangoDB.
-
Install Docker (on your subsystem and native OS):
-
install NodeJS:
Windows and MacOS user download the installer: https://nodejs.org/en/
Linux users do the following:
sudo apt-get install curl curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash - sudo apt-get install -y nodejs
or do this installation instructions.
-
Configure git:
git config --global pull.rebase true git config --global core.autocrlf false git config --global user.name "<first name> <last name>" git config --global user.email "<email>"
-
Create SSH key if you use SSH:
ssh-keygen -t rsa -C "<your email>"
-
Clone the repository:
git clone https://github.com/Eluminati/Game.git .
- Notice the "." at the End. It is best to clone it in a folder named Game
-
Change into the Game directory:
cd Game
-
Install the Project:
node setup.js -i
-
start the development server:
npm run dev
-
start the application:
npm start
"That's it!"... I know this is much to do but after this it works everywhere in the exact same way and we will use a linux as production os!
To start the app type: npm start
and to stop the app just interrupt it. Have a
look to the package.json to see the start and stop scripts.
npm run dev:cli
can be used to manage your dev deployment of game
.
npm run dev:cli up
creates / updates it.npm run dev:cli down
destroys it.npm run dev:cli stop
stops it (not supported in Swarm mode).npm run dev:cli ps
prints the currently running services.npm run dev:cli logs
prints the logs. Use-f
to follow.
By default, npm run dev:cli
uses docker-compose
.
Since it does not support clustering, you can add the --swarm
flag, which will switch to Docker Swarm mode.
This some downsides: Volumes are not supported and the Docker image needs to be rebuilt on each change.
To get the best development experience you should install available plugins for your editor, which we are using here.
-
Should be available in your IDE
- EditorConfig: Everyone should use the same Configuration for the editor
- Prettier (Atom | VSCode): Beautyfies your code on save if configured
- ESLint (Atom | VSCode): Write well formatted code in JavaScript and TypeScript. Please configure your ESLint to support TypeScript in your IDE
- typescript (Atom): Better intellisense while writing Typescript and AssemblyScript
- Mocha (Atom | VSCode): There are some perfect sidebars available for VSCode
- Grunt (Atom): Start a Grunt task in an easy and fast way
-
Can be available in your IDE
-
Some of your best friends
- Redis Commander: View the current content of the redis cache
- Integrated terminal (Atom): This is very useful because of the used subsystem and less opened windows
-
Because there is a commit hook which checks every function and property for a doc string, it happens sometimes that a developer writes nonesense in the documentation. This doc strings will later be used for a documentation WIKI so it is very important to write useful and correct documentation especially for newcomers to have a easy introduction to this project.
-
When you create a new directory remember to create a
README.md
which contains documentation for:- What is contained in there
- What is the intention of this directory/package
- Is it hard linked to somewhere
So everyone can understand the project structure.
-
Remember that there are several root directories
- Project root
- output root
- source root
Depending on what you are planing to do, choose the nearest path.
-
Write tests for your new component or change tests if you changed a component.
-
Create junctions for every directory in the output directory to the source directory if it is noticed in the corresponding
README.md
. So you have all resources available in your source folder and you are not forced to change the environment (This will happen automatically later). -
When you install a new package, write it in to the
package.json
by using the--save
or--save-dev
. After you pushed your changes and another one pulls your changes, the new dependencies will be added, removed or updated. -
Since we are using TypeScript/AssemblyScript remember to install the corresponding type definition via
npm i @types/<package> --save-dev