-
Notifications
You must be signed in to change notification settings - Fork 24
Planes of Tlessa Development Documentation
It's important to note that Planes of Tlessa is not a framework for building your own games. While there is some ability in the Administration section to create new weapons, armor, and so on, the game has been designed around the central concept of what Tlessa is:
A loot grinding game with a linear gear progression path and a lot of features that keep players engaged for many hours.
You will need the following on your machine to run Tlessa. Tlessa does not use Docker at this time. Feel free to open a PR though if interested.
- The latest PHP will be needed, at the time of this document it is 8.2.8.
- Composer
- pcov (pecl install pcov)
- Redis
- MySQL
- Yarn
- Node (v 20.4.0 at the time of this writing)
- PHP Redis extension
Run the following to grab the code: git clone https://github.com/AdamKyle/flare.git
Run the following commands first:
- composer install
- yarn install
You will need to update the .env file in order to progress:
Copy the .env.example
and create a new .env
file at the root of the project. Change the following:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=4000
DB_DATABASE=name
DB_USERNAME=username
DB_PASSWORD=password
Change these values to match your MySQL information.
BROADCAST_DRIVER=pusher
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=database
SESSION_LIFETIME=60
This tells the broadcasters to use Redis. For this to work, you will need to open a second terminal tab and start Redis or make sure it's working properly.
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=test
REDIS_PORT=6379
REDIS_CLIENT=phpredis
REDIS_CLUSTER=phpredis
Here we set up Redis. Make sure the details match your environment.
MAIL_DRIVER=smtp
MAIL_HOST=smtp.xxx.com
MAIL_PORT=xxx
[email protected]
MAIL_PASSWORD=xxx
MAIL_ENCRYPTION=tls
Here you can set up email with a third-party provider to send emails out to players. We don't send many by default.
- We send for password reset.
- We send for players who are banned or requesting to be unbanned when permanently banned.
- We can send an email to the Administrator to let them reset their password when setting up the account, more on that later.
Once this is set up, you have a couple of optional flags you can turn on if you want:
TIME_ZONE=
# Set the timezone of the game.
GITHUB_TOKEN=
# Useful for pulling tag data with php artisan fetch:release-data
HORIZON_EMAIL=
# Needed for production release. Restricts access to those who have logged in with this email from accessing /horizon to see running queues.
DISABLE_REG_AND_LOGIN=false
# Useful for doing deployments. Locks players out.
ALLOWED_CHARACTER_EMAIL="[email protected]"
# When locked out, only allow this email to register and login.
For the game to work, you need to set up a couple of aspects:
PUSHER_APP_ID=test
PUSHER_APP_KEY=test
PUSHER_APP_SECRET=test
PUSHER_APP_CLUSTER=mt1
PUSHER_HOST="127.0.0.1"
PUSHER_PROTOCOL="http"
// Does not matter what you put for values above ^
VITE_APP_ENV="local"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
// You need a TinyMCE API key, which can be gotten for free
VITE_TINY_MCE_API_KEY=""
Now we have the .env setup. We can finish off with the easy stuff.
Now we will run some commands to set up Planes of Tlessa at the base level:
- php artisan storage:link
- Creates a public storage for the images used in the information section.
- php artisan migrate
- Sets up the database.
- php artisan db:seed
- Creates some of the base content such as the max level, the rank fights, and the roles.
- php artisan create:admin [email protected]
- An email will be sent to you provided you followed the steps above to set up the email configuration. If an email cannot be sent because you chose not to set up the mail aspect, a link will be spit out to the console to let you reset the admin password.
At this stage, you can stop if you want. Players cannot log in because no map has been created. You'll also be missing a lot of content and need to do some database work via the admin section by filling out various forms for monsters, items, quests, kingdoms, and so on.
This is where you can customize Tlessa to be your own version.
However, if you want to experience Tlessa as it is live, let's follow the next steps:
Run: php artisan import:game-data
This will import all the data needed including setting up maps, game races, classes, items, quests, and so much more. It's the base Tlessa game.
Next, to login or create a new character, you need to open a few terminal tabs from the base directory of flare/ and run:
Make sure Redis is running.
- php artisan serve
- Serves the application so you can go to 127.0.0.1 and view the game
- php artisan websocket:serve
- Starts the WebSocket server to allow speaking between backend and client. Tlessa makes use of a lot of broadcasting to make the game realtime.
- php artisan horizon
- Starts Horizon and allows jobs to run. For example, when you kill a creature, there is a series of jobs that run for various things such as processing the fight and its rewards.
- yarn build
- Compiles the assets.
- We cannot run yarn dev (which would run a watch command using vite) because the project uses class components for React.
- Compiles the assets.