You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a game where when 2 objects meet, 1 absorbs the other, and I create an absorption effect using a particle container and some sprites. However, if I have too many of these effects on the screen at a time, it creates an infinite psychedelic explosion, which is kind of awesome, but not really what I was going for. However, if I change from a particleContainer to a regular container, the problem goes away. Also, the issue only happens if there are a ton of particle containers onscreen at a time. If there are any less, it doesn't happen.
Update: It actually does still happen with the regular pixi container when the game is run in a mobile browser, so maybe a memory limit issue?
Here's my view hierarchy for each effect:
PIXI.Container // Effect main container. Gets scaled/positioned
PIXI.Sprite // This is an overall glow
PIXI.particles.ParticleContainer // This is the streaks effect
PIXI.Sprite[] // Individual streak of light. Gets rotated and alpha'ed
Here's a gif of what it's supposed to look like:
And here's one of the issue:
pixi.js version: _e.g. 4.8.1
Browser: _e.g. Chrome 67.0.3396.99
Device: _e.g. Desktop_OS_X
The text was updated successfully, but these errors were encountered:
So it turns out I'm actually just dumb on this one. After chasing down some false leads, I discovered that my effects' intensity param was incorrectly tied to the framerate in an effort to make them fade faster if the game was lagging. However, my math was wrong and it actually made them increase in intensity, which lagged the game further, starting a vicious cycle. Incidentally, I've discovered that regular containers are seemingly slightly more performant than particle containers in my use case.
Expected Behavior
I'm working on a game where when 2 objects meet, 1 absorbs the other, and I create an absorption effect using a particle container and some sprites. However, if I have too many of these effects on the screen at a time, it creates an infinite psychedelic explosion, which is kind of awesome, but not really what I was going for. However, if I change from a particleContainer to a regular container, the problem goes away. Also, the issue only happens if there are a ton of particle containers onscreen at a time. If there are any less, it doesn't happen.
Update: It actually does still happen with the regular pixi container when the game is run in a mobile browser, so maybe a memory limit issue?
Here's my view hierarchy for each effect:
Here's a gif of what it's supposed to look like:
And here's one of the issue:
pixi.js
version: _e.g. 4.8.1The text was updated successfully, but these errors were encountered: