Thimbleweed Park (engge2) ported to Haiku!

Thimbleweed Park is a great point and click adventure game by Ron Gilbert e Gary Winnick (the creators of Monkey Island and Maniac Mansion games).

Thanks to engge2, an open source recreation of Thimbleweed Park’s engine, now this game is playable on Haiku!

Screenshots:

WARNING: original game data is required to play. You can buy the game on GOG and then extract the ThimbleweedPark.ggpack1 and ThimbleweedPark.ggpack2 files using “innoextract”

I’ll try to create a recipe, but this time it will probably take a lot longer as I had to do some dirty hacks to get it to work, so upstream patches are needed. I’ll try to send PRs to the upstream project (and dependencies) to fix the various build issues. I’ll keep this thread updated.

21 Likes

Very cool. I even bought this game, back in the days it was hyped.

1 Like

I’ll try to summarize here the current issues that prevent the creation of an haiku package.

  1. [FIXED] nimbler looks for libSDL.so in the wrong path: this is now fixed thanks to a flag passed to nimbler during building phase (many thanks to the ppl in the haiku irc channel who helped me).
  2. [FIXED LOCALLY] scemino/nglib dependency has a critical bug on haiku: I already fixed it locally, I just need to open a PR upstream.
  3. The game engine uses hardcoded paths (“./”) for both game data and save data: this is the real problem preventing the creation of the package :frowning: I can’t just put the binary in /apps because then the users can’t copy the required game data there (and of course the save system will be broken too, since this directory is not writable). One possible solution is to patch the code to accept launch params (like --datapaht and --savepath): while this is very easy for the datapath param (I have already wrote the patch locally), it is complex for the savepath param (since multiple parts of code will read/write savegames, multiple patches are needed).

tldr: the remaning issue is the hardcoded paths in the source code for game data and savegame files.

4 Likes

Can you try mounting a RAM disk with softlinks to the proper directory locations on the hard drive? Or is it root based absolute paths?

If the paths are relative to the current directory, all you need is to insert a chdir() call somewhere in the main function. Or even do a shell script that will do a cd to the correct directory and then launch the app.

Certainly no need for something crazy like a RAM disk??? Even if you needed a directory with links, you could do that in /tmp, or in the app main directory, actually.

1 Like

Sorry. Posted this just before going to bed late at night. (Need a new root? Start a new drive! But not on POSIX.) :crazy_face:

1 Like

Hi @PulkoMandy

during my lunch break I took a closer look at the issue. I can confirm that if I cd to the dir with game data and then launch the executable everything works correctly. So worst case scenario: I’ll write a launch script that will cd to ~/config/non-packaged/data/thimbleweed_park (or similar) and then start the main executable (located in /bin).

I’ve already sent an email (yersterday night) to the original author of engg2, asking if he is insterested in adding launch arguments to specify the gamedata and savegame paths. Let’s wait for his opinion and then decide what to do. In the meantime I’ll fix the nglib issue.

Thanks

4 Likes

Take a look at my tutorial: Porting a compiled program to Haiku - BeSly knowledge base

2 Likes

The game is available for GNU/Linux too, the installer it’s a SFX zip, just “unzip name.sh” and that’s it

1 Like

Hi, lunch break here again, so it is time for some updates :slight_smile:

@lelldorin great tutorial, thanks. Sadly I can’t package the two ggpack files as they are copyrighted.

I sent a PR to scemino/nglib (upstream) with a workaround for Haiku.
Once it is (hopefully) merged, I’ll be able to open a PR to haikuports, since all the other issues are already somewhat fixed.

1 Like

Thanks

You can create a folder for the files you need and create this folder via a postinstall script. The folder should already be on your system and you can then create a link to this folder in your program directory. The description must then state where the files need to be copied.

The postinstall script is always executed when the package is read, so it should always be available when the user should copy the files.

For testing or not open source programs or applications you can use my HPKGCreator software from BeSly Software Reporitory

.

1 Like

Thanks for your further help @lelldorin :slight_smile:

There is only one further problem with this: the game creates some files (savegames) in its directory. There is no way to know how many of these files will be created (because it depends on how often the user decides to save the game). Do you have any ideas for this? Thanks a lot.

Can you declaire a save folder in the source?

Unfortunately not. Not without patching multiple functions as the code reads/writes the save file from multiple functions.

Anyway I think a startup script is the way to go in this particular case. The problem is that the PR isn’t getting merged and the repository owner doesn’t respond to my emails. I don’t think my patch can be applied at build time since nimbler downloads the required libraries into a subfolder in the home directory.

1 Like

You can use multiple SOURCE_URI’s in a recipe in case of missing libraries (or forced ones) and cp them in BUILD to the appopriate places.
Example: https://github.com/haikuports/haikuports/blob/53e76059f68f1fa35ede1219e63759107bc33966/app-misc/task/task-2.6.0~git.recipe

3 Likes