Patching Lego Universe to not crash in wine
The old non-free OS game Lego Universe runs moderately well in Wine. However, it does tend to crash with errors like the following.
0138:err:virtual:allocate_virtual_memory out of memory for allocation, base (nil) size 00100000
Usually when entering a different region and the game is clearly trying to load all the assets for this region. The game will freeze up for a second, and then crash. What solved the errors was using a 4GB Patch – NTCore utility that patches the binary headers so the program can address more than 2GB of RAM.
That was it! This small program works in Wine. You pass it a binary name to patch. I backed up the file, of course, and the differences are very small.
Screenshot of vimdiff :!xxd for the files
References
Failed research
From https://simpler-website.pages.dev/html/2021/1/wine-environment-variables/
export __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia # specifically for my setup from `vulkaninfo | grep -i 'gpu id :'` export DXVK_FILTER_DEVICE_NAME="Intel(R) UHD Graphics 630 (CFL GT2)"
From https://github.com/UchuServer/Uchu experimental
export WINEDLLOVERRIDES="dinput8.dll=n,b"
I tried winetricks d3dx9_43
but it didn't help. I then realized it uses d3dx9_34 but that didn't help either. I tried using wine first, then native, but that breaks the game and rendering even on the login screen.
From https://forum.winehq.org/viewtopic.php?t=36996
winetricks l3codecx directshow wmp10 # but skipped wmp10; these did not help
From https://askubuntu.com/questions/835039/games-not-running-properly
# regedit HKEY_CURRENT_USER/Software/Wine/Direct3D -> string VideoMemorySize = 512
From https://forums.linuxmint.com/viewtopic.php?t=167002 # regedit HKEY_CURRENT_USER/Software/Wine/Direct3D -> VideoMemorySize=2048, DirectDrawRenderer=""
I also tried winetricks dxvk
which also added d3dcompiler_43 d3dx9 d3dcompiler_47 dxvk
but this completely broke the game. So I reset my wineprefix afterwards.
I didn't record where this came from, but this didn't help.
echo $(( 1024 * 1024 )) | sudo tee /proc/sys/vm/min_free_kbytes
Comments