VOGONS


First post, by ed_barber

User metadata
Rank Newbie
Rank
Newbie

Back when Hitman Contracts was still a new game, there was this impressive effect that projected next to agent 47 showing the rain coming down the window. In this thread https://www.hitmanforum.com/t/rain-effects-missing/16209, they say it worked on the GeForce 4 series card but on modern hardware it doesn't show up. It would be great if this would be restored as everything else using this wrapper works excellent.

Attachments

  • 20190326123636_1.jpg
    Filename
    20190326123636_1.jpg
    File size
    313.8 KiB
    Views
    6285 views
    File comment
    Water fall effect is static on this angle.
    File license
    Fair use/fair dealing exception
  • 20190326123632_1.jpg
    Filename
    20190326123632_1.jpg
    File size
    349.54 KiB
    Views
    6285 views
    File comment
    Water fall effect is moving on this angle.
    File license
    Fair use/fair dealing exception
  • 20190326123041_1.jpg
    Filename
    20190326123041_1.jpg
    File size
    285.75 KiB
    Views
    6285 views
    File comment
    Rain effect missing in this scene.
    File license
    Fair use/fair dealing exception

Reply 1 of 18, by Dege

User metadata
Rank l33t
Rank
l33t

Sounds interesting. Another GF4-only feature?
I guess the driver of that card had some really weird bugs.
Like the one causes 'shiny floor' in Splinter Cell 1 (I couldn't figure out how that gf-pipeline was interpreted exactly by the driver).

I'll give it a shot.

Reply 2 of 18, by Dege

User metadata
Rank l33t
Rank
l33t

The raindrop effect is achieved by texture coord transformation.
The D3D renderer disables the transformation for the time the raindrops are being rendered. I don't know why.
The guy on the forum you linked wrote that it only worked for him on a GF MX440. My tip is that, similarly to the buggy impl of shadow buffers on a GF4, the old driver always performed texcoord transformation so maybe the developers of the game didn't even notice that their code had a bug.
I'm not sure though, so I don't want to include this feature into dgV GF4 profile.

Instead, I patched the game executable. Now the raindrops work in the main menu, that's the only and quick test I did.
Also, I don't know which version of the game I have so the executable may be not from the latest game patch.

http://dege.fw.hu/temp/HitmanContracts_d3d_ra … ndrop_patch.zip

Reply 3 of 18, by HMBM47

User metadata
Rank Newbie
Rank
Newbie

Just wanted to report that the fix works for the most part.
From what I've tested the levels where it work are the Main menu, Asylum Aftermath, Deadly Cargo, Hunter and Hunted, and Traditions of the trade.
The effect still seems to be broken on The Wang Fou Incident (Fog below streetlamps pause at certain angles) and Beldingford Manor (Start of level drain water - Lake - Window rain pauses at certain angles).
Any chance you would be able to patch the .exe further so these levels work, or have you already done all that can be done?

Not sure if it matters, but I've provided the Steam .exe in case that's the reason those levels don't work with my version?
https://www.dropbox.com/s/ypn3nq3f9eoyaxs/HMC-Steam.rar?dl=0

Did you just do a simple hexedit or did you decompile the .exe? Perhaps you could provide the info of what was changed and how you did it? (If not too complicated)

Edit:
After some digging I found that the GOG version was used for the fix EXE.
I was then able to easily compare the files to find that the hex string (correct term?)
53 6A 18 53 50 FF 92 FC 00 00 00
was replaced with
90 90 90 90 90 90 90 90 90 90 90.
I was easily able to find and replace the same instance in the Steam EXE.
The issues I stated above are still present.

Edit 2:
After further testing it DOES partially work at Beldingford Manor. The sky and (partial) fog over the lake move.

Reply 4 of 18, by Dege

User metadata
Rank l33t
Rank
l33t

Yes, that was the change I made. I cut out a call disabling texcoord projection in the code.
I think not all of the instances of that call matches that binary sequence so it'd be better to search for them by debugging.
Could you attach savegames for the problematic points plz? I could investigate them.

Reply 5 of 18, by ZT111

User metadata
Rank Newbie
Rank
Newbie

Thanks for making this fix. A friend of mine made it into an asi script so it doesn't replace the exe. As HMBM47 said, the effects still seem to be not functioning in other places, like the storm drain, the river's moving water in beldingford manor and the fog under lamps in deadly cargo.

Save: https://mega.nz/file/WpgiFCrJ#ok5-l84jarP0YlT … GKpDwYAOdHyUZ4g

Attachments

  • test2.png
    Filename
    test2.png
    File size
    1.96 MiB
    Views
    5423 views
    File comment
    Deadly Cargo
    File license
    Fair use/fair dealing exception
  • test.png
    Filename
    test.png
    File size
    1.54 MiB
    Views
    5423 views
    File comment
    Beldingford
    File license
    Fair use/fair dealing exception
Last edited by ZT111 on 2021-02-10, 20:27. Edited 1 time in total.

Reply 6 of 18, by daniel_u

User metadata
Rank Member
Rank
Member
Dege wrote on 2019-06-22, 08:10:
The raindrop effect is achieved by texture coord transformation. The D3D renderer disables the transformation for the time the r […]
Show full quote

The raindrop effect is achieved by texture coord transformation.
The D3D renderer disables the transformation for the time the raindrops are being rendered. I don't know why.
The guy on the forum you linked wrote that it only worked for him on a GF MX440. My tip is that, similarly to the buggy impl of shadow buffers on a GF4, the old driver always performed texcoord transformation so maybe the developers of the game didn't even notice that their code had a bug.
I'm not sure though, so I don't want to include this feature into dgV GF4 profile.

Instead, I patched the game executable. Now the raindrops work in the main menu, that's the only and quick test I did.
Also, I don't know which version of the game I have so the executable may be not from the latest game patch.

http://dege.fw.hu/temp/HitmanContracts_d3d_ra … ndrop_patch.zip

Hi Dege,
Can this impact Splinter cell 1 issues? If yes,can you at least create a special version of DgVoodoo for me to test.? I would very much like to try .
Thanks.

Reply 8 of 18, by hitbm47

User metadata
Rank Newbie
Rank
Newbie
HMBM47 wrote on 2019-08-03, 23:47:
Just wanted to report that the fix works for the most part. From what I've tested the levels where it work are the Main menu, As […]
Show full quote

Just wanted to report that the fix works for the most part.
From what I've tested the levels where it work are the Main menu, Asylum Aftermath, Deadly Cargo, Hunter and Hunted, and Traditions of the trade.
The effect still seems to be broken on The Wang Fou Incident (Fog below streetlamps pause at certain angles) and Beldingford Manor (Start of level drain water - Lake - Window rain pauses at certain angles).
Any chance you would be able to patch the .exe further so these levels work, or have you already done all that can be done?

Not sure if it matters, but I've provided the Steam .exe in case that's the reason those levels don't work with my version?
https://www.dropbox.com/s/ypn3nq3f9eoyaxs/HMC-Steam.rar?dl=0

Did you just do a simple hexedit or did you decompile the .exe? Perhaps you could provide the info of what was changed and how you did it? (If not too complicated)

Edit:
After some digging I found that the GOG version was used for the fix EXE.
I was then able to easily compare the files to find that the hex string (correct term?)
53 6A 18 53 50 FF 92 FC 00 00 00
was replaced with
90 90 90 90 90 90 90 90 90 90 90.
I was easily able to find and replace the same instance in the Steam EXE.
The issues I stated above are still present.

Edit 2:
After further testing it DOES partially work at Beldingford Manor. The sky and (partial) fog over the lake move.

Hi, excuse me for joining so late in the discussion. But I have found new scenario or cases in which the textures doesn't work properly.

Furthermore, I have applied this hex-edit and it fixes most of the waterfall issues. The drain-pipe in Beldingford Manor only works when looking at it in first person or with a sniper scope, also before applying the hex-edit the sky-clouds also work when looking at them with a sniper or first person pistol. Then getting the Enforcer sniper at the Barn and looking upwards at the side path to the back-entry of the castle/manor causes the sniper scope texture to disappear; in addition, looking in first person with a pistol in the same area and direction causes 47's arms and pistol to become transparent.

Kind regards
Jacques

Reply 10 of 18, by ZT111

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2021-02-09, 17:58:

Hi,

could you plz provide me savegames for the problems in question?
I think I could have a look at them a bit later.

https://mega.nz/file/WpgiFCrJ#ok5-l84jarP0YlT … GKpDwYAOdHyUZ4g

There's one more effect I noticed but forgot to mention, which is in the level "meat king's party", there's supposed to be some moving rain reflections on the wall in the room with the dead girl hanging. They're working on opengl/consoles. The effect working: https://youtu.be/apNaX2wwzVY?t=853 Like hitbm47 said, this effect and the others only work when looking at it in first person from certain angles, but they're supposed to work all the time.

On another note, there's a similar issue with Hitman 2. On opengl only with Hitman 2, the ninjas in the levels "hidden valley", "at the gates" and "shogun showdown" all have an effect where their goggles glow red. On d3d, this effect is just missing. I haven't noticed any other things D3D may be missing with H2.

Attachments

Reply 11 of 18, by Mandalorian

User metadata
Rank Newbie
Rank
Newbie

The shiny glasses thing seems to be more of a graphic bug than a detail that was included. I don't think the glasses looked that way. In Hitman 2 SA many effects are altered if one or the other render is used. In Hitman Contracts I have noticed the same problems. If you switch to OpenGL, the effects seem to work but something strange happens. If we look through the holes in the doors, the image is in focus, and it looks horrible. I guess IO never agreed on which of the two to use xD.

Reply 12 of 18, by ZT111

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2021-02-09, 17:58:

Hi,

could you plz provide me savegames for the problems in question?
I think I could have a look at them a bit later.

I realized those weren't for the affected parts in the levels. This one is.
https://mega.nz/file/yw40SK5A#DmRIkwkEJLHMAtF … GxgFLaNubbD7wjs

Reply 13 of 18, by NightDoctor

User metadata
Rank Newbie
Rank
Newbie

Hi guys, I really enjoy following the development of these fixes.
Hitman Contracts is one of my favorite games, and apparently there are lots of things that could potentially be fixed, if we better understand the differences between GL and D3D.
Apparently, the PS2 version is the only version where all graphical effects are correctly rendered?
Anyways, here's a video on youtube, showcasing some other bugs, most notably the broken (or "frozen") fog.

https://youtu.be/kTCsDxNv3nY

I'm really hoping for a future fix for this as well.

Cheers!

Reply 14 of 18, by NightDoctor

User metadata
Rank Newbie
Rank
Newbie

The creater of the 3d vision fix (https://helixmod.blogspot.com/2017/11/hitman- … 538585446366216), also mentions a problem with close distance fog, following the player. He seems to have fixed it, but I don't know how.

Reply 15 of 18, by p6kocka

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2019-06-22, 08:10:
The raindrop effect is achieved by texture coord transformation. The D3D renderer disables the transformation for the time the r […]
Show full quote

The raindrop effect is achieved by texture coord transformation.
The D3D renderer disables the transformation for the time the raindrops are being rendered. I don't know why.
The guy on the forum you linked wrote that it only worked for him on a GF MX440. My tip is that, similarly to the buggy impl of shadow buffers on a GF4, the old driver always performed texcoord transformation so maybe the developers of the game didn't even notice that their code had a bug.
I'm not sure though, so I don't want to include this feature into dgV GF4 profile.

Instead, I patched the game executable. Now the raindrops work in the main menu, that's the only and quick test I did.
Also, I don't know which version of the game I have so the executable may be not from the latest game patch.

http://dege.fw.hu/temp/HitmanContracts_d3d_ra … ndrop_patch.zip

Hello. Could you pls upload the file once more. Sadly, the link doesn´t work anymore.
Thank you

Reply 16 of 18, by eddman

User metadata
Rank Member
Rank
Member
p6kocka wrote on 2022-06-21, 19:26:

Hello. Could you pls upload the file once more. Sadly, the link doesn´t work anymore.
Thank you

Always check archive.org. You'd be surprised what gets archived there. Honestly I didn't expect this to work, but it did.

https://web.archive.org/web/20210701000000*/h … ndrop_patch.zip

Reply 17 of 18, by BurntShrimp

User metadata
Rank Newbie
Rank
Newbie

I found another binary sequence that breaks some effects.

Replace:
6A 00 6A 18 6A 00 50 FF 92 FC 00 00 00
With:
90 90 90 90 90 90 90 90 90 90 90 90 90

Must be used with Dege's fix to work.
Replace:
53 6A 18 53 50 FF 92 FC 00 00 00
With:
90 90 90 90 90 90 90 90 90 90 90

This should completely fix the water in Beldingford Manor, rain effect, and the fog under street lamps in the other levels. The fog/smoke in various levels is still partially broken, easily noticeable in Meat King's party and Beldingford Manor.

hc2.jpg
Filename
hc2.jpg
File size
501.19 KiB
Views
3430 views
File license
Fair use/fair dealing exception
hc1.jpg
Filename
hc1.jpg
File size
359.9 KiB
Views
3430 views
File license
Fair use/fair dealing exception

In OpenGL, both of these textures move.

Reply 18 of 18, by hitbm47

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2021-02-09, 17:58:

Hi,

could you plz provide me savegames for the problems in question?
I think I could have a look at them a bit later.

BurntShrimp wrote on 2022-07-12, 07:14:
I found another binary sequence that breaks some effects. […]
Show full quote

I found another binary sequence that breaks some effects.

Replace:
6A 00 6A 18 6A 00 50 FF 92 FC 00 00 00
With:
90 90 90 90 90 90 90 90 90 90 90 90 90

Must be used with Dege's fix to work.
Replace:
53 6A 18 53 50 FF 92 FC 00 00 00
With:
90 90 90 90 90 90 90 90 90 90 90

This should completely fix the water in Beldingford Manor, rain effect, and the fog under street lamps in the other levels. The fog/smoke in various levels is still partially broken, easily noticeable in Meat King's party and Beldingford Manor.

hc2.jpg
hc1.jpg

In OpenGL, both of these textures move.

Hi @Dege,

So sorry for replying after years, this is really bad of me, I just got held op with other things at the time and did not bother with Hitman Contracts often, although it used to be one of my favourites.

I will try to get you the correct saves later if you are even still interested, but @BurntShrimp 's hex-edits fixes most of the issues, although this PC version is still plagued with graphical issues which is especially apparent on BeldingFord Manor, the lighting radiated from like lamp-poles causes your arms and guns to go transparent and the corsair textures of the sniper scope to disappear.

By the way, thanks for the incredible work of DGVoodoo2, it helps a lot with Splinter Cell 1's Shadows. Furthermore, do some of you guys have better tools to help investigate the machine-code of hitman's executable? From my understanding, the best one can do is to reverse engineer the code of the .exe , but then you'll not even see the original logic of the code, not even to mention comments in the code. I simply used the HxD hex-editor to apply your mentioned fixes to my .exe and I noticed a lot of the "FF 92 FC 00 00 00" hexadecimal characters in the .exe.

I would also like to note, I remember noticing some of these graphical bugs on the PS3 HD Trilogy version as well, as if they simply ported it to PS3 with a Widescreen patch. The version I had with the least issues was the PS2 version, although you were missing bullet-casing droppings due to memory constraints. From what I can tell when looking at, unfortunately bad recordings of PS2 gameplay, the mist in the gardens simply might be static, but it is really hard to tell.

As you can see in the following training screenshot, they are definitely rendering textures/shadows/lighting out of order and I remember this specifically happening on the PS3 as well:

Beldingfordmanor_5.png
Filename
Beldingfordmanor_5.png
File size
693.25 KiB
Views
3067 views
File license
Fair use/fair dealing exception

The following water-dump used to be static without the latest hex-edit from BurntShrimp:

Beldingfordmanor_1.png
Filename
Beldingfordmanor_1.png
File size
947.2 KiB
Views
3067 views
File license
Fair use/fair dealing exception

And the following has to do with the transparent lighting and scope issues:

Beldingfordmanor_3.png
Filename
Beldingfordmanor_3.png
File size
646.97 KiB
Views
3067 views
File license
Fair use/fair dealing exception
Beldingfordmanor_4.png
Filename
Beldingfordmanor_4.png
File size
165.01 KiB
Views
3067 views
File license
Fair use/fair dealing exception
Beldingfordmanor_2.png
Filename
Beldingfordmanor_2.png
File size
551.22 KiB
Views
3067 views
File license
Fair use/fair dealing exception

Lastly, this is one amazing web-forum you guys have created @Dege, I can tell you are a next-level developer with all the features here and DGVoodoo2.

Kind regards
Jacques