Tonic Trouble Tools (Retail)

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

Moderators: English moderators, Modding and utilities team

Post Reply
Hipnosis183
Électoon
Posts: 3
Joined: Wed Jul 24, 2019 3:23 am
Location: Argentina
Tings: 15

Tonic Trouble Tools (Retail)

Post by Hipnosis183 » Wed Jul 24, 2019 8:58 am

Note: While not a Rayman game, I think it's related enough for the thread to be here. If not, move it to off-topic.

Well, making this game to work on newer systems is for sure a complete pain, even more taking in mind all the different versions for both Retail and Special Editions. The objective of this thread is to list the tools already available to make the game perfectly playable on modern systems.

First of all, this will cover just the Retail version, more specific the english release (TONIC TROUBLE REVIEW ENGLISH : TT221099-PC), although some tools could work with other versions if specified. You can check your version by pressing F4 in-game and typing "version".

Fixed Executable

The english version (this don't seem to affect other releases, i'm not sure) isn't compatible with modern Windows (above XP), due to the game executable's compression method. Thankfully, the user RibShark made a fix for it, which can be downloaded here:

Fixed Executable (RibShark): Download

I also took the oportunity to modify this executable and the setup file to add the following features:

- Patched the "ubi.ini" location to "C:\Windows" instead of "C:\Windows\Ubisoft" (the executable can't create folders), so by running the "SetUpTT.exe" you can recreate the file without needing to install the game (which would make it portable). (I couldn't find a way to redirect the file to the root game folder instead).
- Patched the "\Videos" folder location to the game folder, making the presence of the CD drive now useless.
- The executables won't create "*.log" files anymore.

Fixed Executables (Hipnosis): Download

Note: if you use this version, be sure to have the file "ubi.ini" in "C:\Windows", or run the setup first to create one; if not, the game would be looping searching for it without starting.

dgVoodoo

Not only dgVoodoo is great for all D3D, DDraw and Glide games, but it also works great with Tonic Trouble (D3D6), and is the preffered wrapper to use. I didn't test if it's a must for this game to work, but for sure will make it look more beutiful (or at least as much as this game could be). This utility will work with all the editions and versions of the game. Here is the download for dgVoodoo 2.6 files already configured to work at maximum display resolution available, proper aspect ratio, and some of MSAA (4x):

dgVoodoo (Hipnosis): Download

