The Dink Network

Reply to FreeDink, Linux and You - FreeDink Linux Tutorial

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
March 20th 2017, 03:00 PM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Alright so, some people may have learned that FreeDink is (obviously) available at Linux and Mac, besides being the surperior source port for Windows. But how do you even get it to work properly? I will cover mostly the Linux version, since i don't even own a Mac.

1.Installing FreeDink

It's a rather simple process, like veeery simple. As it can be found in distro's Software Center and are divided into 3 packages:
freedink - Main bin file of FreeDink
freedink-data - Contains main resources and data for the Dink Smallwood game, albeit with some differences due to the license issue with some of the original files.
freedink-dfarc - A front-end for Dink Smallwood called DFArc 3

In ArchLinux those packages are available in AUR and it will be compiled and installed automatically (Along with installing required dependencies).

After installing it, the main game files are located at /usr/share/dink/, while FreeDink executables are in /usr/bin. They can be launched from your Menu button or by typing in terminal these commands:
dink - Runs the main game
dinkedit - Runs the editor
dfarc - Runs DFArc

2.Getting music to work
The moment you run the game you will most likely notice that the game does not have any music. That's because no MIDI Sequencer has been either set up or installed. For this case I will talk about Timidity.

Most of the time, the distro will include it by default along with other required files, but just in case check if you have these packages installed:
timidity
timidity-freepats
fluid-soundfont-gs or fluid-soundfont-gm (If using ArchLinux or any distro based on it it's soundfont-fluid) (Optional)

Now I am not sure about Ubuntu or Debian based distros, but if you are using other Linux distros besides these, you may have to set it up manually. In this particular case i will show the ArchLinux one, as this is the distro i mainly use (Folder locations may differ!)

Edit the timidity.cfg located at /etc/timidity with any text editor as root via sudo command at the beginning and....

If you have freepats installed
Add

dir /usr/share/timidity/freepats
source /etc/timidity++/freepats/freepats.cfg

at the end of the text file and save

If you have FluidR3 soundfont installed

Add

soundfont /usr/share/soundfonts/FluidR3_GM.sf2

at the end of the text file and save (If you have GS version installed then replace FluidR3_GM.sf2 with FluidR3_GS.sf2)

You can use other soundfont if you want by replacing the /usr/share/soundfonts/FluidR3_GM.sf2 if it's at different location.

Once you are done you can then type in

timidity -iA -Os

and run the game, you will have the music playing. However, the MIDI will be played as long as the Terminal you ran the command with is open. So you need to make the system to launch it automatically in each boot without the terminal window and you have two options.

Lazy way

Simply open a text editor and type in

#!/bin/bash
timidity -iA -Os

save it with any name you want to give and make it hidden (by adding . at the beginning) then in your current desktop environment make it as a Starting program and then restart.

Service/Daemon way

If you are using ArchLinux or distros based on it (again, dunno about Debian or Ubuntu based distros if it's set up automatically) open up the text editor and type in:

[Unit]
Description=TiMidity++ Daemon
After=sound.target

[Service]
ExecStart=/usr/bin/timidity -iA -Os

[Install]
WantedBy=default.target

then save it as timidity.service in ~/.config/systemd/user/ folder (the ~ is the home directory so in this case it's /home/<account name>/.config/systemd/user/)

and then in terminal type

systemctl --user enable timidity.service
systemctl --user start timidity.service

It will start timidity at the background without even rebooting.

It's probably possible to do this on Debian/Ubuntu based distros but keep in mind that the commands may be different.

3.Replace files from freedink-data with the original ones
Oh yes, it's possible to do this and all you need is the original Dink Smallwood installer and two packages:

wine
playonlinux

Run PlayOnLinux, press Install button and choose "Install the program that is not on the list" and follow instructions there. Once you are done go to the folder where you have installed the Windows version of the game via Terminal, make sure the folder dink is there and type in

sudo cp -Rv dink /usr/local/share/dink/

This command will copy the dink folder that is from the Windows version you have installed using PlayOnLinux to the main FreeDink one while showing the progress of it as super user.

Once you are done, it will use the sounds and music from the original Windows game (Besides the MIDI using different instruments depending on the timidity setup).

4.Other notes

-The best player for playing MIDI exclusively is DeaDBeeF. It is a lightweight simple music player which uses Timidity settings for playing MIDI (That is if you have Timidity installed and configured)

-I have checked if WinDinkEdit Plus 2 supports PlayOnLinux for easier editing and making DMODs but sadly there are some slowdowns and minor graphical issues. Since WinDinkEdit source code is available, hope someone makes it cross-platform using Qt (or just plain linux version in GTK engine).

-DMODs by default are installed at the dmods folder located in your home folder, which i totally recommend leaving that on! As installing it at the /usr/share/dink/ folder will result in an error due to the restricted access! Location can be changed via DFArc.

-If you are bored of FreeDink, you can always use the Windows version using PlayOnLinux. Checked it myself and it works fine (Since POL sets WINE to run the current program under Windows XP environment by default)

-You can compile FreeDink by yourself if you want to. Files and instructions can be found here.

-Linux pretty much has all the programs you need for creating or editing graphics or sound such as Blender, GIMP, Audacity etc.

- If the 117 error shows up during the launch. You may want to reinstall/recompile FreeDink itself. This happens when you've updated the SDL to the newer version, while FreeDink engine has been compiled on the older one.

5. Optimizing the engine for your CPU.

Believe it or not, but if you are compiling FreeDink or DFArc 3 via source code or through AUR. You can actually optimize it to work best for your CPU. For more see this page. If you are compiling via source code, then edit the Makefile and find these CFLAG and CXXFLAG commands there. (Make sure to make a backup copy of it before modifying).