Batman Vengeance Widescreen

Discuss tools to aid in the modification and running of Rayman games.

Moderator: Modding and utilities team

Forum rules
Please keep the forum rules and guidelines in mind when creating or replying to a topic.
Post Reply
AlphaYellow
Super Yellow Lum
Posts: 36
Joined: Tue Aug 17, 2021 12:42 am
Contact:
Tings: 180

Batman Vengeance Widescreen

Post by AlphaYellow »

So this game uses the CPA engine (OpenSpace), and only has 3 supported resolutions: 640x480, 800x600 and 1024x768. For the 3D rendering API, it uses Direct3D 8.

It's possible to change the resolution through the file osr_dx8_vf.dll, then searching for the following values with a hex editor:
80020000e001 (640x480), 200300005802 (800x600) or 000400000003 (1024x768). The value is located in the offset address 00098AE0.

The game is stretched in widescreen, so all it's needed is to find the right FOV value to extend the horizontal FOV. And also finding the values to fix the HUD stretching as well, but that's a lot more work I suppose.

1440x1080:
Batman 2024-03-07 12-42-12 - 405.png
1920x1080:
Batman 2024-03-07 12-44-58 - 95.png
Last edited by AlphaYellow on Fri Mar 08, 2024 12:42 pm, edited 1 time in total.
deton24
Art Rytus
Posts: 1194
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8932

Re: Batman Vengeance Widescreen

Post by deton24 »

You should be able to force resolution with dgVoodoo as well.
AlphaYellow
Super Yellow Lum
Posts: 36
Joined: Tue Aug 17, 2021 12:42 am
Contact:
Tings: 180

Re: Batman Vengeance Widescreen

Post by AlphaYellow »

deton24 wrote: Thu Mar 07, 2024 2:44 pm You should be able to force resolution with dgVoodoo as well.
dgVoodoo2 does not alter the internal aspect ratio, it just keeps the current one or stretches it, hence why a dedicated hex edit for the FOV is needed.
AlphaYellow
Super Yellow Lum
Posts: 36
Joined: Tue Aug 17, 2021 12:42 am
Contact:
Tings: 180

Re: Batman Vengeance Widescreen

Post by AlphaYellow »

Managed to find the instruction that accesses horizontal FOV and redirected it to another offset address using OllyDbg, HxD and Cheat Engine. However, widening it to accomodate for 16:9 introduces a little clipping issues at the sides. Will try to resolve it soon.

Batman  Vengeance Screenshot 2024.03.07 - 22.41.23.31.png
Garo
Walking shell
Posts: 91
Joined: Sun Aug 08, 2021 1:37 pm
Location: Vegetables' HQ
Contact:
Tings: 455

Re: Batman Vengeance Widescreen

Post by Garo »

AlphaYellow wrote: Thu Mar 07, 2024 11:47 pm Managed to find the instruction that accesses horizontal FOV and redirected it to another offset address using OllyDbg, HxD and Cheat Engine. However, widening it to accomodate for 16:9 introduces a little clipping issues at the sides. Will try to resolve it soon.


Batman Vengeance Screenshot 2024.03.07 - 22.41.23.31.png
To fix clipping issues you need to find the horizontal FOV value inside fix.sna. If you can share the fix.sna file I think I could probably find it.
lk19
Incrediball
Posts: 72
Joined: Thu Feb 11, 2021 8:52 pm
Tings: 360

Re: Batman Vengeance Widescreen

Post by lk19 »

Garo wrote: Sun Jun 30, 2024 1:03 am To fix clipping issues you need to find the horizontal FOV value inside fix.sna. If you can share the fix.sna file I think I could probably find it.
I've given up on messing around with fix.sna, since there can be so many scripts in the game that change the FOV in so many different SNA-files... it just doesn't seem to be worth the trouble sometimes. Instead I started injecting some code into the EXE to patch the FOV directly after it was read from the SNA file. This way every possible FOV-value gets scaled atomatically ;) I can share my assembler code with you if you like - but I don't know if the engine in this game is similar enough so that it can be done in the same way.

If this game is only using one single FOV value for everything, then, of course, you might as well just change the value in fix.sna ;)
AlphaYellow
Super Yellow Lum
Posts: 36
Joined: Tue Aug 17, 2021 12:42 am
Contact:
Tings: 180

Re: Batman Vengeance Widescreen

Post by AlphaYellow »

Garo wrote: Sun Jun 30, 2024 1:03 am
AlphaYellow wrote: Thu Mar 07, 2024 11:47 pm Managed to find the instruction that accesses horizontal FOV and redirected it to another offset address using OllyDbg, HxD and Cheat Engine. However, widening it to accomodate for 16:9 introduces a little clipping issues at the sides. Will try to resolve it soon.


Batman Vengeance Screenshot 2024.03.07 - 22.41.23.31.png
To fix clipping issues you need to find the horizontal FOV value inside fix.sna. If you can share the fix.sna file I think I could probably find it.
lk19 wrote: Sun Jun 30, 2024 4:18 pm
Garo wrote: Sun Jun 30, 2024 1:03 am To fix clipping issues you need to find the horizontal FOV value inside fix.sna. If you can share the fix.sna file I think I could probably find it.
I've given up on messing around with fix.sna, since there can be so many scripts in the game that change the FOV in so many different SNA-files... it just doesn't seem to be worth the trouble sometimes. Instead I started injecting some code into the EXE to patch the FOV directly after it was read from the SNA file. This way every possible FOV-value gets scaled atomatically ;) I can share my assembler code with you if you like - but I don't know if the engine in this game is similar enough so that it can be done in the same way.

If this game is only using one single FOV value for everything, then, of course, you might as well just change the value in fix.sna ;)
Nope, this game doesn't use any SNA files, it seems to be a slightly more recent version of the CPA engine, as it all seems to be centered more around DLL files. But I wasn't able to find the right FOV value yet, that's just a multiplier which obviously gives a glitched result in the sides, maybe with some more digging it can be found.
lk19
Incrediball
Posts: 72
Joined: Thu Feb 11, 2021 8:52 pm
Tings: 360

Re: Batman Vengeance Widescreen

Post by lk19 »

AlphaYellow wrote: Sun Jun 30, 2024 4:50 pm Nope, this game doesn't use any SNA files, it seems to be a slightly more recent version of the CPA engine, as it all seems to be centered more around DLL files. But I wasn't able to find the right FOV value yet, that's just a multiplier which obviously gives a glitched result in the sides, maybe with some more digging it can be found.
Have you tried loading either the EXE or the DLL-file you were talking about into a disassembler/decompiler (e.g. Ghidra) and looked if there exists a function "GLI_xAdjustCameraToViewport"? If so, it should be very easy to find the relevant FOV value and maybe even patch it directly in the EXE/DLL.
If such a function doesn't exist you might have some luck looking for tangent/arctangent functions, as these are usually used to convert between horizontal and vertical FOV (https://en.wikipedia.org/wiki/Field_of_ ... ideo_games).
AlphaYellow
Super Yellow Lum
Posts: 36
Joined: Tue Aug 17, 2021 12:42 am
Contact:
Tings: 180

Re: Batman Vengeance Widescreen

Post by AlphaYellow »

lk19 wrote: Sun Jun 30, 2024 5:13 pm Have you tried loading either the EXE or the DLL-file you were talking about into a disassembler/decompiler (e.g. Ghidra) and looked if there exists a function "GLI_xAdjustCameraToViewport"? If so, it should be very easy to find the relevant FOV value and maybe even patch it directly in the EXE/DLL.
If such a function doesn't exist you might have some luck looking for tangent/arctangent functions, as these are usually used to convert between horizontal and vertical FOV (https://en.wikipedia.org/wiki/Field_of_ ... ideo_games).
Yeah, already found the function (it was in enginecore_vf.dll) and updated the fix. No more missing geometry on the sides :) Here's the link: https://community.pcgamingwiki.com/file ... n-fov-fix/
Post Reply