Add README entry regarding formatting

This commit is contained in:
Telokis
2023-10-28 17:49:28 +02:00
parent db3f76d12d
commit 36df153ac8
+21 -1
View File
@@ -1,4 +1,5 @@
# Adventure Land - The Open Source CODE MMORPG # Adventure Land - The Open Source CODE MMORPG
https://adventure.land https://adventure.land
The Source Code is now available to anyone, even for commercial use! (License applies) The Source Code is now available to anyone, even for commercial use! (License applies)
@@ -12,9 +13,11 @@ Consider using the #development channel on Discord or messaging me directly on D
## Installation ## Installation
Clone the game files into the adventureland folder: Clone the game files into the adventureland folder:
```sh ```sh
git clone https://github.com/kaansoral/adventureland adventureland git clone https://github.com/kaansoral/adventureland adventureland
``` ```
Clone a modified copy of Python2 App Engine Local App Server into the python folder along with an initialized database with map files: Clone a modified copy of Python2 App Engine Local App Server into the python folder along with an initialized database with map files:
```sh ```sh
@@ -22,6 +25,7 @@ git clone https://github.com/kaansoral/adventureland-appserver appserver
``` ```
Set up secrets files and remember to change secret keys! Set up secrets files and remember to change secret keys!
```sh ```sh
cp adventureland/useful/template.secrets.py adventureland/secrets.py cp adventureland/useful/template.secrets.py adventureland/secrets.py
cp adventureland/useful/template.variables.js adventureland/node/variables.js cp adventureland/useful/template.variables.js adventureland/node/variables.js
@@ -31,6 +35,7 @@ cp adventureland/useful/template.live_variables.js adventureland/node/live_varia
You'll need to download Python2.7 and use the command that comes along with it - it could be ./python or python.exe depending on your setup method You'll need to download Python2.7 and use the command that comes along with it - it could be ./python or python.exe depending on your setup method
Here's the download page: https://www.python.org/downloads/release/python-2718/ Here's the download page: https://www.python.org/downloads/release/python-2718/
For Linux: For Linux:
```sh ```sh
apt update apt update
apt upgrade -y apt upgrade -y
@@ -45,16 +50,19 @@ pip2.7 check
For MacOS pyenv makes sense as it prevents clash between Python versions and allows local versioning by just adding a .python-version to the folder https://github.com/pyenv/pyenv For MacOS pyenv makes sense as it prevents clash between Python versions and allows local versioning by just adding a .python-version to the folder https://github.com/pyenv/pyenv
Make sure to install lxml afterwards: Make sure to install lxml afterwards:
```sh ```sh
pip2.7 install lxml pip2.7 install lxml
``` ```
Run the Python2.7 backend - includes an HTTP server, datastore, various utilities - emulates Google App Engine: Run the Python2.7 backend - includes an HTTP server, datastore, various utilities - emulates Google App Engine:
```sh ```sh
python2.7 appserver/sdk/dev_appserver.py --storage_path=appserver/storage/ --blobstore_path=appserver/storage/blobstore/ --datastore_path=appserver/storage/db.rdbms --host=0.0.0.0 --port=80 adventureland/ --require_indexes --skip_sdk_update_check python2.7 appserver/sdk/dev_appserver.py --storage_path=appserver/storage/ --blobstore_path=appserver/storage/blobstore/ --datastore_path=appserver/storage/db.rdbms --host=0.0.0.0 --port=80 adventureland/ --require_indexes --skip_sdk_update_check
``` ```
Set up the NodeJS game server: Set up the NodeJS game server:
```sh ```sh
npm install adventureland/node/ npm install adventureland/node/
``` ```
@@ -62,14 +70,16 @@ npm install adventureland/node/
Edit the paths in `adventureland/node/variables.js` if you want to run the server from any path Edit the paths in `adventureland/node/variables.js` if you want to run the server from any path
Enter the path of the NodeJS server: Enter the path of the NodeJS server:
```sh ```sh
cd adventureland/node cd adventureland/node
``` ```
Run a server: Run a server:
```sh ```sh
node server.js EU I 8022 node server.js EU I 8022
``` ```
You should be able to access the game at: http://0.0.0.0/ You should be able to access the game at: http://0.0.0.0/
@@ -80,12 +90,14 @@ The **useful/** folder has useful commands
## Network ## Network
Add these to your /etc/hosts file: Add these to your /etc/hosts file:
```sh ```sh
0.0.0.0 thegame.com 0.0.0.0 thegame.com
0.0.0.0 www.thegame.com 0.0.0.0 www.thegame.com
``` ```
And setup nginx with a conf such as: And setup nginx with a conf such as:
```sh ```sh
worker_processes 3; worker_processes 3;
@@ -140,6 +152,14 @@ I suggest you go live with this development codebase and approach development in
The main problem with traditional MMORPG's is people seeking power and while an offline game can provide this for everyone, an online game cannot. Pretty soon new players will avoid such MMORPG's and existing players will also dwindle. In my opinion there are 2 solutions, you could introduce a decay mechanic to overcome this, or concentrate your innovations and additions to make a more social game rather than a game for power hungry people. Originally I intended to add a lot more social integrations, for example browser notifications integrated to the social hub of the game and easy drop ins to friends playing the game etc. So making a more idle and more social game, with new custom art and a new direction could also be a good option, it's definitely the more serene option that anyone can pursue. The main problem with traditional MMORPG's is people seeking power and while an offline game can provide this for everyone, an online game cannot. Pretty soon new players will avoid such MMORPG's and existing players will also dwindle. In my opinion there are 2 solutions, you could introduce a decay mechanic to overcome this, or concentrate your innovations and additions to make a more social game rather than a game for power hungry people. Originally I intended to add a lot more social integrations, for example browser notifications integrated to the social hub of the game and easy drop ins to friends playing the game etc. So making a more idle and more social game, with new custom art and a new direction could also be a good option, it's definitely the more serene option that anyone can pursue.
## Code formatting
This project uses [Eslint](https://eslint.org/) and [Prettier](https://prettier.io/).
For now, this is only used inside the game servers (`/node/` folder).
If you use VSCode, please install the recommended extensions for [eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and [prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode). The formatting will be automatically done on save.
If you have suggestions regarding the formatting, feel free to open an issue or discuss it on Discord. [Here is the history](https://discord.com/channels/238332476743745536/1163453037126357074) of the conversation regarding the formatting.
As you might notice, several eslint rules have been marked as warnings instead of errors. This is to allow a smooth and iterative transition. Make sure your new code respects the rules, even the warnings. If you want to submit a PR to fix a specific warning in a specific part of the code, feel free to do so.
## Freelancers ## Freelancers
Adventure Land's map designer is available for freelance work or for hire. Contact: markjlacandula@gmail.com Adventure Land's map designer is available for freelance work or for hire. Contact: markjlacandula@gmail.com