Getting AppGameKit to run it’s game executables on Ubuntu 16.04

July 18, 2016

Well, App Game Kit was on sale today on Steam and as always, Steam sales bring the impulsive buyer in me out! Even better, this piece of game development software has native support for Linux.

However, upon first trying to run the initial AGK basic code, no window would appear. Running the produced binary in a Terminal or through the Debug button would produce output like the following:

AGKBroadcaster64: error while loading shared libraries: libavcodec.so.54: cannot open shared object file: No such file or directory

 

So, it’s running into a dependency problem. The hard part for most would be that the packages AGK executables rely on are not in Ubuntu 16.04’s repositories. These packages are from the Ubuntu 14.04 days.

Not to worry though, I was able to cleanly overcome these dependency requirements in a standard updated 16.04 install. Here’s a quick step-by-step for you to get up and running too.

For Normal Users

To be clear, the AGK dependencies are two. One is libavcodec54 and the other is libavformat54.

First, head to each of these links and download the .deb files. The links on each page may not be as apparent at first glance, but you’ll generally either be looking for a mirror link near you or there will be the text ‘security.ubuntu.com/ubuntu’. Rather strange text for a download link, but it’s the right one.

There’s more than two packages because, you guessed it, our two packages have their own dependencies. Thankfully this rabbit hole does not go too deep.

Download each of these:

http://packages.ubuntu.com/trusty/amd64/libavcodec54/download

http://packages.ubuntu.com/trusty/amd64/libavutil52/download

http://packages.ubuntu.com/trusty/amd64/libopenjpeg2/download

http://packages.ubuntu.com/trusty/amd64/libvpx1/download

http://packages.ubuntu.com/trusty/amd64/libx264-142/download

http://packages.ubuntu.com/trusty/amd64/libavformat54/download

http://packages.ubuntu.com/trusty/amd64/libgnutls26/download

http://packages.ubuntu.com/trusty/amd64/librtmp0/download

Now, install them by double-clicking them. Follow this list from top to bottom! (That means start from the top or number 1 and install them one-by-one whilst going down the list and end at number 8).

  1. libavutil52
  2. libopenjpeg2
  3. libvpx1
  4. libx264-142
  5. libavcodec54
  6. libgnutls26
  7. librtmp0
  8. libavformat54

Double clicking them will open them in the new shiny Ubuntu Software app.

That should be it! Now if you try to run your AGK executable, either through a terminal, by double-clicking it or through the AGK IDE it should run the game window without issue. Running the default basic code which prints the frames-per-second should show something similar to this:

For Advanced Users

If you’ve already run the steps in the above section for Normal users, then you’re done! This part is for those who want to use a Terminal instead to solve the problem. If you’re like me and want to install them through a terminal to see what’s going on and to find any potential problems, then CD to the location you downloaded those .deb files. To install each deb package through a Terminal, the command looks something like the following:

sudo dpkg -i package_name_amd64.deb

So, for example the first package would be:

sudo dpkg -i libavutil52_9.18-0ubuntu0.14.04.1_amd64.deb

I believe it’s possible to do it all in one go, but I’d recommend separating it in at least two parts so the required packages get installed before the main dependency packages get installed. The required packages first in one go:

sudo dpkg -i libavutil52_9.18-0ubuntu0.14.04.1_amd64.deb libopenjpeg2_1.3+dfsg-4.7ubuntu1_amd64.deb libvpx1_1.3.0-2_amd64.deb libx264-142_0.142.2389+git956c8d8-2_amd64.deb libgnutls26_2.12.23-12ubuntu2.5_amd64.deb librtmp0_2.4+20121230.gitdf6c518-1_amd64.deb

Now, the main dependency packages in one go:

sudo dpkg -i libavcodec54_9.18-0ubuntu0.14.04.1_amd64.deb libavformat54_9.18-0ubuntu0.14.04.1_amd64.deb

Final Notes

I hope this helps you in some way! The developer has kindly replied to me in the Steam forums with the following regarding this problem:

The OGG music commands are a step towards this support. The old music commands used libAV to decode music files whilst the OGG music files use a built in decoder. At some point I will remove the old music commands from the Linux version so that we no longer have this dependency.

So, he is working on a solution for the future. Whilst this quick guide does show one how to get the AppGameKit IDE up and working in Ubuntu 16.04, it would be unwise to expect normal gamers on Ubuntu or any latest Linux distro to have to manually install these packages before they can start your AGK game. Whilst it might increase the size of your game package, it would be wiser to include these libraries statically in your final game package for now. Alas, as is with anything in the game development arena, this can be debated as a good or bad thing. In the end, it’s up to you what path you choose to release your game on. Happy game devving!

 

 

 

Advertisements