View Issue Details

IDProjectCategoryView StatusLast Update
0030390RunnerFunctionsPublic2019-01-29 14:45
ReporterStewart BishopAssigned ToFritz 
PriorityMediumSeverityC - GeneralReproducibility100%
Status ClosedResolutionFixed 
Product Version2.2.1 
Target Version2.2.2Fixed in Version2.2.2 
Summary0030390: Functions: Using the collision list functions causes a large loss in FPS which never recovers
DescriptionWithin the attached project there are 800-1000 instances and when you do collision_rectangle_list your FPS drops dramatically and will never recover. The users sample project shows that if they do the same type of functionality manually with point_in_rectangle and adding those to a list the FPS drop never happens.
Steps To Reproduce1) Run the sample
2) Draw a box
3) Notice the FPS drop
TagsNo tags attached.
1.4 Found In
2.x Runtime Found In2.2.2.293
2.x Runtime Verified In2.2.2.302


Stewart Bishop

2019-01-08 15:55


StrategyPlanet.yyz (16,734 bytes)


2019-01-10 11:05

Manager   ~0062432

There will still be a slowdown & it will be there until you change room or delete or deactivate the instances, but this fix minimises the slowdown. (I found an issue where the added instances were being considered for event generation when they shouldn't have been.)

Previously you would not have noticed any slowdown in this situation as all instances were added to the collision tree. Now any instance that does not have collision functions & is not solid is excluded from the collision tree and is only added if a collision query (eg collision_rectangle) is called. The slowdown occurs as the 800 instances are all added to the collision tree at the point when the function is called & processing 800 moving instances in a collision tree is going to have a performance impact.

Calling collision_rectangle_list is significantly faster than calling with/point_in_rectangle except in cases where you have large numbers of instances in the same place where the tree is not saving you anything since there is no spread of instances. If you modify the creation code to scatter the instances you will see a large performance win if you measure the time taken for the collision_rectangle_list against calling with.