How can I improve my website's performance for a game with a lot of objects?

August 23, 2025 2 answers
Asked by tuneA442
I'm developing a game on my website, but I'm encountering significant lag when I try to render around 5000 objects. I'm looking for some advice on how to enhance the performance. Here are links to my game and files: [Game](http://buildnblocks.net) | [Files](https://github.com/th3nu8/buildnblocks/tree/main)

Answers

~+Socket wrench
You might want to consider only rendering objects that are currently visible to the user. This technique can help reduce lag significantly. Make sure youโ€™re not rendering everything at once.

tuneA442: Iโ€™m already trying to do that, but itโ€™s still lagging. I attempted to only render the faces the camera sees, but I hit a wall with that.

Reply to this answer
~48 hours to reply
Your code organization could use some work. Try breaking it into multiple files instead of keeping everything in a single HTML file. From what I see, you're using Three.js correctly, but you might be nearing its rendering limits. Consider using algorithms like octrees to manage visibility better; this can help by not rendering blocks that are fully obscured.

spiced pear: Are there any web-based game engines that could handle more objects? I really want this project to stay on the web.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions