Dolphin, the GameCube and Wii emulator - Forums

Full Version: [PATCH] Madworld Asian Town Crash Fix
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This patch will fix the crash in Madworld's Asian Town, and possibly other levels (or even games) if they have the same/similar problems.

This weekend I was bored and I remembered Madworld, so I decided to play it on Dolphin. When I reached Asian Town I was surprised by the crash, and I wanted to fix it.

My first patch I posted (http://forums.dolphin-emu.org/showthread.php?tid=25218) allowed passing the crash, but was buggy. I've narrowed down the bugs in it to a minimal. (there still are some bugs but it's significantly better now)

For example, my original patch outputs : (gets past the crash, but it isn't very nice to the graphics and speed)

[Image: rzze8p4.png]

While my new patch outputs : (gets past the crash, very close to no glitchy graphics and much nicer to the speed)

[Image: rzze8p3.png]

Please note that my current patch still has some (minor) graphical defects, but they are nowhere near as severe as the original patch.

Additionally my hack is now an option, in case it breaks compatibility with another game you can disable it in Graphics > Hacks > Skip Problematic Surfaces, although as far as I've tested it doesn't cause compatibility issues, but I know I don't have even close to every Wii/GC game so I can't be sure.


Recommended settings:

Skip EFB Access from CPU OFF
EFB Copies to TEXTURE
OMP Enabled
MMU DISABLED
BAT DISABLED
VBeam ENABLED
Block Merging ENABLED
(and my hack enabled of course)

Projection Hack:
zNear: (don't put anything)
zFar : 2
(-)+zNear CHECKED
(-)+zFar UNCHECKED
Extra Parameter UNCHECKED

My computer doesn't seem to want to compile a *.patch/diff so I made a RAR to extract into your project root (the files should have the appropriate paths/names so just drag the /Source/ folder into your /Dolphin-Emu/ root)

Get it here : (please read statement above)

http://depositfiles.com/files/ope470yil


ps - Rinrin says hi Wink (this scene would have graphical issues if my patch was toggled off in the middle of the game, or it would have crashed if you somehow had a savestate at this point and didn't start it with my patch)

[Image: rzze8p5.png]
Big hack which is most likely completely inaccurate to what the real hardware does. I would not advise people to use that.
(09-10-2012, 06:45 PM)delroth Wrote: [ -> ]Big hack which is most likely completely inaccurate to what the real hardware does. I would not advise people to use that.

I can't really understand where you're coming from on both sentences. It sounds like you're basing that off of assumptions on coding you didn't look at.

If you actually looked at my modified files, you'd already know it's nothing unadvisable since all it really is is a safety check for vertex pointers and a method to not show objects with a certain amount of vertices (to disable the vast majority of garbled graphics in Madworld's Asian Town), which
may or may not disable certain graphical effects in other games***, which is why I added an enabler/disabler in the GUI.

*** = Don't try to give me any BS there; the current official Dolphin release has potentially helpful hacks which may or may not disable certain graphical effects too. Regardless, it has not given me any problems in any game I tested. (including games other than Madworld) I'm not saying it won't cause problems in other games, since I can't test every game, but I included an enabler/disabler in case it does.
So you don't see where I'm coming from when I say "inaccurate to what the real hardware does"? Does the real hardware skip objects with a vertex count too high "to avoid garbled graphics"? I haven't been able to reproduce this behavior, could you perhaps provide me with a test case that I can run on real hardware which shows that what you implement is correct?

This is not a proper way to fix a bug. Understanding *why* the vertex count is too high and fixing that would be far better than hacking to hide the symptoms.
(09-10-2012, 10:34 PM)delroth Wrote: [ -> ]So you don't see where I'm coming from when I say "inaccurate to what the real hardware does"?

AFAIK I never claimed this hack was accurate to what the real hardware does. If I did claim it was accurate to the hardware, I could see you correcting my statement there, but I didn't claim that.

(09-10-2012, 10:34 PM)delroth Wrote: [ -> ]Does the real hardware skip objects with a vertex count too high "to avoid garbled graphics"? I haven't been able to reproduce this behavior, could you perhaps provide me with a test case that I can run on real hardware which shows that what you implement is correct?

This is not a proper way to fix a bug. Understanding *why* the vertex count is too high and fixing that would be far better than hacking to hide the symptoms.

No, the real hardware doesn't skip objects like that. (or I don't think it does)

Actually, the reason it crashed wasn't directly from the vertex count. I know what the real problem was, but fixing it properly would have taken longer and it wouldn't have loaded a significantly better result; a hack was more convenient in this case. There are only (very) few graphic errors left after the hack and it wouldn't really be worth working longer (to make a hardware-accurate fix) to fix minor graphic errors that don't really affect gameplay too much.

Hacking to hide the symptoms? How's that possible? The vertices don't exist on the vertex with the hack, therefore no symptom is ever rendered. "Symptoms" that aren't rendered cannot be hidden because they don't exist.

Regardless, I'd MUCH rather have a playable game than not use a hack only to find it's impossible to play past a certain point due to an error. I don't to mean use hacks for everything. If possible there should be improvements for accurate hardware emulation, but if hacks fix compatibility with minimal/no bugs I see no reason not to use them.
If you can fix the accuracy to what the real hardware does, by all means I won't stop you, but there's nothing wrong with a hack that fixes an emulation error as long as it doesn't cause other issues making the game unplayable.

And I can't say this is a bad hack. I will admit it's not accurate to the hardware (although I never said it was accurate to the hardware) but if it can fix compatibility and still play games like The Last Story without problems, it doesn't matter what it is.

I don't see what the problem is; it's not bad if it has no problem correctly rendering scenes as complicated as this one : (yes, my hack is on in this scene)

[Image: slsj011.png]

Additionally it fixes Pokemon Colosseum's battles in Stereoscopic 3D mode (while not using the hack, there were noticeably incorrect differences between the graphics in the left and right eye)

Skip draw is a hack. I put it under Graphics Hacks in the Dolphin configuration. Dolphin has plenty of graphic hacks.

1) It boosts compatibility. (Also AFAIK Madworld is listed as running perfectly in Dolphin but Asian Town makes it impossible to continue without a real Wii, or my hack but it was listed as perfect, which was not correct, before my hack)

2) It potentially improves speed by reducing drawn vertexes. (I know this can potentially also cause graphic issues, but there are PLENTY of already included Dolphin options that may boost performance but cause graphic issues, and it's not like you MUST use it. Consider it an option for performance or graphic accuracy, like what a couple options in Dolphin already do)

3) It can optionally be disabled if there are any bugs in games.
Good work so far. We do consider the patch half finished as we strive for hardware accuracy with as few hacks as possible. The hacks we do add are usually speed hacks. It just makes it easier for us to identify problems that are caused by unimplemented hardware features or bugs in the code. When delroth says that it hides the symptoms, he's right - we haven't found the root cause of the problem and have patched the graphics emulation with a limit that made the game look right. The root cause might be a problem in the CPU missing the vertex cut-off, for example.

We have many hacks that make games work (better) but those are never committed. I guess that's just how we like to do things.

Interested in your explanation of what the real problem is.
(09-11-2012, 10:09 PM)skid Wrote: [ -> ]Good work so far. We do consider the patch half finished as we strive for hardware accuracy with as few hacks as possible. The hacks we do add are usually speed hacks. It just makes it easier for us to identify problems that are caused by unimplemented hardware features or bugs in the code. When delroth says that it hides the symptoms, he's right - we haven't found the root cause of the problem and have patched the graphics emulation with a limit that made the game look right. The root cause might be a problem in the CPU missing the vertex cut-off, for example.

We have many hacks that make games work (better) but those are never committed. I guess that's just how we like to do things.

Interested in your explanation of what the real problem is.

The cause for the Asian Town Bus crash is a bad pointer being presented to MEMCPY (which is why I added a "catch me if I fall" there).
It could be traced back to the source from there, but (personally) I don't see a need to. I know you guys are more interested in accurate-to-hardware emulation, and it's not that I don't support you doing that, but what I care about is being able to run games without crashing, regardless of if it's by hacks or accurate hardware emulation.

What I'm doing isn't bad. I'm giving users a way to finish Madworld on Dolphin alone. I don't expect this hack to be added to the official builds, but if I was a user who couldn't fix the issue at all, I'd rather have some sort of fix (besides using a real Wii), whatever it may be, to play my game since Dolphin can play games in higher quality than a Wii can. (and personally I have great USB headphones, but those can't be used on a real Wii)


Additionally, I'm working on improving the performance of the hack. I've made a new version (not released yet) which:

1) Stabilizes the speed and seems to keep it slightly higher than without the hack.

2) (seems) to finish clearing the rest of the glitchy-looking graphics (although Wang Bang Bus is seethrough, there doesn't seem to be any more glitchy graphics).

3) Fixes 2 crashes I found in the currently released version. (2 methods of killing required a higher vertice count than I originally limited it to, but otherwise the rest of the killing methods seemed fine)

I'm still testing it, but those are the improvements I noticed in my newer (again, not yet released) version.
The problem with this newer version is the code is messy, even though it works better. To the average user, it wouldn't matter (improvements in stability and removal of more glitchy graphics) but to those who want to see the code, it would matter.
The thing is, your efforts are wasted if the code doesn't make it into the project. Wouldn't you rather have the changes be made permanent and credit be given to you rather than your work being reduced to just a random Dolphin build some guy made that is floating around the internet? Not to mention that other people are going to use your build which will likely cause issues with other games. They'll then come to the forum or the issue tracker and create invalid topics about their games not working properly.
(09-13-2012, 01:34 AM)Starscream Wrote: [ -> ]The thing is, your efforts are wasted if the code doesn't make it into the project. Wouldn't you rather have the changes be made permanent and credit be given to you rather than your work being reduced to just a random Dolphin build some guy made that is floating around the internet? Not to mention that other people are going to use your build which will likely cause issues with other games. They'll then come to the forum or the issue tracker and create invalid topics about their games not working properly.

(09-11-2012, 04:05 PM)CPkmn Wrote: [ -> ]3) It can optionally be disabled if there are any bugs in games.

Should be sufficient. Also I did test around 10 other games with this hack on. None of them had major issues (actually, some even improved). At worst, some other games I tested had minor graphic issues.

I see delroth and skid aren't exactly thrilled about how I fixed Madworld, which is one reason why I'm not expecting it to be added to the project. It's disable-able so if it does cause anything bad in other games, users can disable it. I left a note to users if they're unsure of what to do with it to leave it unchecked.

Basically, yes it might cause issues in other games, or it might help in certain parts of other games (I do know it helps Pokemon Colosseum's battle system in 3D Vision mode, for example), but that's why I added an enabler/disabler for it (in case it does cause issues with other games). Dolphin has some similar options implemented which may or may not improve games / cause issues but that's why those ones are optional (or changeable, like the texture caching for fast, safe, or inbetween).

leelondon

Asian Town - Great Wall Street

Point Thresholds:

200,000: Wang Bang Bus
650,000: Daggers
1,000,000: Meat Buns
1,300,000: Money Shot
2,000,000: RinRin

The first thing you should do is pull up your map. This area isn't huge, but it's easy to get disoriented because the background is really busy. Look at the shape of the map and where you start to get your bearings.

600x297
New props, same effects.

Then check out your immediate vicinity. There are some wooden crate-type objects that you can smash over the heads of Killseekers, also some barrels. Trumpets (which you can find in storefronts) function rather like signposts (as seen above), as do lampposts. I.e. many objects look different, but take on similar roles in the violence.

600x297
Don't miss out on the upper level.

If you hang a right and climb these crates before entering the intersection you can not only knock some Wolverine-esque baddies into some Asian fans, but also pick up Meat Buns (like a Cash briefcase) and a new toy.

600x297
Fizz much?

Shake up the bottle by shaking the Remote and then slam it down on an enemy to cause an eventual fizzsplosion that rockets him away.

600x297
Refined elegance at its peak.

These masks work sort of like a barrel in that you pop it on with an overhead blow, but once they are through being stunned they regain their former deadliness, so act quick unless you want the geishas to attack.

600x297
Boom goes the dynamite.

Another toy you'll find hanging in storefronts are these fireworks. If you're going for a higher violence rating, use these as the coup de grace, since the enemy will explode a couple seconds after you jam them into his skull.

You probably unlocked at least the Wang Bang Bus by now.
200,000: Wang Bang Bus

600x297
Not just a rolling rose bush.

Obviously the bus is covered in spikes like most other modes of transportation in MadWorld, but if you get the timing right, you can get a big kill by using meat buns to lure enemies in front of the bus just as it takes off. Toss in an explosive Killseeker for good measure, and you're golden for some Super Violence.


600x297
It's a pretty straightforward path.

The northern spoke of this level has a couple crates you can hop on to get to the roof. Follow the ledge back towards the center of the area where you can ride the sushi Ferris wheel up to a bar where instead of a chef, there is a deadly quick slicing robot who will filet anything that comes near it. Of course, this is about when bunches of baddies pop out of the walls, so you should just chuck them into the machine.

600x297
Fresh caught, but we're sold out. Grab the orb!

This is the first orb you need for one of the DeathWatch Challenges. It comes out of the bar after you make sashimi out of a few bad guys.

600x297
Fwish!

This line back out on the roof will take you to a meat bun item. By now you have probably unlocked the daggers and extra meat bun. Remember that daggers slice off arms, so you can do away with the Wolverine characters pretty well with these.

600x297
Direct to Yee Fung.

On the right, outside the sushi bar, though, is another zip line, which takes you to Yee Fung's playground.

600x297
He's like a big pill bug.

If you want this fight to end extra quickly, try to get him in a power struggle (i.e. stay close and ready do the quick-time downswing with the Remote) near the huge electric sign. If you can knock him into it, he gets fried.

600x297
Turtle Power is not enough to defeat Jack.

Make sure to grab the orb he leaves behind if you're going for the DeathWatch Challenge.

600x297
There is a lever in the back to activate it.

Take the elevator down to an entertaining meat grinder fight.

300x154 300x154
Show those agile buggers who doles out the death in these parts.

Another wave of guys come down the elevator after you toss the first few in the grinder. It can take a try or two, since these enemies are faster than the ones in Varrigan City, but you can trap a couple in turtle shells to lessen the immediate danger (and laugh a lot).

By now you've probably unlocked the Bloodbath Challenge for this level, The Money Shot, so here are directions:

600x297
Oh yay, coagulated leftovers.

Remember the Asian fans? You may have noticed the side door earlier, but it wasn't really important until now. Take it and climb up the vents.

600x297
It won't bite.

Don’t be stumped by this busted lantern sign – it'll work just like a vent when it comes to climbing purposes. Once you pull yourself up, hang a left and you're on the roof.


1,300,000: The Money Shot

300x154 300x154
Tricky, but strangely…satisfying.

The gist of this event is to shake up a bottle of Peking Pop, stuff it down some poor Killseeker's throat, and aim him at a target. Note that there are three steps – it's worth it to use the fizz build-up delay as fine-aiming time, picking up your enemy and manually lining him up with your goal spike of choice. How much you shake the pop makes a difference, so waggle a few good ones for the more distance erogenous zones. Note also that the lowest spike on the right can be had just be dragging a guy over to the edge of the roof and tossing him at it.



600x297
Bangin'.

Make sure to take advantage of this sweet environmental kill before you go off to fight the boss. Drag a guy over to the gong (preferably with Geisha Head attached) and murder him just like you would with a rose bush: shakey-shakey.

600x297
DeathWatch Challenge complete.

To polish off the DeathWatch Challenge you may or may not have been working on, jump onto the dragon statue curling up the side of the building. Defeat one fire breathing Killseeker to reach the head, and the third and final orb is yours.
2,000,000: RinRin

600x297
Not a fan.

While the best way to do lots of damage against RinRin is to take advantage of the bombs she occasionally drops into the arena, it can be hard to get your aim right. If this gets too frustrating, focus instead on just dodging her fan throws, which is easier than it seems – a simple back-flip does the trick. You can move in close for a chainsaw swipe in between her melee attacks, although she does block often. Wait for the power struggle trigger to get the chance to throw her into the big video screen for a shock attack – it takes a few of these to kill her, but it is more of a sure thing than the bomb. If you start running low on health, climb around the back of the arena to find some pills.