Skip to content
This repository has been archived by the owner on Jul 2, 2019. It is now read-only.

Local Development

Peter Keeler edited this page Oct 29, 2018 · 7 revisions

Running The Agony Engine Locally

You just need to have Docker installed to run The Agony Engine locally.

  1. Grab a copy of docker-compose.yml from the root of the project and put it in an empty directory on your computer.
  2. Open a terminal and run: docker-compose up

At this point Docker will download MySQL, ActiveMQ and The Agony Engine's containers from Docker Hub, configure them and start them up for you. When you see a message like Started AgonyEngine in 10.786 seconds (JVM running for 11.719) in the log, point your browser at http://localhost:8080 and you should see the MUD's website.

Bear in mind that using this method the database will be stored inside the MySQL Docker container. When you shut everything down with docker-compose down all the data will be deleted.

To preserve the data you will need to mount a directory from the host computer as a volume inside the MySQL container with the path /var/lib/mysql. That way the database's files will be written outside of the Docker container and will remain even after the container is destroyed.

Hacking on The Agony Engine

If you're interested in changing the code for The Agony Engine, it's pretty easy to get a development environment started. You'll need JDK 8 and Docker installed, and I'd strongly recommend a programmer's editor like IntelliJ IDEA.

  1. Clone the code from GitHub and make some changes.
  2. To build, type ./gradlew clean build in the project root.
  3. Wait for Gradle to build, run tests, build the Docker container and compute the test coverage.
  4. Run docker-compose up to start the MUD locally. You can connect a remote debugger to port 5005 of the container if you need to.

If you'd like to compile without running tests, you can run ./gradlew clean build -x check. Doing so can greatly speed up your development cycle, but don't forget to run the tests before you open a pull request!

A typical pattern for iterating on a new feature would be to write some code, compile it, then run docker-compose up to run it. Log in and play the game, try out your new feature, and Ctrl+C to stop the game when you're done. At this point you can recompile and docker-compose up again to bring it back up with your next set of changes.

If you find that you need to reset the database, run docker-compose down to bring down all the Docker containers before running docker-compose up. When it comes back up the database will be empty.