BYOND Version:515
Operating System:Windows 11 Home
Web Browser:Opera GX
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
Having a large amount of particles on-screen results in dream seeker's fps heavily slowing down, to the point there is a very noticeable stutter.

Numbered Steps to Reproduce Problem:
1. Join a server
2. Spawn a large amount objects that produce a decent amount of particles (for example, having the screen filled with something that has spawning = 8 on it's particles.)
3. Notice significant performance issues from the particles
Code Snippet (if applicable) to Reproduce Problem:
icon = 'icons/effects/particles/fire.dmi'
icon_state = "bonfire"
width = 100
height = 100
count = 1000
spawning = 8
lifespan = 0.7 SECONDS
fade = 1 SECONDS
grow = -0.01
velocity = list(0, 0)
position = generator(GEN_BOX, list(-16, -16), list(16, 16), NORMAL_RAND)
drift = generator(GEN_VECTOR, list(0, -0.2), list(0, 0.2))
gravity = list(0, 0.95)
scale = generator(GEN_VECTOR, list(0.3, 0.3), list(1,1), NORMAL_RAND)
rotation = 30
spin = generator(GEN_NUM, -20, 20)

Expected Results:
For the particles to have little to no effect on the framerate/performance
Actual Results:
Significant framerate/performance issues when a lot of particles are on screen.
Does the problem occur:
Every time? Or how often?
Anytime too many particles get on screen
In other games?
Only tested in SS13, but it happens across different codebases
In other user accounts?
Other players have reported having this issue
On other computers?
I tested this on a weaker laptop on windows 10, and did not have any issues.
When does the problem NOT occur?
When there is not a large amount of particles on-screen
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit to download old versions for testing.)
It appears to happen in older versions of byond

This is probably not fixable until the renderer overhaul, but it would be helpful to have some stats from the client profiler. If you open the client profiler and get profile data (average) from without particles vs. with particles, what results do you get?

I'm most curious whether the problem is more on the pre-render or render side.
This is before any particles are on screen:
Client Profile results (average time)
Subsystem Time Calls
------------------------------------------ ------------ ------------
GetMapIcons 0.000548 682
GetMapIcons: FillPanes 0.000310 682
GetMapIcons: FillPanes: View 0.000068 682
GetMapIcons: FillPanes: View: GetVisParams 0.000033 682
GetMapIcons: FillPanes: Map tiles 0.000201 682
GetMapIcons: FillPanes: Screen tiles 0.000041 682
GetMapIcons: Populate list 0.000037 682
GetMapIcons: Group icons and set bounds 0.000032 682
GetMapIcons: Sort list 0.000124 682
GetMapIcons: Wrapup 0.000030 682
GetMapIcons: Wait for particles 0.000000 682
Render 0.000689 682

This is after spawning an obj with the particles stats mentioned for about 9 seconds:
Client Profile results (average time)
Subsystem Time Calls
------------------------------------------ ------------ ------------
GetMapIcons 0.000600 8738
GetMapIcons: FillPanes 0.000349 8738
GetMapIcons: FillPanes: View 0.000079 8738
GetMapIcons: FillPanes: View: GetVisParams 0.000042 8738
GetMapIcons: FillPanes: Map tiles 0.000222 8738
GetMapIcons: FillPanes: Screen tiles 0.000048 8738
GetMapIcons: Populate list 0.000039 8738
GetMapIcons: Group icons and set bounds 0.000033 8738
GetMapIcons: Sort list 0.000130 8738
GetMapIcons: Wrapup 0.000032 8738
GetMapIcons: Wait for particles 0.000000 8738
Particle calculations (total) 0.000576 720
Particle calculations (per set) 0.000003 1374
Render 0.000753 8741
Your client profiling shows no evidence of a slowdown on the client end. If anything those times are stellar. It might be that your profiling is spread out over too many frames and you have a lot of innocuous frames in there that are blurring the results, but from where I'm sitting all of that looks amazing.

I recommend splitting this up so you host the game locally in Dream Daemon, and then run it separately in Dream Seeker. If DS still has an FPS drop, that might mean something; in which case I'd suggest getting new profiling data, but with way fewer calls. If DS is looking decent but DD is not, that's a sign the problem is server-side and you'd want to look at server profiling to tell what's going on.
Ok, so something I did find out was that the average render time will increase over time while particles are on screen, the more particles, the more this increases. Once the particles leave the screen, this average will go back down. This is the render time with a screen's worth of particle producing objects. Note that render would be higher, but the objects disappeared before it could get higher.
Client Profile results (average time)
Subsystem Time Calls
------------------------------------------ ------------ ------------
GetMapIcons 0.002094 1029
GetMapIcons: FillPanes 0.001252 1029
GetMapIcons: FillPanes: View 0.000475 1029
GetMapIcons: FillPanes: View: GetVisParams 0.000220 1029
GetMapIcons: FillPanes: Map tiles 0.000683 1029
GetMapIcons: FillPanes: Screen tiles 0.000093 1029
GetMapIcons: Populate list 0.000309 1029
GetMapIcons: Group icons and set bounds 0.000060 1029
GetMapIcons: Sort list 0.000330 1029
GetMapIcons: Wrapup 0.000085 1029
GetMapIcons: Wait for particles 0.000003 1029
Particle calculations (total) 0.002199 874
Particle calculations (per set) 0.000009 213284
Render 0.102828 1029

Login to reply.