I’m working on a “particle / projectile” module for my game. What am I supposed to look for when stress testing?
how many projectiles it can render simultaneously each frame without lag
how many projectiles it can spawn per frame without lag
how many total projectiles in can simultaneously render through the course of 1 second
any other thing some1 can think of
i was testing it earlier, and I was doing projectile.new() 100 times each frame (RenderStepped).
it lagged super bad, and I was super confused until I realized I was trying to spawn well, 100 projectiles each frame, which is, as far as I know, super unlikely to happen. My question how should I stress test this?
Sorry I can’t really go into much detail as I’m on mobile right now, but you could do this to test the amount of time taken to create a million projectiles:
local start= tick()
for i=1,1000000 do
--Projectile code
end
print(tick() - start - 0.2)--Subtract 0.2 because of the loop.
yea I was thinking of that for testing spawn rates but the performance heavy part is updating the projectiles.
when a projectile is created by projectile.new, it is inserted into a table called “projectiles”
every renderstep, projectiles is looped through and each projectile has its update method called.
increased how many projectiles r spawned each second to the point theres 1k projectiles being updated every frame depending on how far theyre going. theres a noticeable lag but its very minimal. once again still dont know if its good or not tho
Well, it depends. If players can shoot with no delay, then you might want to test more. However, if there is a delay then you will most likely be fine.