Anyone remember the CAS flash glitch?

Discuss modding in thug2. If you want to make something by yourself you can ask how to in here. Also, you can post any thug2 related mod in here.
Challenger
Posts: 21
Joined: Fri Apr 19, 2013 12:29 am
Contact:

Anyone remember the CAS flash glitch?

Postby Challenger » Mon May 04, 2015 8:19 pm

If you played THUG2 on PS2 you used to see this a lot. People would have this crazy CAS with parts that flashed all colors of the rainbow. I love this, but seems it's not possible on PC. Has anyone looked into seeing if this is possible on the PC version? You need the infinite saturation/value hacks for colors. I still remember how to do it.

Ok, I copied all my PS2 save files over to my PC. File structure is very similar to the PS2 version, so next up is to find my flash CAS and see if I can isolate the SAT/VAL bytes and inject them into my PC save.

Well, doesn't look like this is possible in the PC version. I found a hash generator but after injecting the values the object was simply bright pink, not flashed. I also took note of how many ticks in the in-game editor needed for the SAT/VAL bars to make it flash, re-entered those ticks exactly in the PC version, and doing that reproduces the two values exactly in the CAS file. Since I could not get this to work I don't see how any RAM hacking would make it work either, since loading a CAS without any GS codes reproduces it on the PS2 version (meaning it's not a result of a RAM hack, but the save data itself). I'm guessing it's just a really weird buffer overflow bug in the PS2's graphics synthesizer GPU.

But if anyone is curious, use these to reproduce the values with an infinite SAT/VAL mod.

HUE: 1 tick to the right
SAT: 17 ticks to the right
VAL: 18 ticks to the right

And here are the corresponding bytes in the SKA file. In this case I used the paper hat. Color adjustments are stored between the block of repeating 00 00 00 01's and 69's at the end. In the highlighted string, 0x65 is the saturation and 0x56 is the value that causes the flash in the PS2 version.
Attachments
9c43dbf75bc9b2c47eae695ade94c936.jpg
9c43dbf75bc9b2c47eae695ade94c936.jpg (239.97 KiB) Viewed 3699 times
Last edited by Challenger on Mon May 04, 2015 8:52 pm, edited 1 time in total.
Challenger
Posts: 21
Joined: Fri Apr 19, 2013 12:29 am
Contact:

Re: Anyone remember the CAS flash glitch?

Postby Challenger » Mon May 04, 2015 8:22 pm

Does anyone know of a utility or tutorial I can use to convert PS2 SKA files to the PC version (basically XBOX)? I've heard it is possible. Or would that have to be done manually? I may be missing another part of the file that has changed to create this bug but I am not being optimistic...
WhoElseButMe
Posts: 420
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: Anyone remember the CAS flash glitch?

Postby WhoElseButMe » Mon May 04, 2015 9:00 pm

Please refer to skaters as (CAS) because there is a file type of .ska which are animations and not skaters.
You have to convert them manually.
And it was quite an annoying bug so I'm rooting this doesn't get accomplished.
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.
LeonBlade
Posts: 11
Joined: Fri Apr 17, 2015 10:48 am
Contact:

Re: Anyone remember the CAS flash glitch?

Postby LeonBlade » Tue May 05, 2015 11:00 am

I'm fairly certain this is just a rendering bug and cannot actually be reproduced without having to recreate the effect yourself.
Challenger
Posts: 21
Joined: Fri Apr 19, 2013 12:29 am
Contact:

Re: Anyone remember the CAS flash glitch?

Postby Challenger » Tue May 05, 2015 7:52 pm

LeonBlade wrote:I'm fairly certain this is just a rendering bug and cannot actually be reproduced without having to recreate the effect yourself.


This is correct. Converting and importing my flashed PS2 CAS did not reproduce the bug.
Challenger
Posts: 21
Joined: Fri Apr 19, 2013 12:29 am
Contact:

Re: Anyone remember the CAS flash glitch?

Postby Challenger » Wed May 27, 2015 6:19 pm

I reporduced it in PCSX2, so it's definitely possible to have the effect on PC. For anyone who knows a thing or two about shaders or what have you...

http://phun.freeforums.org/anyone-remem ... tml#p83776
Challenger
Posts: 21
Joined: Fri Apr 19, 2013 12:29 am
Contact:

Re: Anyone remember the CAS flash glitch?

Postby Challenger » Tue Feb 16, 2016 6:07 pm

https://www.youtube.com/watch?v=cRbILL-rNPg

I'm back after a break from THPS. Honestly I've replaced a bunch of script files that I was sure would have an effect, and some ones for the menu that I thought had a remote possibility for finding something. Given this glitch, the black tag glitch, and the CAP rail sheets glitch are all PS2 exclusive I'm quite convinced at this point it's just a bug in the PS2 dev kit used to build the game. I would love to see someone prove me wrong. If you know anything at all about debugging PCSX2, I will upload my memory card file so you can load the CAS. I think I still have it.

Might be possible to find out which instructions in the ELF are causing the bug, isolate them, and recreate the effect in THUG Pro by modifying the EXE. I would start by comparing PCSX2 stack/heap dumps between two frames: one being a normal CAS in the editor with the colors adjusted one SAT/VAL tick away from flashing, and the second one being flashed. This will isolate as many variables as possible. Unless someone picks this up I have nothing else to say about the glitch.
WhoElseButMe
Posts: 420
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: Anyone remember the CAS flash glitch?

Postby WhoElseButMe » Tue Feb 16, 2016 11:29 pm

My theory is it's corrupting the memory or the pointer to memory leaving the color variable point to a section of memory that's changing thus making the color change.
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.
Challenger
Posts: 21
Joined: Fri Apr 19, 2013 12:29 am
Contact:

Re: Anyone remember the CAS flash glitch?

Postby Challenger » Wed Jun 07, 2017 4:03 am

So I started digging back in to this, not with an expectation of finding the cause of the glitch, but in attempt to learn more about the effect. First I did some more research on the Graphics Synthesizer chip and how it operates. It runs on surprisingly basic principles:

To try to answer the original vague question - the PS2 was exceedingly basic. You have a pool of embedded memory the GPU can access, and that's used for everything - all your framebuffers (colour, z, scanout) and textures.

...

The PS2 has a very simplistic rasteriser - you get a colour at each vertex, interpolated across the polygon (non-perspective correct at that) and one texure co-ordinate per-vertex, fixed point (which means you get wobbly textures if you don't keep your co-ordinates in a sensible range), again interpolated - though at least the texture is perspective correct.

For each pixel it can look up a texture at the interpolated co-ordinate (the most you get in filtering is trilinear, but typically you would use bilinear with nearest-level mipmapping), modulate the texel with the interpolated colour, and then blend that with whatever was in the display using a fairly basic set of alpha-blend modes (you don't even get a modulated blend, except with an alpha value... most you can do with colour is add or substract).


So what I take from this is something is going wrong during the final "blending" stage causing a random mess of colors to be mapped to each vertex and overlaid onto the original texture before the mesh is rendered to the screen. I found a program called Texmod, a DirectX texture viewing and ripping tool. I ran this on top of PCSX2 and it shows the following output in the upper left:

Image
Image

Texmod allows you to cycle and highlight each texture in VRAM. When a texture is selected it's replaced with green and the texture itself is shown in the upper left. So I selected my flashed angel wings and got this result:

Image
Image

The green wings still have a flickery shadow over them with the original texture remaining uncorrupted and unchanging, which confirms my theory regarding the transforming overlay. This falls in line with what WhoElseButMe suggested.

Return to “THUG2 modding”

Who is online

Users browsing this forum: No registered users and 2 guests