This article lists some tools that you’ll probably want to get if you’re doing Ares coding.
Table of Contents
Do yourself a favor and get a decent code editor. Here are some good ones:
I personally don’t think a Ruby IDE like RubyMine is worth the cost for the benefits you get, but YMMV.
GitHub Desktop is a nice tool that makes it easy to work with GitHub. It’s available for Mac or Windows.
For help using GitHub, including GitHub desktop, see the Git tutorial.
It’s helpful to have a place to test your code that isn’t your main game. That way you can make sure everything works right before unleashing it on your players.
It's strongly recommended that you follow the standard [installation instructions](/tutorials/install) for your very first Ares game. For just a few bucks, less than the price of a grande coffee, you can spin up a droplet for a couple weeks and get your feet wet. That way you're not trying to learn both Ares code and Ares server setup at the same time! Once you have a little more experience with Ares, you can explore these other options for setting up a game for development purposes.
There are several options available to you.
The simplest and quickest way to set up a test game is to just get a second droplet and install a new copy of the game using the standard installation instructions.
You don’t need a separate host name for the test game; you can just use the droplet’s IP address as the host name.
All of the other test game setups require some degree of sever administration fiddling. If that's not your thing, then dual droplets is probably the best solution for you.
If you have MacOS installed on your home PC, you can actually install your own copy of Ares and run the code locally. This makes testing a breeze.
Install Homebrew, Mac’s package manager.
Copy/paste the following commands into a Mac terminal.
curl https://raw.githubusercontent.com/aresmush/aresmush/master/bin/local_setup_mac > setup_ares chmod +x setup_ares ./setup_ares
The install script will set up the command-line version of Git, but you probably also want to install GitHub Desktop. Either one will work for Ares.
If you want the Redis database server to be running all the time, set it up as a Homebrew service using
brew services start redis. Otherwise you’ll have to start it every time you want to use it by typing
Clone the aresmush and ares-webportal code repositories to your local drive. They must reside in adjacent directories (e.g. /home/Users/you/Code/aresmush and /home/Users/you/Code/ares-webportal). See the Editing Code tutorial for help using GitHub desktop to clone the game.
From the aresmush directory, run the following scripts to set up the game:
cp -r install/game.distr game mkdir game/logs chmod +x bin/* bin/configure bin/wipedb
Start the game using
bin/devstart in the aresmush directory.
Start the web portal using
bin/devportal from the ares-webportal directory. The development web portal runs on http://localhost:4200.
AresMUSH won’t run on Windows due to a limitation in the database driver, but you can install Ares using a Virtual Machine (VM). A VM is like a computer within a computer. Once your VM is installed and configured, you can connect to it just as you would a server in the cloud.
ifconfig. This will tell you the VM’s Private IP Address.
setup_serverscript as described in the install instructions.
installscript as described in the install instructions. Use the following options:
Your VM is now ready to use. You can leave it powered off whenever you’re not using it. Here are the steps to start the game:
To change the code on the VM, you can use any of the methods described in the Editing Code tutorial. You can edit code directly through the SSH client, upload new code via FTP (the VM will accept SFTP on 127.0.0.1) or use GitHub to push code to the cloud and then pull it down to the server.
If you’re using the standard installation setup (on a droplet or other virtual private server), you can install a test game on the same droplet.
Before we start, a few things you should know:
Log into your server shell with the ares user and run the following commands from the aresmush directory to create a test user named ‘arestest’:
curl https://raw.githubusercontent.com/aresmush/aresmush/master/bin/create_test_user > create_test_user chmod +x create_test_user sudo ./create_test_user
Log out and then log back in with the new arestest user using the password printed on-screen in step 1.
With the arestest user, run the following commands to create a copy of the database configuration file and a place for your second database to live
cp /etc/redis/redis.conf redis.conf mkdir redis chgrp redis redis
Edit the redis.conf file to make the following changes:
- Change pidfile to "/home/arestest/redis/redis-server.pid" - Change logfile to "/home/arestest/redis/redis-server.log" - Change dir to "/home/arestest/redis" - Change port to something else, like 6380 - Change daemonize from yes to no (or true to false, depending on your version of redis).
Run the following commands:
- Be super-sure you’re running this with the arestest user.
- Make sure you have a backup of your actual game database first, just in case.
curl https://raw.githubusercontent.com/aresmush/aresmush/master/bin/setup_test_game > setup_test_game chmod +x setup_test_game sudo ./setup_test_game export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Assuming everything installed correctly, log out then back in again.
Then execute the following commands:
- For configuring the game, you don’t need a new host name. You can just use the IP address of the droplet.
- Use different ports for everything, especially the database port. This will initialize the database fresh, and you don’t want to wipe out your main game’s database.
To start your game:
The game will not be running 24/7 like your main game. When you want to start it, you’ll need to open three separate terminal shells and do:
First shell: redis-server /home/arestest/redis.conf Second shell, from the aresmush directory: bin/devstart Third shell, from the ares-webportal directory: bin/devportal
You edit code on the test game the same way you do on the real game: through direct editing, FTP, or GitHub. GitHub offers the most reliable workflow.
For more help using GitHub, including GitHub desktop, see the Git tutorial.