Mod to disable backgrounds on all stages?

flwns

Smash Cadet
Joined
Jun 29, 2014
Messages
34
Location
Las Vegas, Nevada
#1
Let me clarify what I'm trying to do and what I'm looking for.

I'm trying to run Melee on the latest android versions of dolphin. At the moment I can get a pretty consistent 40-55 fps with 2 players on the screen on most tourney legal stages. With one player, I can get high 50s to 60. Using the handy develop mode switching in 20XX 4.05 I tried checking out the ECB toggles using R+Dpad Down. In the ECB modes with the stage background disabled, I get an immediate performance boost and am able to get a consistent 60 fps with 1 player on any tourney stage.

What I'm wondering is, if there exists a Gecko code/DOL mod/etc. that can be loaded into an iso to disable the background on stages like in the ECB modes (while also possibly retaining stage textures)?



Also, does anyone have any ideas for further improvements to make Melee run better on relatively low end device like android phones? For those wondering I'm using a OnePlus 3 running Android marshmallow.

Thanks for reading.
 
Last edited:

Punkline

Dr. Frankenstack
Premium
Joined
May 15, 2015
Messages
356
#2
I think there are some codes/mods for specific stages, but I don't know of any that apply to all stages.

I was looking to play with ECB display stuff a few weeks ago. I mapped out what I could find:
Code:
Camera Display State flags:
(these are offsets from static address 80452C68 in Melee 1.02)

0x398    03 - ? 2-bit ID (parsed by call to @80031060)
0x398    04 - Toggle off background color changing effects -- Can be seen in some of the FD background effects
0x398    08 - Toggle Off Ambient Light for Entities?  -- Makes characters turn pitch black in the shadows of direct light
0x398    10 - Toggle off particle effects (includes background effects that persist during blacked out FD and BF)
0x398    20 - Black Background (keeps stage geometry display)
0x398    40 - ?
0x398    80 - Global Player Visibility -- Toggle on to stop rendering all players

0x399    01 - Toggle Ground Textures -- Turns ground black
0x399    02 - ?
0x399    04 - Black Background (excludes stage geometry display)
0x399    08 - Toggle player Camera Squares -- Blue Squares that adjust camera for each player's facing direction
0x399    10 - Toggle ECB, stage geometry and Red/Blue Squares -- ECB quads, floor geometry, and squares all come from this flag
0x399    20 - ?
0x399    C0 - ? 2-bit ID (related to the 2-bit ID in 0x398)

0x39a    20 - ? related to GFX    - playing with this bit throws some fun GFX panic messages in Dolphin

The ECB and stage geometry displays are tied together in a single display function. Their draw functions however are separate. The only way I know of getting a disabled background with a visible foreground is with that simplified stage geometry display.

---

Here's a simple code that toggles the ECB/stage geometry flag on stage initialization, and disables ECB display so that only the stage geometry and a black background are displayed from the ECB display state. Not thoroughly tested, so let me know if there are any bugs.

Code - Force Simple Background and Stage Geometry
MCM Mod (ports for all Melee Versions)
Code:
    -==-


Force Simple Background and Stage Geometry
Flags camera to display simplified stage geometry and a black background.
Note, this disables ECB quads from displaying in developer mode.
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ------ 0x25944 ---- 53C026F6 -> 60000010
----------- 0x56EC8 ---- 4BFFEE0D -> 60000000
1.01 ------ 0x25944 ---- 53C026F6 -> 60000010
----------- 0x56EB4 ---- 4BFFEE0D -> 60000000
1.00 ------ 0x258C4 ---- 53C026F6 -> 60000010
----------- 0x56DA4 ---- 4BFFEE0D -> 60000000
PAL ------- 0x25CF4 ---- 53C026F6 -> 60000010
----------- 0x5758C ---- 4BFFEE0D -> 60000000
Gecko Code (Melee 1.02)
$Force Simple Background and Stage Geometry [Punkline]
04028d64 60000010
0405a2e8 60000000
 
Last edited:

flwns

Smash Cadet
Joined
Jun 29, 2014
Messages
34
Location
Las Vegas, Nevada
#3
Damn, this is almost exactly what I was looking for. Thanks Punkline Punkline for that code, works great as far I can tell.

The reason why I say almost exactly, is because I am mainly looking for a way to achieve the same effect as Dan Salvato's Lagless FoD code on at least all tourney stages (I guess I should have mentioned this in the OP). Still though, this code is really a great step in the right direction for my dumb dream of running melee on my phone. I am very appreciative, since I really don't know the specifics on how to make codes like this on my own.

Anyways, I'd like to pose the question again, that If anyone has any ideas on further ways to make melee run "lighter" in any way please feel free to share them. Though current development builds of Dolphin are a bit limiting in terms of options. There may be a few more things out there to do on melee's end ( like disabling the backgrounds, would disabling music bring any performance gain?)

[Dan's Lagless FoD]
 
Last edited:

Punkline

Dr. Frankenstack
Premium
Joined
May 15, 2015
Messages
356
#4
The reason why I say almost exactly, is because I am mainly looking for a way to achieve the same effect as Dan Salvato's Lagless FoD code on at least all tourney stages (I guess I should have mentioned this in the OP).
Ah, thanks for bringing that up--didn't know about that code. These overwrites appear to be stage-specific, so it'd take some detail work to do the same for all stages. I imagine some would be much simpler than others though.

Anyways, I'd like to pose the question again, that If anyone has any ideas on further ways to make melee run "lighter" in any way please feel free to share them. Though current development builds of Dolphin are a bit limiting in terms of options. There may be a few more things out there to do on melee's end ( like disabling the backgrounds, would disabling music bring any performance gain?)
Do you get a performance boost when you display only collision bubbles from developer mode(and no player models)?
How about using this code from Achilles that disables particle effects and spawned texture effects?
 
Last edited:

Yakult

Smash Cadet
Joined
Jan 11, 2016
Messages
62
#5
Anyways, I'd like to pose the question again, that If anyone has any ideas on further ways to make melee run "lighter" in any way please feel free to share them.
ive made a low poly version for fox, falcon and jiggs. they use the models from when the character is off screen in the little magnifying bubble. id be very interested if you could tell me whether you get a higher fps using them.
 

Achilles1515

Moderator
Moderator
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
#6
ive made a low poly version for fox, falcon and jiggs. they use the models from when the character is off screen in the little magnifying bubble. id be very interested if you could tell me whether you get a higher fps using them.
I didn't know we actually knew how to do this...these are amazing. I'm interested to know the specifics behind how you did this.

Punkline Punkline
Multiple times I've found that a stage's fg or bg can be "removed" by nop'ing a branch link in their initialization function.

Ex.
Capture.PNG


results in

Capture.PNG


--
I really don't know the specifics behind it all, but it seems like the r3 input into the nop'ed function, that gets called multiple times in the initialization, is relating to some kind of asset group. I noticed this a while back while making the Jungle Japes stage hack. Something tells me that the r3 input correlates to different pointer groups in the map_head file location in the stage, but I think this is just a theory I came up with while driving to work or something, lol.

And I have not exhaustively tested this out for every stage or anything like that, so it may not universally be the case. And sometimes with nop'ing those branch links, nop'ing a single one may cause the game to freeze, but nop'ing two could make it playable (so, asset groups may be dependent upon other assets).
 
Last edited:

Achilles1515

Moderator
Moderator
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
#7
$Force Simple Background and Stage Geometry [Punkline]
04028d64 60000010
0405a2e8 60000000
I'm thinking of adding this into 20XX as a toggle in the STAGE CODES menu.

If FORCE SIMPLE STAGE GEOMETRY is enabled, it looks like the first line will be okay to permanently overwrite. What do you think about making the second an injection code following this logic:

Code:
if simple_stage_geometry == True:
    if (DBLevel == Master)
        NOP
else:
    DEFAULT
 
Last edited:

Punkline

Dr. Frankenstack
Premium
Joined
May 15, 2015
Messages
356
#8
Achilles1515 Achilles1515 -- woah. I think I might be looking into stage initialization functions tonight.

Also, that sounds like an excellent way to handle the stage geometry code. How do you set up your code toggles?
 

flwns

Smash Cadet
Joined
Jun 29, 2014
Messages
34
Location
Las Vegas, Nevada
#9
id be very interested if you could tell me whether you get a higher fps using them.
I tried them out and didnt seem to notice any significant FPS increase. It was a good idea though.

Unrelated, but I happened to notice that FoD is still the worst performing stage even when using Punkline Punkline 's code. Is there likely to be other things that are still loaded and running on the stage that can account for this performance discrepancy?

Here is a short list of the best performing stages on my setup (OnePlus 3 Android 6.0 OpenGL ES 3.1 Dolphin rev. 5.0-1691, 1 player on the stage using Punkline Punkline 's code and Yakult Yakult 's falcon)

[BEST]

- Yoshi's Story (Lowest FPS: 57, No hiccups smooth play at 60 most of the time, only dropped some fps when I did a falcon punch initially(had to load the textures?), also occasionally dropped to LFPS when coming down from the respawn platform)

- Dream Land (same as Yoshi's pretty much)

- Final Dest. (LFPS: 54, runs more steady than Battlefield, only noticed 1 hiccup in 3 minutes of play, some indistinguishable background particles still visible)

- Battlefield (LFPS: 53, somewhat frequent drops down to LFPS because of dolphin hiccups?, stars in the background still visible)

- Pokemon Stadium (Lowest FPS: 44(during transformations), Stays around 57 FPS, not going up 60 very often, fireworks and stage effects still visible)

- Fountain of Dreams (LFPS: 32, With both platforms up It cannot break over 46 FPS, with 1 Platform up performance increases to around 51 FPS, with both platforms down its runs at 60 FPS. I noticed that the water splashes and water jet particles that appear to holdup the platforms are still visible. I know Punkline Punkline referred to
How about using this code from Achilles that disables particle effects and spawned texture effects?
but I think not having and effects like shine and landing dust really detracts form the gameplay. Is there a way to only disable the stage particle effects/textures?

[WORST]


I'm going to try and see if upgrading my phone to OpenGL ES 3.2 will have an affect on these stages that are almost running perfect. I assume Fountain will still be problematic. I'll report back in here with my findings.

I think in general though, the idea of having a "lean" version of melee is an interesting pursuit for low end systems.
 
Last edited:

Punkline

Dr. Frankenstack
Premium
Joined
May 15, 2015
Messages
356
#12
I think in general though, the idea of having a "lean" version of melee is an interesting pursuit for low end systems.
I like this idea a lot~

Multiple times I've found that a stage's fg or bg can be "removed" by nop'ing a branch link in their initialization function.

Ex.
View attachment 124596

results in

View attachment 124597

--
I really don't know the specifics behind it all, but it seems like the r3 input into the nop'ed function, that gets called multiple times in the initialization, is relating to some kind of asset group. I noticed this a while back while making the Jungle Japes stage hack. Something tells me that the r3 input correlates to different pointer groups in the map_head file location in the stage, but I think this is just a theory I came up with while driving to work or something, lol.

And I have not exhaustively tested this out for every stage or anything like that, so it may not universally be the case. And sometimes with nop'ing those branch links, nop'ing a single one may cause the game to freeze, but nop'ing two could make it playable (so, asset groups may be dependent upon other assets).
This is really good information, thanks man.

I used this to explore the calls in the initialization functions for stages flwns benchmarked. I included the r3 arguments and any descriptions I could make of them:

Code:
Stage asset group initialization calls + r3 IDs:

Battlefield:
80219ce4 0 spawnpoints
80219d10 5 adventure background GFX?
80219d1c 3 versus background GFX?
80219d24 1 background particles
80219d2c 6 stage platforms

Dreamland:
80210828 0 spawnpoints
80210830 3 background sky
80210838 7 whispy's face + background plants; 6 must also be disabled -- stops wind
80210840 5 trees, grass -- excludes whispy's face
80210848 4 foreground stage floor (grass + pathway)
80210850 6 foreground flower sprites
80210858 1 ?
80210860 8 background sprites

Final Destination:
8021a780 0 spawnpoints
8021a788 1 ?
8021a790 2 transparent grate textures on stage
8021a798 3 all background and stage (excluding grate texture)

Fountain:
801cbbcc 0 spawnpoints
801cbbd4 1 Background stage elements, background circles
801cbbdc 3 stage floor and background stars

Yoshi's Story:
801e3074 0 spawnpoints
801e307c 1 background sky
801e3084 2 Stage + background elements
801e308c 3 Randall -- disabling causes him to stay in center of stage, invisible
I noticed that noping asset groups that contain moving platforms will break the platforms. Some of this though could be used to create a starting point for other codes like Dan's Lagless FoD.

Speaking of which, I explored bits of the function Dan was picking at to get rid of the reflection/stars. This function seems to run as a consequence of passing 3 as r3 for the call made at 801cbbdc in the stage initialization function.

If I'm not mistaken, all of the calls I listed above could be taken apart in a similar manner.

I've only gone through noping stuff, but it’s pretty interesting:

Code:
Calls and Stores in function 801cbe64 :

801cbec4 platform (left) (these don't include the water jet)
801cbed4 platform (right)
801cbf04 water reflection sheen?
801cbf1c water reflection image
801cbf54 background stars
801cbf84 background falling star particle effects
801cbfe4 fountain drops
801cc00c water jet placement (left) (nop causes it to spawn in center)
801cc018 water jet placement 2? (left)
801cc030 left platform + water jet (group)
801cc064 water jet placement (right)
801cc070 water jet placement 2? (right)
801cc088 right platform + water jet (group)
---

I happened to notice that FoD is still the worst performing stage even when using Punkline Punkline 's code. Is there likely to be other things that are still loaded and running on the stage that can account for this performance discrepancy?
flwns flwns -- try this code on top of my old one. Together with Dan's code, this should stop all of the lingering particle effects:
$Disable Animated FoD Fountain Particles [Punkline]
041cbfe4 60000000
041cc844 60000000
041ccd08 60000000

Edit - This works by stopping calls to 801c7ff8 -- which from my best guess seems to be related to initializing something in moving platforms that allows for animations and particle spawns. This is the case for FoD, at least--where the first nop is on stage initialization, and the second for each time a platform comes back out from the floor/water.
 
Last edited:

CoolWolf

Smash Rookie
Joined
Nov 10, 2015
Messages
2
#13
Is there something like this but for Project M / Legacy XP? Stages backgrounds are huge resource hogs :4sonic:
 
Last edited:

ChibiRoboMan

Smash Rookie
Joined
Apr 16, 2018
Messages
21
#14
Damn, this is almost exactly what I was looking for. Thanks Punkline Punkline for that code, works great as far I can tell.

The reason why I say almost exactly, is because I am mainly looking for a way to achieve the same effect as Dan Salvato's Lagless FoD code on at least all tourney stages (I guess I should have mentioned this in the OP). Still though, this code is really a great step in the right direction for my dumb dream of running melee on my phone. I am very appreciative, since I really don't know the specifics on how to make codes like this on my own.

Anyways, I'd like to pose the question again, that If anyone has any ideas on further ways to make melee run "lighter" in any way please feel free to share them. Though current development builds of Dolphin are a bit limiting in terms of options. There may be a few more things out there to do on melee's end ( like disabling the backgrounds, would disabling music bring any performance gain?)

[Dan's Lagless FoD]
Try to find the Netplay build and do this. It's the easiest way you can do this.
 
Top