Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
124 stars 2 forks source link

Add particle limit setting #1764

Open epicEaston197 opened 3 months ago

epicEaston197 commented 3 months ago

Is your feature request related to a problem? Please describe.

Sometimes people can get a little too crazy in the world and I end up freezing because they used way too many particles

Describe the solution you'd like

I would like to have a setting to limit how many particles can exist at once

Describe alternatives you've considered

none

Additional Context

it would be preferable if this wasn't capped just have it be a float text input

Requesters

@epicEaston197

shiftyscales commented 2 months ago

Currently particle rendering is one of the few remaining things that we use Unity's system for, so I do not know if there'd be an easy way to add this proposed setting at this time.

Frooxius commented 2 months ago

Using Unity system doesn't matter here, but this is a bit of a trickier issue.

The limit that is okay for one particle system, might not be enough for another and completely break the system/content.

E.g. if you have particle system tuned to do a constant stream of particles and you suddenly lower the max limit, now it'll start acting in "bursts" with gaps, which is not desirable - we'd need to scale the emission rate a well appropriately.

But even that could possibly break some effects. We'll need to think about how to achieve something like this with minimal breakage.

shiftyscales commented 2 months ago

For now it sounds like the best option is to leave optimization of particle systems to the users creating them.

It could be useful more broadly to have some form of mechanism to more easily tie together related settings, e.g. rate of emission, number of particles, etc. to maintain a similar visual effect- but it sounds like it could be a complex engineering task, so this issue is likely going to remain a lower priority at present.

epicEaston197 commented 2 months ago

No there are situations to where people are messing around with particle systems and they accidentally add an extra 0 resulting in the game just crashing or freezing out of nowhere which is not preferable I want a hard limit on particle systems because someone using a million particles is just outrageous

ultrawidegamer commented 2 months ago

I agree with @epicEaston197 We need a way to set a hard user limit on particles, even if it's restrictive. Users should be able to control the maximum number of particles their computer can handle before it stops creating more particles in the world. Alternatively, they should be able to set it to zero to disable particles entirely on a low-performance computer. A possible workaround could be similar to the "Skin Weights" rendering setting. In the additional information section, users could be warned that reducing the value too much might unintentionally degrade the viewing experience.

epicEaston197 commented 1 month ago

This seriously needs to be prioritized as it crashed someones entire computer

here's a quote from the user from the modding discord

This is the second time I had to suffer from this. Basically I was trying to hang out and chill with others and suddenly a lot of particles explode and made my entire computer crash hard (full black screen). I wish for a mod that can limit the number of particles at a given time (even if that means I wont load, see, hear them locally from my client).

Since I crashed, I have no way of knowing what item has caused it, I can only recall the last few moments of my experience. I remember seeing a lot of flame particles and loud sounds stacked together in a sudden burst (similar to the component "ViolentAprilFoolsExplosion"). Then my headset cut out and then all my monitors blacked out. I hear a beep from my computer and it restarts again.

My best guess could be from the item "=== Yeeted ===" in the logs, but I dont know, I crashed before I could do anything about it. Also sorry for the huge log file, it was a long play session and I might as well use the latest log file (I was unprepared for something like this again, so no clean logs).

On top of that, I had to suffer potential data loss because when the computer shuts down, there is no chance to save anything.

The user has provided a log file but it's modded so I'm not sure if I should post this here

Zyzyl commented 1 month ago

Obviously a PC crashing while playing Resonite isn't good. However, from the user's account, it's not clear whether excessive particles actually contributed to the crash. Therefore it's not clear whether adding a limit to total particles would even help them. For example, they mention that a lot of audio was playing at the time that they crashed, so it's possible there was a media playback problem or other issue instead.

Luckily it should be very easy to prove whether excessive particles alone is enough to crash someone. They can simply open up an new private empty world and spawn a new particle system (can be done through the Dev Tool ”Create New" menu). If they set the total particle number on the ParticleSystem and the rate on the emitter to crazy high values they can attempt to re-create the crash.

ProbablePrime commented 1 month ago

While I understand the urgency from the comments here, I cannot unfortunately prioritize it higher than other work at the moment.

There are dozens of crashes related to users entering a too large number in a variety of components and I've spent a long time fixing those in #1175 .

This still makes somewhat sense, so I'm sure we'll be able to get to it when we can.