Old lithtech games d3d to opengl wrapper

Discuss anything not covered by any of the other categories.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Old lithtech games d3d to opengl wrapper

Post by revelator »

Tinkered a bit with wine and managed to make versions that supports all the old ddraw to d3d functionality on windows :)
dll's included are ddraw.dll d3drm.dll d3dim.dll d3dxof.dll ddrawex.dll.

If interrested i can upload them so that you can enjoy these old games again :)
no compatibility settings besides admin needed and no setup required, just drop the dlls in the same folder the game exe is in and away you go :mrgreen:

Tested on blood 2 aliens vs predator 2 and both games play without any problems.
Custom launcher for aliens vs predator where you can set resolutions as high as your card allows, also includes is a widescreen fix which can be enabled via the launcher (not made by me). For Blood2 i made a simple launcher that sets affinity for the game to 1 cpu (avoids crashes in most cases), i can also include a fixed client.exe for this game that prevents crashes at high resolutions (from dgvoodoo). These two games use all the dlls provided, actually they also use an older version of dinput, and avp2 has some custom dinput dll's included that prevents jerky mouse movement at high resolutions. Unfortunatly these do not work with Blood 2 (mouse goes bananas), but Blood 2 luckily does not have the same jerky mouse bug avp2 has, so who cares :P . The dll's might also work with other games that relied on the older ddraw to d3d functionality (dx6-7).
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Old lithtech games d3d to opengl wrapper

Post by revelator »

Well heres the link :)

https://sourceforge.net/projects/cbadva ... z/download

for avp2 drop all dlls from the main folder plus the dlls in avp2-dinput fix folder to the main dir where avp2.exe is.

If you want the custom launcher drop it from the avp2-launcher dir to the same dir as the dll's.

The custom launcher allows setting all resolutions and contains a fix for widescreen (enable in settings).

For blood2 drop all dll'sin the main folder into the main dir where blood2.exe is.

for widescreen support copy the folder Custom from blood2- widescreen-patch into the main dir,
and in the blood2 launcher hit customize. Locate WidescreenPatch.REZ and hit add and tick allways load these rez files.
for the nightmares addon locate WidescreenPatchNm.REZ and add that instead. You can only use one of these at a time
so do not add both.
Blood2 sometimes gets rather unstable at high resolutions, setting affinity to 1 cpu usually takes care of most crashes,
but it still does it from time to time. So save often. Instead of setting this manually via taskmanager i included a simple launcher to set this automatically, copy it out of the blood2-launcher dir and into the main dir where blood2.exe is located. Now start the game with a shortcut to the launcher instead.

Remember to set "allways run as admin for all users" in compatibility settings for both games, nothing else is needed.
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Old lithtech games d3d to opengl wrapper

Post by revelator »

One other quirk that might crop up, is if you are using a high dpi usb mouse.
These tend to break lithtech engines of various flavors (yup even fear).
I been the unfortunate owner of such a beast so i know :twisted:

The wrappers from dgvoodoo work but the window tends to have problems in fullscreen when you have the above.
Not sure why a mouse would break a game renderer but it does sigh.
The wine wrappers do not exhibit this behaviour so its something directly linked to using directx,
wine uses opengl for rendering but dgvoodoo uses d3d.
dxwnd also works ok'ish with lithtech engines, but it can be a little daunting to set up.

I gotten 99% of the most wanted games to run on modern OS (win7 to win10),
so if anyone has a problem with a game let me know. I might have an idea what you need to do :).
Dosgames notwithstanding, allthough theres only really one way to play a dosgame these days (DOSBox) or on an old PC with DOS or Win9x.

There are several flavours of DOSBox out there though, some use rather elaborate tricks to emulate old hardware,
others can use shaders so that your pixels might get a shineup.
Most up to speed version is probably dosbox-x which is a fully statically linked DOSBox with a good deal of the old daum code. Its standalone, eg. needs no SDL or SDL2 dll's. It also supports long file names which DOS did not untill version 7.
This can be disabled though since not everything works as it should with this on (application must support it in the first place or things get pretty screwy).
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Old lithtech games d3d to opengl wrapper

Post by revelator »

dxwnd works better for blood2 i discovered, while the wine d3d to opengl wrappers work for it, it crashes a lot more often with them.
for avp2 the wine wrappers work splendidly though :).
I suspect that some directsound calls dont get fully translated as when it crashes i noticed that the sound started skipping wildly.
But its a bit odd since im not using wines directsound dll :shock: , i guess in this case mixing some parts of directx (directsound in this case) with wines, leads to some crap that the engine cannot handle.

Also a small warning for avp2, if you intend to set up resolutions via the old launcher with wine, dont. It hangs the launcher indefinatly, use the custom launcher instead.

Played all characters of avp2 to the end with no crashes so far :)
Productivity is a state of mind.
Juwani93
Posts: 7
Joined: Sun Nov 12, 2023 6:29 pm

