

Sega bass fishing - bad polys
source link: https://www.tuicool.com/articles/hit/YN3aYn3
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Not sure if this is too technical or not .. but this is how I found/fixed this particular issue.
Sega bass fishing is honestly not a game I've ever really played, other than letting attract mode run. I spotted this particular bad poly issue in a video Tadex made about the game on youtube.
Oh god what is this.

And this

Original thoughts were it might either bad matrices or some kind of floating point NaN bug in the cpu emulator. Daytona has a matrix bug caused by the matrices not being completely sent before the game starts to reference them due to some timing issue.
Checking the matrices everything looks okay

Next step is to check the actual vertex data in the meshes and check everything looks okay.

Nothing out of the ordinary showed up.. Hm how to find this bad poly. Okay .. let's make a few simple modifications to the code and turn the renderer into a colour picker. Many opengl CAD programs that do object selection draw each object in a unique colour then read back this value at mouse x/y location. They do this on the back buffer, then the results are cleared so you never see them. We can do the same just in a more visible fashion.
Drawing each poly in a unique colour gives us this.

Use good old MS paint to find this bad poly number based upon its colour

82, 2, 0
Okay let's put a breakpoint in the code for this condition so I can see these bad polys.

Finally I can see what's going on. The first vertex (x/y/z position) is uninitialised.

Why? Because the first vertex in the mesh has the sharing attribute set. This means it shares the vertex data from the previous polygon. But there is just one problem, it's the first polygon in the mesh! It can't share with anything. So this poly is clearly illegal, but the h/w draws it normally anyway. How?? Hmm ...
First idea was that the hardware could start by zeroing the shared poly data, so instead of random garbage it initialises to 0.

And let's see what it looks like

Nope, still broken.
Hmm, I wonder if it could be sharing vertex data ... with the previous mesh. Insane but who not. In our code the shared values live on the stack in the local function. As soon as the function has returned these values are gone. I doubt the HW works like this. Anyway let's try simply moving the shared data out of the function and just make it global.


And that is how I fixed this bug.
Recommend
-
25
S10 mini speaker bass-boost technology 25th October 2014 size of a small apple
-
17
An AI is livestreaming a never-ending bass solo on YouTube Dadabots trained the neural network with a two-hour improvisation from YouTuber Adam Neely....
-
6
KEF’s new basketball-sized subwoofer promises ‘maximum bass in minimum space’
-
5
10 Best Bass Guitar Straps Bestseller No. 1 Guitar Strap for Electric Guitar Bass....
-
6
This story is part of a group of stories called In today’s digital age, it sometimes feels like hardware has taken a back seat to the software that drives our devices. Button of the Month is a monthly...
-
3
Swim fast — Putting the fear of bass into mosquitofish—with a robot A notorious invasive species stays scared for weeks after seeing a fake predator. ...
-
2
bass Bass is a low-fidelity Lisp dialect for scripting the infrastructure beneath your project.Bass's goal is to make the path to production predictable, verifiable, flexible, and most importantly, fun.
-
7
Enjoy big bass and 20 hours of playback with Audio-Technica’s new earbuds
-
18
How to Adjust the Bass on Windows 10 and 11 By Zainab Falak Published 15 hours ago Fancy a bit more oomph to your music? H...
-
7
Pixel Buds A-Series fix for its broken bass slider is (probably) on the way By Chethan Rao Published 13 hours ago
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK