Just to clarify some things:
The VideoWidth, VideoHeight settings determine the size of the game's output resolution. The ScreenHeight, ScreenWidth determine the size of the game's actual rendering window.
So:
VideoWidth=640
VideoHeight=480
ScreenWidth=512
ScreenHeight=384
Results in the game rendering in a 512x384 window on a 640x480 output screen. For those of you that have 1:1 pixel scaling turned on (also called "Do Not Scale" mode in drivers), this means the game will render in an exact 640x480 area in the middle of your screen. So first you're getting the border from the game's output settings, then the border up your native res due to the lack of scaling.
Note that something people might miss (I know I did) is the
Framed option on the second page of the general game settings. The tooltip for that option describes what it does:
"Mark this box if you have the game running in low resolution and don't want to have large pixels on the screen. This will launch the game in the next higher available resolution and the rending will be done in the center of the screen.
Note the size of the game screen will be reduced"
Aha! That setting is what causes the VideoHeight/Width to be changed to 640x480.
partially, this is the setting you're looking for so you get run the game with both a render and output of 512x384! Turn it off. You other guys might want to check this out too.
However, it seems that if you run the game from GoG's launcher (start.exe) the Framed option is always reset to on regardless of what you last set it to. If you want to keep the Framed option off, you have to start the game by running LOADER.exe directly.
---
Note that before I discovered the "Framed" option, I too tried changing the write permissions on the Outcast.ini file, but to set 512x384 as the Video resolution as opposed to 640x480 as the Screen resolution - and I did not have any crashes when dying or going through a portal. I suspect that changing the screen resolution to 640x480 is what's actually crashing the game and it's not related to the write permissions. It's just that without changing the write permissions the value is always being changed back to a valid resolution.
---
Other than that I'll just note that while all PC displays must support 640x480, some modern displays might not accept 512x384 as a valid resolution (mine, which is an HDTV doesn't). However you can get around this, at least on nVidia cards, by creating a "virtual" custom resolution.
With nVidia drivers, you do this by going the Custom Resolution Utility (Change resolution -> Add Resolutions -> Create Custom Resolution). When you get the create window, it should be defaulted to setting that match your native resolution. Expand then timing section, then choose Manual.
Don't touch anything else in the timing section , then go back up to the top and enter 512x384 then test/accept. This may or may not work, it can be finicky. This should make 512x384 a custom resolution that is scaled to and output at your native resolution.