Re: Old lithtech games d3d to opengl wrapper

Post by Juwani93 »

I just tried to download your file from the link you posted (sourceforge) and it says: "The file could not be found or is not available. Please select another file." Is there another way to download the file or can you please just send me the file?
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Old lithtech games d3d to opengl wrapper

Post by revelator »

Ah my bad i cleaned out a lot of gunk cluttering up the sourceforge site it might have went with that :lol: .

Ill reupload it together with a port of the avp2 custom launcher to blood2 (the lithfix part does not work cause there was newer one built for blood2 instead it uses the widescreen patch which is on by default with the launchers.) the blood2 client.exe and blood2.exe have been patched to single cpu affinity (makes them a whole lot more stable havent crashed here yet.). If you want ill also include a patched autoexec.cfg with weapon wheel set for blood2 (it newer worked).
Productivity is a state of mind.
Juwani93
Posts: 7
Joined: Sun Nov 12, 2023 6:29 pm

Re: Old lithtech games d3d to opengl wrapper

Post by Juwani93 »

Yes please do that! It would be so great to play this game with nvidia in fullscreen again :biggrin:
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Old lithtech games d3d to opengl wrapper

Post by revelator »

Ok they should be up again here https://sourceforge.net/projects/cbadva ... 0Projects/

AVP2.zip is for alien vs predator 2
AVP2 Primal Hunt.zip is for the mission pack to alien vs predator
Blood2.zip is for both Blood2 and the mission pack The Nightmare Levels (GOG version) the executables have been patched for single affinity and stability with high resolutions.

The avp2 versions also have the blood and guts rez for more gore :P but i couldnt remember if i also added the high def patches so if the launcher croacks let me know.
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Old lithtech games d3d to opengl wrapper

Post by revelator »

Games need to be patched to latest btw :)
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Old lithtech games d3d to opengl wrapper

Post by revelator »

for avp2 it is also recommended to install this https://www.moddb.com/mods/avp2-master- ... /downloads
it fixes online play as well as some other bugs :) then copy over the files from AVP2.zip overwriting what is there.
Productivity is a state of mind.
Juwani93
Posts: 7
Joined: Sun Nov 12, 2023 6:29 pm

Re: Old lithtech games d3d to opengl wrapper

Post by Juwani93 »

Thanks for all the effort, but unfortunately the game still doesn't recognize NVIDIA gpu. I copied all dlls into game folder and also set to run the game with gpu in nvidia control panel, but still no luck. Those lithtech games are such a pain in the ass to run on modern systems :neutral:
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Old lithtech games d3d to opengl wrapper

Post by revelator »

oh its on a laptop ? yeah i havent tested it on one of those but it should work unless something screws up with the changeable gfx card option (i assume its one of those models with an intel igpu and a second nvidia card).

try copying the d3dim700.dll to the base folder as d3dimm.dll.

on first start you should use the games own launcher to correctly detect the card after that you can use the custom launcher.

the resolution in the autoexec.cfg i uploaded is set at 1920x1080 which may be to high if using the laptops screen, in that case edit the file using notepad++ and change "SCREENWIDTH" "1920" and "SCREENHEIGHT" "1080" to your native resolution.
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Old lithtech games d3d to opengl wrapper

Post by revelator »

yeah some of the older lithtech games can be a real nuisance on modern machines, that is why i newer liked directx to begin with (legacy support is shoddy at best), newer had these kind of problems with older opengl games.

worst offenders in the directx garden are engines based on versions 6-7 and older of directx since they use a totally different mechanic than later versions of directx. from dx8 and forward we have the option to convert calls to vulkan at least but that wont work with these older models.
Productivity is a state of mind.
Juwani93
Posts: 7
Joined: Sun Nov 12, 2023 6:29 pm

Re: Old lithtech games d3d to opengl wrapper

Post by Juwani93 »

No, still no luck. I renamed the dll file just as you told me to, but nothing changes. I play it on gaming laptop, Acer Predator Helios 300, and there are 2 video cards: Intel UHD Graphics 630 and Nvidia Geforce GTX 1660Ti
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Old lithtech games d3d to opengl wrapper

Post by revelator »

Ok ill upload the complete blood2 game which i know works, even the intel icd should be able to play it with plenty of speed in case it croacks on the nvidia (i play it on a gtx 1080 ti so that would indeed be odd). Included are high res upscaled texture packs as well as widescreen fix (all are loaded at start using the custom launchers the original blood2.exe will only load the rez files that came with the game so its a good way to rule out any rez file related problems). the setup.exe file creates shortcuts on the desktop for the custom launchers, remember to set those shortcuts to run as admin as otherwise the game might have problems saving (dependant on where you unpacked it) should not be nessesary to set any compatibility flags as the ddraw wrapper does that.

*removed the links, the game is still being sold on stores... ~eukara*

had to split the archive as it was to big to upload as it was.
Productivity is a state of mind.
Post Reply