Skip to content

Optimize World Generation with Greedy Meshing - #38

Draft
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
feat/optimize-world-generation
Draft

Optimize World Generation with Greedy Meshing#38
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
feat/optimize-world-generation

Conversation

@google-labs-jules

Copy link
Copy Markdown

This change optimizes the world generation by implementing a greedy meshing algorithm. It merges adjacent tiles into larger rectangular physics bodies, which significantly improves performance by reducing the number of objects the physics engine has to manage.


PR created automatically by Jules for task 9101758045860880072

Improves performance by merging adjacent tiles into larger rectangular physics bodies.

The previous implementation created a separate physics body for each tile, which caused significant performance issues and stuttering, especially on low-compute devices.

This change introduces a "greedy meshing" algorithm in the `createOptimizedPlatforms` method. This algorithm scans the chunk's grid and merges contiguous solid tiles into larger rectangles, creating a single physics body for each. This drastically reduces the number of physics objects, leading to a smoother gameplay experience.
@google-labs-jules

Copy link
Copy Markdown
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll acknowledge your comments with a 👀 emoji and then get to work. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

I will automatically address your feedback. For any comments you don't want me to act on, just include (aside).



For security, I will only act on instructions from the user who triggered this task for this pull request.

@vercel

vercel Bot commented Sep 15, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
disastersword Ready Ready Preview Comment Sep 15, 2025 8:53pm

This commit fixes a regression introduced in the previous commit where the platforms were not visible. The `setVisible` flag was set to `false` for debugging purposes and was not reverted. This commit sets the flag to `true`, making the platforms visible again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants