question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple Worlds/Engines randomly "freezing"

See original GitHub issue

I’m currently working on a multiplayer game, each server has multi-world support. For each world, I have to create a Matter World, Engine, and Runner (nothing in the documentation says I can run multiple Worlds with the same Engine).

Randomly, either the Engine or the Runner for all of the worlds completely stops working, freezing physics on the server-side. There is no pattern, it just happens. The problem does not resolve itself until the server is completely restarted.

For context, there are roughly 10 - 12 worlds running simultaneously per server, each world can have anywhere from 10 to 100 entities (projectiles and players) at a time.

Is there a limit to how many Engines I can have running concurrently without Matter breaking?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
retrosceptercommented, Mar 16, 2021

Nope, I think I’ve fixed everything. I resolved some other performance issues (like relying on getters) that had nothing to do with Matter. Thank you!

1reaction
retrosceptercommented, Mar 2, 2021

I fixed the issue by using a separate engine update loop from the game loop (just a setInterval running at 60 fps) for each world.

My game loop runs at 50ms (all worlds and entities are updated, entity update packets are sent every 50ms), but I can’t seem to run Engine.update every 50ms, even when specifying 50 as the delta. The updates don’t scale with the delta and the Engine move 3x faster than real-time, it only works at 60 fps.

Also, to clarify, there was no resource leakage and minimal CPU usage when using the Runner.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows 10 is randomly freezing up multiple times a day.
Windows 10 is randomly freezing up multiple times a day. ... 1) Here are the fixes that work most for Windows 10 Freezing:...
Read more >
How to Fix the Windows 10 Freezes Randomly Issue - TechLoris
Eight different methods to try when your computer freezes randomly. Easy to follow steps with pictures will get your computer running ...
Read more >
Windows 10 Freezes Randomly Fix! PC Freezes ... - YouTube
Windows 10 Freezes Randomly Fix! ✓ PC Freezes While Playing Games | PC Keeps Freezing ! | 2022Fix "Windows 10 Freezing Problem" |...
Read more >
Why my computer keeps freezing and how to fix it
Let's first discover why computer freezes happen. Too many software products are running in the background. Every program that is running on ...
Read more >
5 Ways to Fix Microsoft Word If It Keeps Freezing When It Saves
If your Microsoft Word document is corrupted, it might cause Word to freeze when saving. Here's how to troubleshoot the issue.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found