Pages

Thursday, 2 March 2017

+Dwarf Fortress in the Browser (a tutorial)+

Many will know the indie ASCII game, Dwarf Fortress and more will not. If you do and/or you would like to play it - in the comfort of your very own browser - then read on!



There is a fantastic service called Cloud9. It's an IDE (Integrated Development Environment) for programming and it's special because all happens in the cloud. This means that you can stop and carry on whenever from any browser. This is for programming so what does it have to do with Dwarf Fortress?

Well Cloud9 workspaces happen to run on the Ubuntu OS and Dwarf Fortress happens to be run-able on Ubuntu.

Step, the first


Create a Cloud9 account at https://c9.io/. You can choose the free plan and set your account as a hobbyist-user.

Step, the second


Once you’re at the dashboard, create a workspace. You can only create one workspace on the free plan but one is more than enough. The workspace could probably use any template but to be safe choose “c++”. You don’t need to link a git repository.

NB: Set the repository to private.

Step, the third





You should you should arrive at your newly created workspace which will look something like this. Maximise the terminal tab (the blue one in my screenshot) and close the other tabs if you can. To run a command in the terminal tab, type or paste the command and press enter (return). Run the following commands:


wget http://bay12games.com/dwarves/df_43_05_linux.tar.bz2
tar -xjvf df_43_05_linux.tar.bz2 df_linux/
cd df_linux
nano data/init/init.txt

That last command will open an editor in the terminal. Using your arrow keys, scroll down until you find the line that reads “[PRINT_MODE:2D]” and change it to “[PRINT_MODE:TEXT]”. Press ctrl + x to save.

Step, the fourth


Now that dwarf fortress itself is set up, you need to install its dependencies. Run:


sudo apt-get update
sudo apt-get install -y libSDL-dev libsdl-ttf2.0-0 libsdl-image1.2

Step, the fourth and final


To run Dwarf Fortress, run


./df

Note that you should still be in the df_linux folder. If everything was setup correctly, the game will launch.

I recommend only playing on a pocket-sized world to reduce resource usage. There is only half a Gigabyte of memory available on the free plan.

Take your game with you wherever you go and have !fun!

2 comments: