Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Super Mario 3D world] update to v6, new AA option #668

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

intra0
Copy link
Contributor

@intra0 intra0 commented Dec 14, 2024

update to v6
move into src
add credits comments
merge ansiotropic and shadows mod into the resolution pack to be consistent with other games
new antialiasing option

@intra0
Copy link
Contributor Author

intra0 commented Dec 14, 2024

I'm gonna stop submitting pull request until some of these get merged
I feel like the easiest PR's to start with are
#660 (DKC)
#658 (Shantae pack)
#662 (Virtual Console) (should also be able to close & reject #645)

Take as much time as you need @Crementif . I actually learned how to make branches and protect myself from accidentally committing to my masterbranch. so in way less of a hurry to get these out

I also have allow edits by maintainers turned on, so if any small style or spelling changes need/want to be made, just make them.
If you want a timely responce from me, @me on discord.

And I will be going through every pack in this repo, so make changes/sugestions/problems as if you are going to fix the entire repo to perfection

@intra0
Copy link
Contributor Author

intra0 commented Dec 14, 2024

also @Crementif if you need screenshots or additional information or anything just let me know

inspired by dr luigi
@intra0
Copy link
Contributor Author

intra0 commented Dec 15, 2024

here's a screenshot of the new AA change:
(can most clearly be seen on the left bush and flowers)

AA enable (exact same as before):
Screenshot_2024-12-15_13-35-13

AA disable:
Screenshot_2024-12-15_13-38-39

@intra0 intra0 changed the title [Super Mario 3D world] update to v6 [Super Mario 3D world] update to v6, new AA option Dec 15, 2024
@getdls
Copy link
Collaborator

getdls commented Dec 18, 2024

Here's the basics for a SM3D draw distance mod
From what I remember regular levels were ok, but not the the rail/"floating dinosaur" levels

[RedCarpet_DrawDistance]
moduleMatches = 0xBBAF1908, 0xD2308838, 0xEB70C731
.origin = codecave
	
##patch object clip
0x103693D8 = .float 700000.0  # Distant clip (coins, boxes, enemies)
0x103693DC = .float 4000.0    # Lev obj draw  
0x10290DA4 = .float 200000.0  # Passive movement patterns 
#0x103852B8 = .float 10000.0  # map dist mtx?  trace 
#0x10368418 = .float 1500.0   # Nessie levels?  trace  
0x1036886C =  .float 1000000.0 # World draw, check reasonable includes unintended areas. 

@intra0
Copy link
Contributor Author

intra0 commented Dec 18, 2024

@getdls how did you go about creating this? I want to make something similar for XCX
found a spot of the mod being useful in 5-1
it has no affect on plussy stages which is not great as those would get the most benefit
still need to get to a train level on my save file
Screenshot_2024-12-17_22-54-46
Screenshot_2024-12-17_22-57-15

oh and massive improvement for 5-4, completely gets rid of all the pop in when roaming the level and makes the assets visable from the start, nice:
Screenshot_2024-12-17_23-15-16
Screenshot_2024-12-17_23-20-36

@intra0
Copy link
Contributor Author

intra0 commented Dec 18, 2024

@getdls what do you mean by rail/"floating dinosaur" levels?
I assume that ment train level, but the train levels seem to be working fine

Tested getdls's draw distance mod up to world 6
found no issues other than just nothing happening in the Plussy levels, and the game just acting like no modifications have been made
has a *massive* improvement for 5-4 (the one level anyone would want a draw distance mod for)
occasionally had a minor improvement for a level here or there
thanks for the work and the contributation getdls
I may try to figure out getting draw distance working on the Plussy levels in the future, but if not then the improvment to 5-4 is worth adding the mod
@getdls
Copy link
Collaborator

getdls commented Dec 18, 2024

Sorry, I was a bit sleepy. SM3W loads the level and then places rooms in way off coordinates in the world to simulate transitions without loading. For the Bowser fight (train level -> on rails), they hid the final area by just culling it out. When you set the draw distance too far, you see the end of the road while the fight is still ongoing. That + Plussy levels loading was probably the reason it wasn't released. It's like Plussy loads a different set of assets.

Basically, the patch preferably had tweaked values or a check disabling them when loading areas that use culling for gameplay before releasing.

...about creating this? I want to make something similar for XCX.

I don't recommend starting with XCX, that whole game is a crunch mess. I did a basic draw distance hack, but it was unstable AF (see how BOTW gets additional memory these days) + it didn't fix character pop-in, which was the most relevant part.

Alexkiri had a nice YouTube guide on basic disassembly and tracing; I can't find it :( . However, Cemu has a built-in debugger now, right? Better use that and Ghidra. If you're in a country that can use Discord, maybe ask in the channel? Sorry to be a tease, but basically, I did widescreen hacks and learned stuff as I went along... so start with a small/simple game. https://wiki.cemu.info/wiki/Cemu_patches

@intra0
Copy link
Contributor Author

intra0 commented Dec 18, 2024

can I see what you had for XCX? I might be able to get something if I know what debug symbols to look around.

and I'm familliar with cemu's debugger and ghidra and asm, and all that. I just want to know how you went about finding the draw distance stuff specifically. idk how to search unknown constants. ik how to search variables and all that, I understand how all of XCX's mods work even if not dealing with a variable because the extensive debug symbols

to someone who knows asm, how did you go about finding the draw distance specifically?

@getdls
Copy link
Collaborator

getdls commented Dec 21, 2024

Not sure what happened to my original comment... just checking. Nope, that works, maybe I just forgot to hit send..
Don't blame me if there's a duplicate post

@getdls
Copy link
Collaborator

getdls commented Dec 21, 2024

Draw distance and widescreen mods are roughly the same thing.

Reconnaissance

  • Start with simple things: scan through the binaries, read config files (decompress monolib), and decompile the binary.
  • Look for patterns that stand out, such as 1/720, 0.75, etc., for widescreen.
  • For LOD/draw distance, look for clusters of incrementing values that don't fit matrix/GFX operations and are usually not powers of 2, like 200 -> 500 -> 1000, etc.
  • Developers tend to reuse code, so look at other patches for similar variable names, rough data areas, or logic (e.g., widescreen modding for Bayonetta 2 is very similar to The Wonderful 101).

Minimize the attack area

  • Do the same thing as widescreen: run values at 0.5 in the cheats, debugger or basic graphic pack.
  • See what breaks and what doesn't.
  • Use binary partitioning to reduce problematic value clusters.

Analysis - Iterate

  • Start tracing promising values back to actual jumps/functions.
  • Nab new values around that area, go back to reconnaissance... iterate.

@getdls
Copy link
Collaborator

getdls commented Dec 21, 2024

Xenoblade "raw values" before being traced back to jumps or original usage. Its probably only 3-4 of them that actually are relevant.
Use after the introduction cinematic on the hill. This should display some very distant sky islands and denser grass.

[XCXDrawV102U]
moduleMatches = 0x30B6E091

;Partial LOD ml::CDrMan::CDrMan((ml::CScn *))
0x101156C4 =  .float 0.30000001 * 4.0
0x101156C8 =  .float 600.0      * 4.0
0x101156CC =  .float 2300.0     * 4.0
0x101156D0 =  .float 1100.0     * 4.0
0x101156D4 =  .float 4000.0     * 4.0
0x101156D8 =  .float 5000.0     * 4.0

;Grass  ChagPoliCalcRange__Q2_2ml16CDrMdoCtlMpfAutoFPQ2_2ml5CVec3iT2fRCQ2_2ml5CVec3
0x10116544 =   .float 200.0		* 3.0
0x10116548 =   .float 30.0      * 3.0
0x1011654C =   .float 70.0      * 3.0
0x10116550 =   .float 100.0     * 3.0
0x10116558 =   .float 40.0      * 3.0
0x1011655C =   .float 20.0      * 3.0

;LookupTable smt  ->indirect enemy lod scaling <1 ml::CDrMdoMat::setupAvatarTbl((ml::_MdsMatTopHeader const *))
0x1011642C =   .float 0.5       * 1.5  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants