suchipi / hex-engine

A modern 2D game engine for the browser.
670 stars 26 forks source link

Performance with many physics objects #38

Open ianobermiller opened 4 years ago

ianobermiller commented 4 years ago

I noticed that after adding a dozen circles that collide the rendering slows down considerably. matter.js appears to be able to handle much more than this, so I don't think the problem is the underlying physics lib. It looks like it is caused by useEntitiesAtPoint doing a ton of matrix operations.

Sample repo: https://github.com/ianobermiller/jezzball-in-hex

suchipi commented 4 years ago

Thank you for opening this!

suchipi commented 4 years ago

This should be improved in @hex-engine/2d@0.3.4. Could you take a look?

ianobermiller commented 4 years ago

That definitely helps! There are still issues with 50-100 balls but it is better.

suchipi commented 4 years ago

I'll keep this issue open, because there are other improvements I want to make.