Porting Postal

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).

image

Can anyone help me in accomplishing this? The game is free on GOG and Steam, I used the game files from the Steam release.

Maybe working directory problem. Have you tried to run it from Terminal with the same working directory as program?

What does “A101” mean in the Postal help?

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.

Yes, I did try doing that.

File name case problem?

1 Like

I have been scratching my head, looking at the Postal source code and it’s supposed to be uppercase. So I don’t think that’s the problem.

There’s a similar issue recorded here regarding the MorphOs port: MorphZone

Looks like some tweaks were needed within the INI file to get it working.

Unfortunately I don’t have the game to help.

1 Like

Where is the specific source being ported? Is there a repo?

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).

There’s a similar issue recorded here regarding the MorphOs port: MorphZone
Looks like some tweaks were needed within the INI file to get it working.

Awesome! I might try what they have done later.

Unfortunately I don’t have the game to help.

As I have said in the thread, it’s free on GOG.

Ah sorry, I must’ve skimmed that part.

I’ll take a look.

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.

So was that it? And yes, I was trying it on x64.

No.

Best bet would be to grab this repo which seems to have fixed 64-bit issues: GitHub - classiccoding/postal-1-open-source: POSTAL 1 Open Source https://bitbucket.org/gopostal/p

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.

I have my own stuff to work on.

1 Like

Haven’t looked into it but say that AUR is having a port also, maybe it could be of help?

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=postal-git

And openSUSE: File postal.spec of Package postal - openSUSE Build Service

Sometimes searching on Repology can show some work done by others in the past: postal-game package versions - Repology

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.

I’d love to see a port of this classic. Was just thinking of it the other day; as crass as it was, it was a lot of fun!

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.

1 Like