Open source

This commit is contained in:
Kaan Soral
2023-10-15 13:06:58 +03:00
parent 256ce800e7
commit 553b121f17
2633 changed files with 769945 additions and 454 deletions
+113 -71
View File
@@ -1,101 +1,143 @@
# adventureland
CODE Documentation for Adventure Land MMORPG https://adventure.land
# Adventure Land - The Open Source CODE MMORPG
https://adventure.land
The Source Code is now available to anyone, even for commercial use! (License applies)
**Please consider supporting Adventure Land on Patreon: https://www.patreon.com/AdventureLand**
Ps. Right now the documentation is in-game at https://adventure.land/docs
## Discussion
Ps 2. Type /codes in the Steam or Mac client, the auto synced folder also includes relevant libraries
Consider using the #development channel on Discord or messaging me directly on Discord as it's an easy way to communicate: https://discord.gg/hz25Kz9FsH
## Installation
<!--- [NexusNull's Unofficial But Awesome Documentation](https://nexusnull.github.io/adventureland/index.html) [Functions](https://nexusnull.github.io/adventureland/index.html) -->
Clone the game files into the adventureland folder:
```sh
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:
### Character / Players / Monsters
```sh
git clone https://github.com/kaansoral/adventureland-appserver appserver
```
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/
For Linux:
```sh
apt update
apt upgrade -y
* Properties
* .real_x
* .real_y
* .hp / .max_hp
* .mp / .max_mp
* .xp / .max_xp
* .party / .name / .rip / .afk / .code / .target / .id / .moving + more
* show_json(character) to see all the properties
apt install python2.7 git -y
### Things to Inspect
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
sudo python2.7 get-pip.py
pip2.7 check
```
Replace everything on CODE with these show_json's
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
* `show_json(character)`
* `show_json(character.items)`
* `show_json(character.slots)`
* `show_json(get_target())`
* `show_json(parent.G.monsters)`
* `show_json(parent.G.items)`
* `show_json(parent.G.skills)`
* `show_json(parent.G.npcs)`
* `show_json(parent.M)`
Make sure to install lxml afterwards:
```sh
pip2.7 install lxml
```
### Provided Functions
Run the Python2.7 backend - includes an HTTP server, datastore, various utilities - emulates Google App Engine:
```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=8083 adventureland/ --require_indexes --skip_sdk_update_check
```
#### move(character.real_x,character.real_y)
Moves the character
Set up the NodeJS project for helpful scripts:
```sh
npm install adventureland/scripts/
```
#### get_nearest_monster({max_att:100,min_xp:10,target:"Name",no_target:true})
Return's the nearest monster, you might want to target that return value with `change_target`
Set up the NodeJS game server:
```sh
npm install adventureland/node/
```
target: Picks monsters that only target that name
Edit the paths in `adventureland/node/variables.js`
no_target: Picks monster that aren't targeting anyone
Run a server:
```sh
node adventureland/node/server.js EU I 8022
```
#### use_hp_or_mp()
Uses a very basic logic to either use hp or mp pot
You should be able to access the game at: http://0.0.0.0:8083/
#### get_target()
Returns your current target
The **useful/** folder has useful commands
#### get_target_of(entity)
New, powerful feature, returns the target entity for both players and monsters
`secrets.py` has the secrets
Suggestion for Fun: Code your characters to target and attack what you are targeting, even if you don't engage a monster, you can make your characters (or side-characters) engage by just clicking :)
## Network
#### change_target(target)
Targets the player or monster
Add these to your /etc/hosts file:
```sh
0.0.0.0 thegame.com
0.0.0.0 www.thegame.com
```
#### loot()
Loots the chests on the map
And setup nginx with a conf such as:
```sh
worker_processes 3;
#### attack(target)
Attacks the target
events {
worker_connections 2048;
}
#### heal(target)
Heals the target
http {
include mime.types;
default_type application/octet-stream;
#### game_log(message,color)
Adds a message to game's right log
sendfile on;
#### show_json(character.items)
Renders the argument as json, to inspect, learn, use
keepalive_timeout 0;
proxy_read_timeout 200;
proxy_connect_timeout 30;
proxy_send_timeout 200;
#### set_message("Code Active")
Sets the IFrame message, the one in the right bottom corner
server {
listen 8080;
server_name thegame.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://localhost:8083;
expires -1;
}
}
#### runner_functions.js
There are more functions, examples in runner_functions.js and on the game's main CODE
include servers/*;
}
```
### Future Plans
As the game progresses, the CODE feature will refine, you will be able to create/save your own code in-game, and hopefully much much more
This way you can run multiple different projects at once and reach them using a local url of your choice, my choice was thegame.com
With the introduction of PVP, Trade, Events and similar stuff, the CODE capabilities should get pretty interesting
If you choose to go live with the development server, make sure to block external access to every `login: admin` url you see in **app.yaml**. You could do this via a custom authentication or via nginx etc.
I'm also planning to add Networking between characters, so one might create a small team of bot helpers, or create a PVP team that consist entirely of bots
## How to Contribute
### Usage / Notes
* You have to keep the browser focused
* Otherwise browsers slow down the game
* Opening the game in a new window might be a good idea
* Keep in mind that CODE is currently an early prototype
* CODE runs in an IFrame, feel free to interact with **parent**
* You are free to inspect the client game code
* You can freely emulate a regular player
* Please don't use the CODE to hinder other players or the server
* You should be safe as long as the interval is 250ms
* Feel free to use Github Issues for Questions
* Ideally, at each Interval, move, attack, use/buy only once :)
This repository is the live version of the game. Any changes made will be live when the game is updated. Please create a Discord discussion in the **#development** channel before working on any big changes so your efforts aren't wasted or clash with the efforts of another contributor. Alternatively you can create a Github Issue if you don't use Discord.
Content additions are very welcome, if you inspect the map data, there are many zones created yet not integrated. I'd be very happy to guide potential contributors in adopting and authoring a new zone, a new event, a new monster, a new mechanic and so on.
I will include graphical assets, new item images manually. Please email them to hello@adventure.land
## Suggestions
I suggest you go live with this development codebase and approach development in a very agile manner, you can then move onto cloud if you wish to. My suggestion is to never move onto cloud and building a custom infrastructure using cheap dedicated servers with unlimited bandwidths.
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.
## Freelancers
Adventure Land's map designer is available for freelance work or for hire. Contact: markjlacandula@gmail.com
I'm also available for working freelance on an hourly basis. Contact: hello@adventure.land
If you have specific requirements, for example a unique cloud architecture in mind, I can help you find someone within our community that can handle the job. If you are an artist/designer and looking for a programmer to work on a game with, our Discord is also a good place to find someone!
## License
https://github.com/kaansoral/adventureland/blob/master/LICENSE