We crown ourselves

Royal Para Regiment

How to Install HD2 on Linux

  • snowman
  • Offline
  • Your most dear friend.
More
3 years 11 months ago - 3 years 11 months ago #49 by snowman
Replied by snowman on topic How to Install HD2 on Linux
On Monday, I was like... :idea:

Spent 2 days trying to convert Windows functions like ShellExecute() and manage Windows C++ libraries under Linux... even spending a little time to read about possibilities on Wine... couldn't make it work :grumpy:

2 hours ago: "Let's try the easiest Linux solution I've thought `It's too easy to work`..."
Created a shell file, copy+pasted the one line with wine prefix and the game path, saved it... made it executable, bound it to ALT+H... tested... works every time :heart:

Problems solved. No more libraries, process ids and compilation. Lesson learned. Now moving on to more important things :P

"Straight and narrow is the path."
Last edit: 3 years 11 months ago by snowman.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago - 3 years 1 month ago #50 by mökki medium
Replied by mökki medium on topic How to Install HD2 on Linux
The WINE implementation of DirectX 8 is understandably very old and I don't expect it to be getting any updates any time soon, so a way to get more FPS out of the game is to use dxwrapper to convert the DirectX 8 calls to DirectX 9. This might already boost performance as wined3d9 might be faster thanks to more work being done to it.
However, at least for me, the big performance gains come from then using dxvk (formerly d9vk) to convert the DirectX 9 calls over to Vulkan.

Installation is simple:
dxwrapper can be installed into the game via two ways, either by loading it as an ASI if you already have an ASI loader installed, or by hooking a custom d3d8 dll.
The popular widescreen patch already works off of an ASI loader, so if you are using that you are good to go. Now just download the newest version of dxwrapper off their github releases page and drop "dxwrapper.asi" and "dxwrapper.ini" from the archive into your H&D2 installation folder's "scripts" subfolder. Note the lowercase letters! "Scripts" is a location for the game's files and the wrapper will not run if you place the files there.
Also note that it is unadvisable to extract all of the contents of the archive to your game folder! Dxwrapper is meant to be used by selecting individual DLLs/ASIs you need and not by dumping everything in at once. It is likely the game will cease to work if you do this.
If you don't have the widescreen patch or other ASI loader installed, drop the d3d8.dll file from the archive's "Stubs" folder into the main installation folder of H&D2 and then drop the dxwrapper.dll and dxwrapper.ini files there as well.

After dropping whatever files you need, open dxwrapper.ini and under [Compatibility] change "d3d8to9" from "0" to "1".
You can also check for additional settings under "d3d9" and enable them if you want to, but this is not necessary.

If you don't already have dxvk (This is automatically installed and enabled in Proton, for example), download it from the github releases page, extract it somewhere and run the setup script under your chosen wine prefix:
Code:
env WINEPREFIX=path/to/prefix ./setup_dxvk.sh install
If you use the default wineprefix you can omit the env WINEPREFIX part.

After this you are all set! You have enabled dxwrapper in your H&D2 installation and dxvk will further convert that to Vulkan.
I personally experienced some hitches here and there when running d3d8, such as fps drops in Africa1 (30fps when at certain angles) and some custom maps completely tanking my fps if I look the wrong way. With dxwrapper and dxvk my game is locked at 95FPS all the time. (This seems to be some sort of a game fps lock?)
Note that your graphics card and its driver need to support vulkan in order for this to work. If you are running any discrete graphics card or anything newer than 2010 along with the latest mesa driver, you should be fine.[/code]
Last edit: 3 years 1 month ago by mökki medium.
The following user(s) said Thank You: snowman, Damni, jacobston

Please Log in or Create an account to join the conversation.

  • Damni
  • Topic Author
  • Offline
  • Sergeant Major
More
3 years 1 month ago #51 by Damni
Replied by Damni on topic How to Install HD2 on Linux
Great information. Thanks.

I would update the first post, but this editor doesn't let me edit it. (if I click on edit, the editor is just blank).
Maybe some admin can at least add a link to post #50 in the original. Cheers!

HD2 on Linux thread here
The following user(s) said Thank You: snowman

Please Log in or Create an account to join the conversation.

  • snowman
  • Offline
  • Your most dear friend.
More
3 years 1 month ago #52 by snowman
Replied by snowman on topic How to Install HD2 on Linux

Great information. Thanks.

I would update the first post, but this editor doesn't let me edit it. (if I click on edit, the editor is just blank).
Maybe some admin can at least add a link to post #50 in the original. Cheers!
 

Okay. Yes, the old editor doesn't work anymore and this new one can't handle old format :( It breaks easily. It happened to Flash's Lutsip editor thread too. I had to copy all the text and images, then rewrite it from scratch.

"Straight and narrow is the path."

Please Log in or Create an account to join the conversation.

  • snowman
  • Offline
  • Your most dear friend.
More
3 years 1 month ago #53 by snowman
Replied by snowman on topic How to Install HD2 on Linux
Fixed!

"Straight and narrow is the path."

Please Log in or Create an account to join the conversation.

  • Damni
  • Topic Author
  • Offline
  • Sergeant Major
More
2 years 6 months ago #54 by Damni
Replied by Damni on topic How to Install HD2 on Linux
Updated the first post with the new IPs for /etc/hosts
Code:
89.166.9.246 hd2.available.gamespy.com #hidden and dangerous 2 check 89.166.9.246 hd2.master.gamespy.com #hidden and dangerous 2 heartbeats 89.166.9.246 hd2.ms14.gamespy.com #hidden and dangerous 2 server list

HD2 on Linux thread here
The following user(s) said Thank You: snowman, Juanma66

Please Log in or Create an account to join the conversation.

  • Tecnom
  • Hellcat in 3 days
  • Winters in 4 days
  • Alexliberty in 5 days
  • Mizha in 9 days
  • British Bulldog in 10 days
Powered by Kunena Forum