Someone-Else-Was-Taken / Periodic-Table-Reforged

A Collection of Unofficial ports of the CaffeineMC Mods alongside Iris.
GNU General Public License v3.0
45 stars 14 forks source link

Some mods expecting a certain order to geometry render pipelines cause stutter when loading chunks #53

Open Kaleidio opened 2 years ago

Kaleidio commented 2 years ago

it is a consistent and often (to a repetitive and annoying degree) type of jitter that occurs no matter the settings. Every fork of Sodium Forge I have tried has the same issue, but I have the most hope in this fork so I'm posting the issue here

I will use this issue as a thread to post any mods that I might find that are incompatible, and causing the issue that way. But as of now it seems to be sodium in general stutters, and other performance mods don't

Hardware spec: RTX 3080 ryzen 7 5800x 32gb ddr4 6870MBps SSD

Found possible mod collisions: Create (and companions + Flywheel) Structure generation mods

Kaleidio commented 2 years ago

does not seem to be an issue with just the mod installed. gonna go through the modlist over the course of this weekend and report what I find.

Someone-Else-Was-Taken commented 2 years ago

does not seem to be an issue with just the mod installed. gonna go through the modlist over the course of this weekend and report what I find.

Are you running Dynamic Trees?

Kaleidio commented 2 years ago

does not seem to be an issue with just the mod installed. gonna go through the modlist over the course of this weekend and report what I find.

Are you running Dynamic Trees?

nope.

Kaleidio commented 2 years ago

Kaleidio's Battle Pack-3.7.0-alpha1.zip

here, this is a curse pack you can import with a cursepack compatible launcher to see for yourself what I'm dealing with

sadly homework has caught up to me so I will be busy tonight and will be doing this list check tomorrow.

Kaleidio commented 2 years ago

reference removed, turns out these are two separate issues

Kaleidio commented 2 years ago

the only mods you need to reproduce the performance issue so far is image

Kaleidio commented 2 years ago

I have a feeling this is a Create mod issue but what's weird is Flywheel renderer on its own does not cause the lag, even though it does directly interface with chunks in the code

Kaleidio commented 2 years ago

updated main comment with mod collision possibilities

Kaleidio commented 2 years ago

notes:

Sodium and all forge forks seem to be the only thing that causes create mod to stutter vanilla gameplay so hard (even if no machines are visible). Optifine and vanilla render pipelines remain more stable

it's possible some of flywheel's code never runs unless something hooks it, and if Create only bothers to when it is installed then that might explain why flywheel on its own doesn't lag.

the structure mods I have left in as they cause log spam with Roadrunner, but this might be irrelevant to our cause.

the jitter is seemingly random but most often occurs above large cave open spaces when generating lots of chunks (jittering in a way that isn't vanilla like)

Kaleidio commented 2 years ago

I believe it's caused by Flywheel instance rendering loot chests that tend to spawn in the structure mods provided.

you might be able to get the same glitch by placing down a bunch of chests whilst having Magnesium, Flywheel and Create installed alongside each other

gaesyeah commented 2 years ago

Hi! maybe this "solves" the issue: For Flywheel/Create Compatibility run "/flywheel backend off" In Game

But I don't know if create will "run" fine after this.

Kaleidio commented 2 years ago

Hi! maybe this "solves" the issue: For Flywheel/Create Compatibility run "/flywheel backend off" In Game

But I don't know if create will "run" fine after this.

Create was designed to never depend on it, so I think it would. I will test with flywheel off now and see what happens

Kaleidio commented 2 years ago

I had noticed last patch of my modpack that flywheel's backend was also colliding with Item Zoom mod for whatever reason. looks like there might be a vertex leak somewhere in their code messing with layers.

still testing with flywheel off, will report in a moment

Kaleidio commented 2 years ago

nope, stutter is still pretty awful, and flywheel backend is off. issue not fixed

Kaleidio commented 2 years ago

could be related to this, as create mixin's to mess with alpha sorting for certain machines to appear correctly https://github.com/Someone-Else-Was-Taken/Periodic-Table-Reforged/issues/76

Kaleidio commented 2 years ago

note that the stutter tends to happen most in forests.

gaesyeah commented 2 years ago

Thanks for testing it. This is also happening with Zoom mod only when you have Magnesium installed?

So, Sodium is primarily a fabric mod, i dont know what Someone-Else-Was-Taken need to do to fix this issue. Maybe also contacting the create/flywheel devs is a good idea.

"Flywheel is mostly compatible with Optifine. If you use shaders, however, Flywheel's optimizations get disabled.", maybe this can also be "reached" with magnesium.

PS: sorry, my english isnt good.

Kaleidio commented 2 years ago

Sadly that's not tied to the issue. I'm fairly sure it's Create itself causing some sort of mishap as again, they include some custom alpha sorting stuff to make machines render properly.

This could be triggering the same lag that Leaves is causing, which is in issue #76 as linked before.

As I stated before forests already jitter a bit, and Create might be making this worse with its own alpha sorting pipeline in the mix.

Kaleidio commented 2 years ago

I would post the issue on the Fabric fork but that's not how dev works. those devs wouldn't dare fix code for a Forge only mod :/ so it's up to someoneelsewastaken to fix this (or the Create devs)

Kaleidio commented 2 years ago

furthermore as stated before, running magnesium with flywheel being the only other mod installed and on (which does actually do something) is perfectly stable. it's one of the other mods in the list causing it, so it has to be Create.

mosharky commented 2 years ago

I believe I'm running across the same issue

Volinock commented 2 years ago

Im having the same issue. No clue if this is helpful or at all relevant but I've found sort of "hot spots" that I repeatedly walk past and consistently drop my frames and cause stutters. Its deff related to something being rendered near my base because im totally fine away from it, other than a very few, random LARGE spikes.

mosharky commented 2 years ago

I'm getting those spikes all across my world, it's awful

Volinock commented 2 years ago

In addition I just loaded an empty modpack with ONLY road runner and magnesium, still getting stutters but not nearly as bad. Dropping well below 30 fps from a solid 115.

mosharky commented 2 years ago

Ooo, that deserves a new issue report in which case. I'm also using road runner

Volinock commented 2 years ago

I'm not sure, mosharky. I tried both roadrunner and magnesium. Just magnesium, and just roadrunner. Roadrunner alone lagged HORRIBLY. Magnesium alone stuttered the same. So I'm at a loss at this point.

Kaleidio commented 2 years ago

Same mod list here, as seen in screenshots. I guess it really is a magnesium x roadrunner issue?

Volinock commented 2 years ago

Same mod list here, as seen in screenshots. I guess it really is a magnesium x roadrunner issue?

I’ve got about the same mods in my custom pack, with the exclusion of a few (most likely unimportant) mods, and the inclusion of about 120 more mods.

However, when testing with ONLY magnesium the stutters were still going strong so I don’t believe it’s a roadrunner X magnesium issue.

it may just be an incompatibility with Create and the way they both render in the game. I’d say make a copy without Create and do a benchmark. If the stutters continue after Create is gone then you’re one step closer with a mod off the list of trouble causers.

Colin-J-Wood commented 2 years ago

Same mod list here, as seen in screenshots. I guess it really is a magnesium x roadrunner issue?

I’ve got about the same mods in my custom pack, with the exclusion of a few (most likely unimportant) mods, and the inclusion of about 120 more mods.

However, when testing with ONLY magnesium the stutters were still going strong so I don’t believe it’s a roadrunner X magnesium issue.

it may just be an incompatibility with Create and the way they both render in the game. I’d say make a copy without Create and do a benchmark. If the stutters continue after Create is gone then you’re one step closer with a mod off the list of trouble causers.

yeah tested myself, it's definitely not a Roadrunner and Sodium issue

can you send me your modlist? with process of elimination I can see what's going on

Volinock commented 2 years ago

Same mod list here, as seen in screenshots. I guess it really is a magnesium x roadrunner issue?

I’ve got about the same mods in my custom pack, with the exclusion of a few (most likely unimportant) mods, and the inclusion of about 120 more mods. However, when testing with ONLY magnesium the stutters were still going strong so I don’t believe it’s a roadrunner X magnesium issue. it may just be an incompatibility with Create and the way they both render in the game. I’d say make a copy without Create and do a benchmark. If the stutters continue after Create is gone then you’re one step closer with a mod off the list of trouble causers.

yeah tested myself, it's definitely not a Roadrunner and Sodium issue

can you send me your modlist? with process of elimination I can see what's going on

Fortunately for you I can cut down your process of elimination by a lot if you just use this other fellas mod list as it’s got the same mods I’m using just less

the only mods you need to reproduce the performance issue so far is image

Kaleidio commented 2 years ago

Same mod list here, as seen in screenshots. I guess it really is a magnesium x roadrunner issue?

I’ve got about the same mods in my custom pack, with the exclusion of a few (most likely unimportant) mods, and the inclusion of about 120 more mods. However, when testing with ONLY magnesium the stutters were still going strong so I don’t believe it’s a roadrunner X magnesium issue. it may just be an incompatibility with Create and the way they both render in the game. I’d say make a copy without Create and do a benchmark. If the stutters continue after Create is gone then you’re one step closer with a mod off the list of trouble causers.

yeah tested myself, it's definitely not a Roadrunner and Sodium issue can you send me your modlist? with process of elimination I can see what's going on

Fortunately for you I can cut down your process of elimination by a lot if you just use this other fellas mod list as it’s got the same mods I’m using just less

the only mods you need to reproduce the performance issue so far is image

actually Colin J Wood is my university alt, I was accidentally logged in

I was asking you for your mod list, so I can see if I can remove mods from that screenshot

Kaleidio commented 2 years ago

I have removed create etc from my modpack and testing now.

Kaleidio commented 2 years ago

mmmh...nope...removing create removed the stutter for me. I'm sticking with my gut feeling it's a create issue.

Volinock commented 2 years ago

mmmh...nope...removing create removed the stutter for me. I'm sticking with my gut feeling it's a create issue.

Oh well that makes a lot more sense why you needed my list LOL. Unfortunately I’m at work and can’t supply it but fortunately it looks like you figured it out on you own! This is unfortunate news regardless as I built my modpack around the create mod :(

Now I’m wondering if there’s something specific we can do or if it’s just a waiting game to see if the devs can buff the problems out. Worst case scenario it’s not fixable and we remove create..

Volinock commented 2 years ago

mmmh...nope...removing create removed the stutter for me. I'm sticking with my gut feeling it's a create issue.

Additionally I’ve come across this neat little list of FPS improvement mods across a variety of game versions as well as forge/fabric. I’m going to test all these with create when I’m able, feel free to do it yourself if you don’t wanna wait 6+ hours for me to get home.

most notably I’m going to test cull particles, performant, and out of sight. However I’ll probably toss the rest in for the sake of it, as long as they don’t create issues. If all goes well this might be a promising alternative for magnesium/roadrunner until it can be fixed, if at all.

edit: here’s the list https://gist.github.com/alkyaly/02830c560d15256855bc529e1e232e88

Kaleidio commented 2 years ago

mmmh...nope...removing create removed the stutter for me. I'm sticking with my gut feeling it's a create issue.

Additionally I’ve come across this neat little list of FPS improvement mods across a variety of game versions as well as forge/fabric. I’m going to test all these with create when I’m able, feel free to do it yourself if you don’t wanna wait 6+ hours for me to get home.

most notably I’m going to test cull particles, performant, and out of sight. However I’ll probably toss the rest in for the sake of it, as long as they don’t create issues. If all goes well this might be a promising alternative for magnesium/roadrunner until it can be fixed, if at all.

edit: here’s the list https://gist.github.com/alkyaly/02830c560d15256855bc529e1e232e88

I have all of these already. they don't fix the issue. the issue deals with what changes to the pipeline Create gives, I am very darn sure of that.

Volinock commented 2 years ago

mmmh...nope...removing create removed the stutter for me. I'm sticking with my gut feeling it's a create issue.

Additionally I’ve come across this neat little list of FPS improvement mods across a variety of game versions as well as forge/fabric. I’m going to test all these with create when I’m able, feel free to do it yourself if you don’t wanna wait 6+ hours for me to get home. most notably I’m going to test cull particles, performant, and out of sight. However I’ll probably toss the rest in for the sake of it, as long as they don’t create issues. If all goes well this might be a promising alternative for magnesium/roadrunner until it can be fixed, if at all. edit: here’s the list https://gist.github.com/alkyaly/02830c560d15256855bc529e1e232e88

I have all of these already. they don't fix the issue. the issue deals with what changes to the pipeline Create gives, I am very darn sure of that.

Oh I getcha, I meant as an alternative not a fix. It’s a shame because the FPS increase is just as amazing as create. I’d hate to have to choose between em but that’s the way it’s heading until it can be fixed, if it all.

Volinock commented 2 years ago

Okay apparently I'm having my own issue. Just entirely removed Create and all the addons for it and im still having the same stutters. At this point I'm at a complete loss.

Edit: Specific lag spikes when entering leaving a chunk into another, newly rendered or not.

Kaleidio commented 2 years ago

Okay apparently I'm having my own issue. Just entirely removed Create and all the addons for it and im still having the same stutters. At this point I'm at a complete loss.

Edit: Specific lag spikes when entering leaving a chunk into another, newly rendered or not.

please send your current modlist so I can compare.

Volinock commented 2 years ago

Okay apparently I'm having my own issue. Just entirely removed Create and all the addons for it and im still having the same stutters. At this point I'm at a complete loss. Edit: Specific lag spikes when entering leaving a chunk into another, newly rendered or not.

please send your current modlist so I can compare.

image

Sorry for the late response. Here you go.

Kaleidio commented 2 years ago

Okay apparently I'm having my own issue. Just entirely removed Create and all the addons for it and im still having the same stutters. At this point I'm at a complete loss. Edit: Specific lag spikes when entering leaving a chunk into another, newly rendered or not.

please send your current modlist so I can compare.

image

Sorry for the late response. Here you go.

this resulted in image but there was no stutter for me :/ looks like some other mod you have installed is doing the same geometry pipeline stuff that create does.

Kaleidio commented 2 years ago

next thing I'm gonna do is cause the stutter, use spark to capture it, and send the report here so the render classes in particular might get fetched, this will help us see if it's some sort of client wait rather than a shader hitch.

Kaleidio commented 2 years ago

weirdly and unexpectedly, create is not causing the issue anymore. now I'm not sure which mod was causing the stutter :/

Kaleidio commented 2 years ago

it might actually be a create addon, let me check

Kaleidio commented 2 years ago

yep there it is, I found the stutter in Create Crafts and Addition mod, gonna remove it again and make a fresh world just to check

Kaleidio commented 2 years ago

this spark report does not seem as useful

https://spark.lucko.me/LwyGxg2wHY

Kaleidio commented 2 years ago

nope, doesn't seem to be at fault

aaaaaaaaaa

Kaleidio commented 2 years ago

it might be some vanilla block causing a cascading render pipeline wait for some reason, but I'm not sure what block would cause that

hmmm....vine blocks? any other blocks with custom models? I don't know at this rate. and I doubt the dev notices if he has only a 60hz monitor.

Volinock commented 2 years ago

What a mess! At this point it’s clear you know a lot more than I do. Really hope something gets figured out because I’m obsessed with the performance of the mods and really wish it weren’t so troubling in modpacks.

nthxny commented 2 years ago

this spark report does not seem as useful

https://spark.lucko.me/LwyGxg2wHY

This spark link is server sided, it need to be on the client side and profiling ticks over 400ms or so, around whatever you seem to be getting in the Control-Alt-F3 tick viewer.

I believe this is the same issue as https://github.com/Someone-Else-Was-Taken/Periodic-Table-Reforged/issues/69 going off what you've said. I had consistent, large lag spikes, once every few seconds. The spikes got worse the higher my render distance was and got worse as new chunks were loaded.

Usually it loops over each ChunkRegion and calls glMultiDrawArraysIndirect and the whole process happens almost instantly. Sometimes though, it decides to lag and some calls will take ages to complete. No idea why it's happening.

My "fix" was to add a override mixin to MultidrawChunkRenderBackend.render() that would perform the loop with a timer, if it goes over 10ms, it'll just exit. This causes slight flashing as opposed to complete stuttering, which I'll gladly accept, though if it can get actually fixed that would be great.

No idea if it's presenting in vanilla, haven't tested.