The Dink Network

FreeDink, Linux and You - FreeDink Linux Tutorial

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).
March 20th 2017, 03:11 PM
dinkdead.gif
baphomet
Peasant He/Him
I Like War. 
Cool. Need to check that out sometime.
March 20th 2017, 06:00 PM
spike.gif
SlipDink
Peasant He/Him United States bloop rumble
2nd generation. No easy way to be free. 
These are excellent detailed and thoughtful explanations! This is a great job.

I have played Dink Smallwood and various dmods on Ubuntu (since 10.04).

I use it and WinDinkEdit2 on Windows Vista to generate dmods.

BTW, it has been my experience that on Ubuntu, you can just install dink from the "Software" or "Software Center" tool that ends up on your Desktop when you set up an account. Like you I added the "missing" sounds to the /usr/share/games/dink/dink/Sound directory.

I also installed the ultimate cheat into the /usr/share/games/dink/dink/Story directory.
March 21st 2017, 12:31 AM
dinkdead.gif
baphomet
Peasant He/Him
I Like War. 
Why slipdink! I never knew you cheated. Loll😁
March 31st 2017, 11:03 AM
farmer.gif
Beuc
Peasant He/Him France
 
Linked from the sticky
April 6th 2017, 08:28 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Oh man that's awesome. Also i've added some more infos regarding playing MIDI files and the Error 117 i believe.

FreeDink on SDL2 when?
April 6th 2017, 02:08 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
Has anyone successfully built the latest version for OSX? I would love to be able to play on my macbook!
April 6th 2017, 07:39 PM
farmer.gif
Beuc
Peasant He/Him France
 
No clue about this "error 117" - what is that about?
(btw there shouldn't be any error when updating SDL 1.x->1.y)

SDL2 upgrade is pretty much done and needs testing, if you want to check have a look here
http://www.beuc.net/tmp/freedink-109.0.tar.gz (prepared source)
http://www.beuc.net/tmp/freedink-109.0-bin.zip (.exe)
April 7th 2017, 03:16 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
I've got that error on my ArchLinux which happened after SDL got an update, well actually a revision. Reinstalling it from AUR fixed that though.
April 7th 2017, 09:55 AM
spike.gif
SlipDink
Peasant He/Him United States bloop rumble
2nd generation. No easy way to be free. 
Why not upload your new version to the Dink Network? You can note that it needs testing and that you welcome bug reports, etc.
April 8th 2017, 06:13 AM
farmer.gif
Beuc
Peasant He/Him France
 
GOKUSSJ6: OK this must be Arch-specific then.

SplipDink: I'm not ready to receive and act upon a massive amount of feedback right now. It's on a "wish to test" basis
Plus uploading to the Dink Network involves days of moderation delays and it's not possible to modify/remove past betas, so it's better if I provide the links myself.
May 3rd 2017, 06:42 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Added an interesting info regarding optimizing FreeDink to your CPU.

Beuc, are ya going to make an AUR for FreeDink or is it there already?
May 4th 2017, 02:11 PM
farmer.gif
Beuc
Peasant He/Him France
 
Thanks GOKUSSJ6.

FreeDink in AUR
https://aur.archlinux.org/packages.php?K=freedink

You can contact Petteri Tolonen to check if he needs help though, I see that Arch doesn't have the latest freedink-data.