I have been trying to port the game Postal by Running with Scissors considering they open sourced the game around in 2016 but it has a weird thing where I couldn’t get it to run (seems to not be able to read some game files? not sure).
Can anyone help me in accomplishing this? The game is free on GOG and Steam, I used the game files from the Steam release.
Just a thought… Ini is a pretty simple file format - does the code assume anything about line endings? Might it be reading the entire file as one line or something simple yet catastrophic like that? Ini is from Windows and I assume it would have CR-LF as the line ending.
Actually - yes - this is entirely possible. There was a “developer” back int he BeOS days that ported a lot of SDL and Allegro games… by porting, we mean they added a small bit of code to set the correct working directory. That was generally what broke a lot of games, as the CWD was not what they expected it to be.
Apparently it means it can’t read the INI file but when I used DefaultPostal.ini (probably from the DOS version?) it gave me 2 different errors but the same A101 error when I clicked OK on the first 2 dialogs.
And I might try what you have said later.
EDIT: Nope, it doesn’t have CR-LF as the line ending considering I used the game files from the GNU/Linux release.
Sadly the link at the RWS article doesn’t work so I had to resort to using a reupload(?), not sure.
I used this one.
Also it seems OpenBSD already has it ported with some additional patches, I haven’t tried them on Haiku yet.
EDIT: Whoops, I read it wrong. I did not make any repository yet.
EDIT²: If you are wondering what I have done, I just changed some values in the Makefile and removed some of the Steam related stuff (LoadAchievement or whatever it is was giving me some trouble so I removed those too, not sure if they are related to Steam).
So there are a few issues with the code (eg. assuming you wanted to package it, it wants write access to the INI file, and it assumes the INI file is in the working folder, etc.)
If you’re running it on x64 it tries to set up some mins and maxs for types that won’t actually work properly, since those type sizes are larger on 64 bit systems.
So essentially what happens is it’ll try to check a value in the prefs (either read in through a file or a default) is between S32_MIN and S32_MAX, S32_MIN is actually a large positive value, and then the prefs file reading will think something has gone wrong and error out for the rest of the values.
So you need to fix the types to use appropriate ones on X64 or fix the type MINs and MAXs so they actually represent correct values.
If you fix the makefile to generate a debug build, the S32 size issue will get caught in asserts.
So there are a few issues with the code (eg. assuming you wanted to package it, it wants write access to the INI file, and it assumes the INI file is in the working folder, etc.)
Huh, okay then.
If you’re running it on x64 it tries to set up some mins and maxs for types that won’t actually work properly, since those type sizes are larger on 64 bit systems.
So you need to fix the types to use appropriate ones on X64 or fix the type MINs and MAXs so they actually represent correct values.
If you fix the makefile to generate a debug build, the S32 size issue will get caught in asserts.
From there it’ll maybe start up and play or maybe not. I’m guessing you’ll have the best luck running the bin in amongst the various game folders. If you want to do it properly there’s work to do.
Getting it to work is probably not a problem, since there are repos that have all the 64 bit issues fixed. Getting it to work in a packageable way that suits Haiku is more of a problem, since it seems like it’s really geared towards the binary running with the data folders in the same place. It’s not to say it can’t be done, but there’s work to do. Maybe some repo has already done that but it’ll take some time to track it down, etc.
Happy to offer help with porting, etc. but ultimately I do have other stuff to be getting on with.
Hmm if changing the code to locate the INI file is too complex for you, maybe putting a symlink in the package to the real one in the writable settings folder would work?
You’d have to dig the HaikuPorts wiki to see how to install settings file from the package though.