This is a quick-start guide for getting going with your own Dragon Knight server! It's really easy, and we think you'll enjoy the process. As always, if you think anything here could be improved, let us know on the GitHub repo.
In order to install the game, you first need a copy of it. You can download the .zip from the GitHub repo, or check out the latest release. Extract the project folder from the zip file and we can get started.
TL;DR Server Requirements
- PHP 7.0+
- A web server (we use Nginx)
- A database server (we use MariaDB)
- A decent code editor (we use VS Code)
- Many cups of coffee
We assume you already have PHP set up on whatever computer/server you're running. If you're setting up a new server for Dragon Knight, we assume you'll be running the latest version of PHP on it.
First and foremost, you need a web server. If you're just wanting to play with it on your machine, you can use PHP's built in webserver or download an application like MAMP. Otherwise, setting up a server is beyond the scope of this guide. There are plenty of VPS providers (e.g. DigitalOcean and Linode) and plenty of guides to getting a web server up and running with them.
Secondly, you need a database server. Any standard SQL-compatible relational database will work, such as MySQL (duh) or MariaDB (what we use). Once you have this and a web server set up, you'll need to configure your copy of the game to point to that database server. We'll cover that in the next section.
Thirdly, a solid code editor. This is vital! We use Microsoft's Visual Studio Code, a free text editor taking the dev world by storm. Any editor capable of basic highlighting and autocompletion will serve you well. If you're just running the game and aren't making many modifications, you can also get by with Notepad, if you want.
And as always, as much coffee as your heart can handle.
The latest versions of Dragon Knight takes a much more convenient approach to configuration. Most of your sitewide settings will be handled by the "control row", but important settings and less-often-changed values can be set in
app/config.php. Each group of configurations is it's own labeled array.
// Defaults for app/config.php return [ 'general' => [ 'version' => 'v1.3.0', 'build' => '', ], 'db' => [ 'server' => 'localhost', 'database' => 'testdk', 'user' => 'testdk', 'password' => '', 'prefix' => '' ], ];
You can add more configuration values and groups to the config file as you wish. However, we don't recommend removing the default configs, as the release-ready code does use them. In order to access these values, you can use the
config() helper function, which accepts a "dot notation" path to a config value (e.g.
In order to get the game running, all you really need to do is ensure your
db configs are set appropriately.
- server - This is the address to your database server. Typically 'localhost', or
- database - This is the name of the actual database you will be using.
- user - This is the username of the user authorized to perform queries in your database.
- password - This is the password for that same user account.
- prefix - This is an optional prefix to append to tables, if you need to do such a thing.
Running the Installer
Once your database configs are all set up and you're ready to rock and roll, you'll head on over to
your.site/install.php, and follow the steps there. It will walk you through each step in the process while also getting your database and admin account set up.
- The first step is the introduction; it will explain a little bit of background on the project and prompt you to select a complete or partial installation.
- A complete install will populate the database with basic data, so you can play right away.
- A partial install won't populate anything but the "control row", allowing you to bring in your own data.
- The second page will go through the process of setting up the database tables, and populating them if you selected a complete install.
- The third page will have you register an admin account.
- The fourth step is just a congratulations! It will provide you a link back to the game so you can log in.
And voila! Once done with the install script, all you need to do is delete
install.php from the server (recommended) or rename it to something no one can guess.
Building your World
Once you're logged in with your shiny new admin account and ready to take on the amazing duty of being an online dungeon master, you can access the admin panel from the list of links on the left side of the game. You'll be greeted with a lot of links that can do a lot of things.
At the moment, you can't create things from here, but once you've added some to the database you can edit them all from the admin panel. You can also manage users or write a new news post (recommended). The game is now yours to control, entirely.
Now that you've walked through the most important steps of getting started, we'll leave you here. If you run into trouble, find an issue or a bug, or just have some cool ideas, open an Issue or Pull Request on the GitHub repo.
We'll be expanding these docs as time goes on, so check back every now and then for more insight into the engine.