I would also reccomend to visit the official page to keep up to date with newer versions (pretty exciting since Dege's been working a lot in D3D9 support lately), or if you preffer to configure it for yourself:

dgVoodoo (Dege): Download

Widescreen Patcher

So here's the new exciting thing. This is an unnecessary program I wrote to patch the game executable to run in proper widescreen. First, is important to say that this works ONLY with the fixed executables, since the program hard-patches specific data addresses, which positions differ from other versions. It will detect automatically the desktop resolution and calculate the aspect ratio, for then patch the executable. It will overwrite the code for the 800x600 resolution, since doing so with 640x480, while would be preferred, displays incorrectly. Because of that, you must set 800x600 as the resolution in the game's option menu for it to work.

To patch, open the program, select the game executable and press the "Patch" button. There's also a "Restore" button, to (you guessed it) revert the changes. If the executable is in the same folder as the patcher, it will be detected automatically, so just press that patch button. It also supports drag and drop, and won't allow any different executable to be selected, so fear no undesire file corruptions.

Widescreen Patcher: Download

Note: If requested, it could support other versions as well, or even select fixed resolutions manually.

Launcher

It just runs the game with the "-cdrom:" parameter, so you don't need any shortcuts, extra files or the CD presence itself. Again, reusing the code from the utility above, it auto-detects the game executable, so rename it to whatever you want and it will run anyways. Remember to put it into the game folder.

Launcher: Download

And I think that would cover pretty much everything. If an utility is missing or you want to contribute with something, let me know and will update the post.

RayCarrot
Bzzit
Posts: 1780
Joined: Sat Jan 11, 2014 5:46 pm
Location: Sweden
Contact:
Tings: 24849

Re: Tonic Trouble Tools (Retail)

Post by RayCarrot » Fri Jul 26, 2019 7:23 pm

Great job! It's nice to have the available TT mods put together like this :) I might consider adding some of these to my Rayman Control Panel if you don't mind.
One thing I'd like to point out though is that redirecting the ubi.ini file to the Windows directory is not something I'd recommend. That directory is for the Windows system and thus has heavy protection and might get removed. Then again I guess it's Ubisoft's fault to begin with by putting it in a sub-directory there.... I don't know how you patched the location, but would it be possible changing it completely? You mentioned the game folder didn't work (which would be ideal), but other locations like AppData or ProgramFiles would work too imo.

PluMGMK
Pizzicatta
Posts: 30417
Joined: Fri Jul 31, 2009 9:00 pm
Location: Tír an "Tuisil Ghinidigh" agus an "Mhodha Choinníollaigh"
Contact:
Tings: 3068

Re: Tonic Trouble Tools (Retail)

Post by PluMGMK » Fri Jul 26, 2019 8:15 pm

RayCarrot wrote:
Fri Jul 26, 2019 7:23 pm
Then again I guess it's Ubisoft's fault to begin with by putting it in a sub-directory there....
Ah, the 90s, when nobody cared about silly things like security or access controls. :hap:

Hipnosis183
Électoon
Posts: 3
Joined: Wed Jul 24, 2019 3:23 am
Location: Argentina
Tings: 15

Re: Tonic Trouble Tools (Retail)

Post by Hipnosis183 » Sat Jul 27, 2019 2:10 am

RayCarrot wrote:
Fri Jul 26, 2019 7:23 pm
Great job! It's nice to have the available TT mods put together like this :) I might consider adding some of these to my Rayman Control Panel if you don't mind.
Yeah sure, go ahead. I might release the source once the patcher gets more complete (if you want to integrate the functionality into your UI natively); this means adding more that just widescreen support (or at least that would be the idea).
RayCarrot wrote:
Fri Jul 26, 2019 7:23 pm
One thing I'd like to point out though is that redirecting the ubi.ini file to the Windows directory is not something I'd recommend. That directory is for the Windows system and thus has heavy protection and might get removed. Then again I guess it's Ubisoft's fault to begin with by putting it in a sub-directory there.... I don't know how you patched the location, but would it be possible changing it completely? You mentioned the game folder didn't work (which would be ideal), but other locations like AppData or ProgramFiles would work too imo.
The game stores the "\ubi.ini" ("\Ubisoft\ubi.ini") location as a string in the executable, and takes the "C:\Windows" direction from the system function GetWindowsDiretoryA, so isn't possible to change the file direction to anything over that location. I tried to change the function to GetCurrentDirectoryA, which should return the game directory, but there's an error at execution time, so didin't tried further. It might be possible to do though, maybe if someone knows how could give a hand on it, but may need something more than just hex edit.
About the protection of the windows folder, it should be fine, i wouldn't fear any problems with permissions. We could discuss other options for this, but i would preffer to wait until we found a way to work just with the game folder, the cleaner way.
PluMGMK wrote:
Fri Jul 26, 2019 8:15 pm
Ah, the 90s, when nobody cared about silly things like security or access controls. :hap:
90's software loved to put stuff in "C:" and "Windows" folder.

RayCarrot
Bzzit
Posts: 1780
Joined: Sat Jan 11, 2014 5:46 pm
Location: Sweden
Contact:
Tings: 24849

Re: Tonic Trouble Tools (Retail)

Post by RayCarrot » Sat Jul 27, 2019 8:46 am

Hipnosis183 wrote:
Sat Jul 27, 2019 2:10 am
RayCarrot wrote:
Fri Jul 26, 2019 7:23 pm
Great job! It's nice to have the available TT mods put together like this :) I might consider adding some of these to my Rayman Control Panel if you don't mind.
Yeah sure, go ahead. I might release the source once the patcher gets more complete (if you want to integrate the functionality into your UI natively); this means adding more that just widescreen support (or at least that would be the idea).
That'd be great! I made a similar widescreen patch for Rayman 2 based on existing ones where I allow the value to be changed to any aspect ratio rather than limit it to 16/9. Assuming that should be possible here too since you're just editing a value in the executable.
Hipnosis183 wrote:
Sat Jul 27, 2019 2:10 am
RayCarrot wrote:
Fri Jul 26, 2019 7:23 pm
One thing I'd like to point out though is that redirecting the ubi.ini file to the Windows directory is not something I'd recommend. That directory is for the Windows system and thus has heavy protection and might get removed. Then again I guess it's Ubisoft's fault to begin with by putting it in a sub-directory there.... I don't know how you patched the location, but would it be possible changing it completely? You mentioned the game folder didn't work (which would be ideal), but other locations like AppData or ProgramFiles would work too imo.
The game stores the "\ubi.ini" ("\Ubisoft\ubi.ini") location as a string in the executable, and takes the "C:\Windows" direction from the system function GetWindowsDiretoryA, so isn't possible to change the file direction to anything over that location. I tried to change the function to GetCurrentDirectoryA, which should return the game directory, but there's an error at execution time, so didin't tried further. It might be possible to do though, maybe if someone knows how could give a hand on it, but may need something more than just hex edit.
About the protection of the windows folder, it should be fine, i wouldn't fear any problems with permissions. We could discuss other options for this, but i would preffer to wait until we found a way to work just with the game folder, the cleaner way.
Oh, that's more troublesome. I thought the location was hardcoded. Ideally you should be able to remove the native function call completely and make the path relative, which will always make it relative to the current directory. I think something similar was done with the GOG version of Rayman 2.
Regarding permissions there are some minor issues in some old Ubisoft games. Rayman 3 specifically has the tendency on Windows Vista and above to redirect the ubi.ini file to the VirtualStore location depending on the user privileges (running as admin or not). Though for TT I suppose it's fine. As long as the game has read permissions it doesn't really matter since the config program needs to run as admin anyways.

closer1000
Bébé Globox
Posts: 5
Joined: Mon Aug 08, 2016 2:14 pm
Tings: 25

Re: Tonic Trouble Tools (Retail)

Post by closer1000 » Sat Sep 07, 2019 5:35 pm

Everything works great except for the widescreen patcher. My issue is, patched or not, selecting any resolution other than 640x480 crashes to desktop. Obviously, dgVoodoo is doing it's thing so it's rendering at a much higher resolution, but I can't select 800x600 to get widescreen working with the patch. Any suggestions?

deton24
Dora Dodemer
Posts: 799
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 5781

Re: Tonic Trouble Tools (Retail)

Post by deton24 » Sun Sep 08, 2019 12:37 am

@up Try to set manually 1680x1050 (16:10) or 1600x900 (16:9) in ubi.ini (C:\Windows).
Alternatively use Wine libraries instead https://yadi.sk/d/0nP1H9bJ8aZ-KA.

Is there any possibility to make widescreen patch also for Special Edition? (This one with red spades instead of thermometer like in retail version.)
It has MaiD3Dvr.exe (CRC32: aa42958c) instead of TonicTrouble.exe as main game executable (16bit.pl abandonware version).
It doesn't run without Wine. With yours dgVoodoo it has graphic glitches.

Generally, when resolution is higher than 1680x1050 (16:10) or 1600x900 (16:9) it will cause crash. Setting these resolutions, and running the game from desktop will force your native desktop resolution (at least that's what my monitor OSD keeps telling me).
Wine libraries for SE https://yadi.sk/d/0nP1H9bJ8aZ-KA (attached with 16bit.pl SE 8.7.0 version). They fix textures.

Most importantly, SE doesn't have to be patched to run on newer systems (so Ribshark patch is not required).

Your patched binaries don't work with Special Edition. Widescreen patch also fails.
(tried to run as admin, copying gli* libraries from Rayman 2 - it cause the game to launch the patched setup, but it gives an infinite setup show up, and sadly it causes the game to crash permanently till the uninstall).
Last edited by deton24 on Tue Sep 10, 2019 3:55 am, edited 2 times in total.

Hipnosis183
Électoon
Posts: 3
Joined: Wed Jul 24, 2019 3:23 am
Location: Argentina
Tings: 15

Re: Tonic Trouble Tools (Retail)

Post by Hipnosis183 » Mon Sep 09, 2019 6:14 am

Ok, here's a quick update on how's everything going.

I've been mesing around with disassembly, while learning on the march. I've gone pretty far in regard to redirecting the "ubi.ini" file location, but when I thought it was almost done I hit a wall, so haven't progressed from then. It's been like a month since that, I haven't had the time to continue messing with it, but hopefully this november will be a month with more spare time, so I will come back to it then.
deton24 wrote:
Sun Sep 08, 2019 12:37 am
Is there any possibility to make widescreen patch also for Special Edition?
Yes, but at the moment the main focus is to get everything done for the retail version. Plus, there are a lot of different versions of the SE (and retail too), so it'd be nice to do something like a complete and detailed list of them all; it will be easier to work from there, ensuring that we cover every version.
deton24 wrote:
Sun Sep 08, 2019 12:37 am
Most importantly, SE doesn't have to be patched to run on newer systems (so Ribshark patch is not required).
As already said, the english retail version seems to be the only one with the problem, so it's not necessary for any other.
deton24 wrote:
Sun Sep 08, 2019 12:37 am
Your patched binaries don't work with Special Edition. Widescreen patch also fails.
Those are exclusively for the specified english retail version, so it's expected not to work with anything else. Also, I doubt that other versions will get any extra treatment besides widescreen patching, furthermore considering the amount of time that the game's debbuging is taking, having to do the same with every version is not worth it, nor viable. Will see in the future what does make it to the program and what not.

Also, I've seen that you're modifying the PCGamingWiki page. While it's WIP for sure, I'd recommend to do two separated pages, one for retail and other for SE, so it'd be easier to read and won't confuse many people. All of this if it's possible, of course. Other than that, it's shaping pretty good, keep with it.

I'll update again when (hopefully) get somewhere.

deton24
Dora Dodemer
Posts: 799
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 5781

Re: Tonic Trouble Tools (Retail)

Post by deton24 » Tue Sep 10, 2019 2:31 am

It wasn't necessary to make a new page for the game, just a note about SE in availability section.

There is separate info about widescreen for retail and SE, so I think it is enough for now.

There are many SE versions, indeed. Lot of dumps flies over the archive.org. I saw them with versions listed so it easy to find most of SE versions:

- 8.1.0 (Jan 30 1998!) (Beta) (Glide Version)
- Special Edition (DX6):
8.5.1
8.5.2
8.6.2
8.7.0
Retail (DX6):
Master V3 (re-release)
Master V5

To check current version, press F12, and type: version. F1 for Glide version.

In case of SE, I think it would be good enough to make widescreen for 8.7.0 (MaiD3Dvr crc32: aa42958c).
8.7.0 with widescreen resolution has cropped interface.
Though Glide version supports also Reshade (DXGI.dll) (unlike SE with Wine; dgvoodoo has texture problem for me) but I wasn't able to fix the widescreen-only bug in Glide version (doesn't seem to have cropped interface bug). You can only drag your window to the middle of the screen with navtive resolution in dgvoodoo set.


I wasn't able to run beta glide version yetIt justs exits to desktop with attached glide2x from dgvooodoo.
I needed to update dgvoodoo and copy conf file too, and make some custom settings (windowed, force v-sync). WIndowed trick with SE doesn't work, it runs on full screen with disappearing textures on the bottom.


Thanks for your reply and dedicated time!

Post Reply