BC46 / freelancer-hd-edition

Freelancer: HD Edition is a mod that aims to improve every aspect of the game Freelancer (2003) while keeping the look and feel as close to vanilla as possible.
https://www.moddb.com/mods/freelancer-hd-edition
168 stars 15 forks source link

Issues regarding flplusplus #104

Closed BC46 closed 2 years ago

BC46 commented 2 years ago

For most people, the flplusplus plugin doesn't cause any issues. However, on some very specific setups it does.

Invalid account name and passwords error

So far two people have seen the following message when they launch the game:

image

This message prevents them from playing the game. The strange part is that this is a server-related error message which should never be shown when the game launches. Presumably, this is a permission issue. However, I can't confirm that.

Crashes

Two other people experienced outright crashes when launching the game. One user was running Windows Server 2019 and the other claimed to play on an iMac M1 with Parallels 17.1.0 or 18. What's weird is that the reported crash offsets are in completely different DLLs. I've noted the following ones:

results from Event Viewer "Faulting application name: Freelancer.exe, version: 1.0.1223.11, time stamp: 0x3e401b79 Faulting module name: SoundManager.dll, version: 1.11.0.173, time stamp: 0x3e401cd4 Exception code: 0xc0000005"
MP3codec.dll
Exception code: 0xc0000005
Fault offset: 0xc00001189

storyfactions.dll
Exception code: 0xc0000005
Fault offset: 0xc0000108f

VCRUNTIME140.dll
Exception code: 0xc0000005
Fault offset: 0xc0000389f

The exception code 0xc0000005 seems to be an access violation. Though I have no idea why it would occur.

Both of the mentioned issues are fixed by simply removing the flplusplus.dll entry in dacom.ini. I myself have not been able to reproduce either of the issues, which makes troubleshooting and debugging them very difficult.

I should mention that I had to recompile flplusplus because of a few minor changes I made to the plugin. First, I removed the built-in WheelScroll plugin since HDE already uses a newer version. Additionally, I added an extra lod scale function in graphics.cpp so that this feature wouldn't conflict with HDE's maximized draw distances. Though I really doubt that any of these modifications are the cause of the reported issues. If desired, I can upload the modified source code.

BC46 commented 2 years ago

flplusplus-master.zip (modified source code) flplusplus.zip (DLL)

Default config file:

; Settings file for flplusplus
[flplusplus]
; lod_scale
; 0 = default lod
; 2 = 2x
; 3 = 3x
; 4 = 4x
; 5 = 5x
; 6 = 6x
; 7 = 7x
; 8 = 8x
; 9 = maximized
lod_scale = 9
; save_folder_name
; Name of the save folder in Documents/My Games
save_folder_name = Freelancer
; save_in_directory
; if true, save in the game directory (EXE/../SAVE) instead of Documents/My Games
save_in_directory = false
BC46 commented 2 years ago

Thanks to the troubleshooting help of adoxa, we were able to fix an issue with flplusplus regarding patch protection, which seems to resolve the crashes: https://github.com/BC46/freelancer-hd-edition/commit/3ec5ef912c72ac5e360412b0812003a16c6b4268. I've also asked both players who reported the strange server error message if they could test the patched flplusplus.dll. However, neither have gotten back to me yet.

BC46 commented 2 years ago

Both players I asked to test the updated flplusplus.dll have stopped responding to me. Because of this, I can't verify whether the strange server-related error still shows up. However, the patch protection issue has been fixed and the sound-related patches from flplusplus have been removed. Therefore, in theory, there's no possible way that this error message can show up. Feel free to reopen this issue in case someone still experiences either of the two mentioned problems with the updated DLL.