For this week’s Thousander Club update:
Game Hours: 262.25 (previous year) + 110.5 (current year) = 372.75 / 1000
Game Ideas: 616 (previous year) + 44 (current year) = 660 / 1000
I spent a good portion of this week reducing the dependencies Killer Kittens has. I followed the advice of Troy Hepfner, owner of My Game Company and creator of Dirk Dash. He outlined what to do in the article Game Developer’s Corner: Linux Game Development: Distributable Binaries which members of the Association of Shareware Professionals would have seen in the May 2007 issue of the ASPects newsletter. If you’re not currently a member of the ASP, you can join and obtain access to the back issues in the archive.
If you install a game, it should install any dependencies if you don’t have them. On Windows, you’ll see games that try to install the latest DirectX drivers, although there is room for improvement. If I already have a later version of DirectX, don’t offer to install an older one!
Anyway, ideally the game should be as easy as extract-and-run. I shouldn’t need to tell someone that they need libSDL-1.2 and libSDL_image-1.2. If someone doesn’t have the required libraries on his/her system, the game should supply its own version of the libraries.
But I don’t want to provide hundreds of libraries. Besides bloating the download size of my game to possibly tens or hundreds of megabytes, making it less likely someone would want to download it and increasing bandwidth costs, it would be a hassle for me to deal with!
My game currently depends upon libSDL and libSDL_image. Using Troy’s helpful information, I was able to reduce libSDL’s dependencies dramatically by creating a custom version. I built the Kyra Sprite Engine as a dynamic library according to the instructions in this post.
Unfortunately, I had problems getting Kyra to build using my custom SDL libraries. Also documented in that post, I found that building the Kyra Sprite Engine actually builds two libraries: libkyra and libengine.
I ran configure with the following arguments: –prefix=/home/gberardi/wc_KillerKittens/KillerKittens/lib –with-sdl-prefix=/home/gberardi/wc_KillerKittens/KillerKittens/lib/ –with-sdl-exec-prefix=/home/gberardi/wc_KillerKittens/KillerKittens/lib/
If I run ldd libkyra.so, I find that it uses the libraries in the KillerKittens/lib directory. If I run ldd libengine.so, however, I find that it uses the system-installed libraries, which also brings in all of their dependencies.
If I can get libengine to build using the same libraries as libkyra, I can get my dependencies down to a handful. I believe the problem lies with a faulty implementation of autotools and libtool, but those tools seem incredibly difficult to work with. As a (possibly half-serious) joke, it is said that most people don’t actually know how to use autotools and simply copy and paste configuration files from one project to the next.
I’ve asked for assistance on the The Linux Game Tome game dev forums as well as the Linux Game Development Center mailing list. While I wait for any response, I’m still hunting through the configure, configure.in, ltmain.sh, and various Makefile files, trying to determine why one library builds with the options I pass to it while the other does not.
On a different note, if you are going to be in Chicago on May 24th, you can come see the game development tech talk I will be giving for the DePaul Linux Community.