Giter Club home page Giter Club logo

Comments (6)

photonstorm avatar photonstorm commented on May 27, 2024

I'm not entirely sure how we'd enhance the Matter integration any further? We are already using a version of Matter in advance of the main branch on their own repo (with a few extra features we added, plus some of their upstream optimizations they're yet to integrate into their main), and we have better TypeScript definitions!

We could author new documentation, but that's nothing to do with integration as such, more just education.

The biggest issue is that Matter is very sporadically updated. I'm pleased the main dev still has interest in it, but updates, fixes and features are very infrequent, which is fair enough, it's just a little side project for him. The simulation accuracy, thanks to relying almost entirely on verlet integration, isn't very stable either and it often falls over in a few key areas (stacking, high hz displays, complex scenes, etc) compared to the likes of Box2D. If it was frequently updated and maintained then I would have probably done what you suggested years ago, but sadly that isn't the case.

Plus, we're about to move fully into Phaser 4 development now. And the first versions of that won't have any bundled physics systems at all. It will be entirely up to you to pick what you want to use and integrate it yourself. Personally, I'd likely start with something along the lines of Rapier.

from phaser.

monteiz avatar monteiz commented on May 27, 2024

Thank you for the detailed response, @photonstorm.

To clarify my point further, the idea isn't merely about fixing the built-in physics engine, but rather directing efforts toward completing the matter.js integration due to its far superior capabilities in the realm of JavaScript 2D physics.

For instance, I've noticed instances like the newVelocity property being undefined within the body instance when using matter.js, contrary to the documentation's specifications.

Switching entirely to matter.js as the sole physics engine could significantly streamline documentation efforts, a facet I understand as a considerable workload in the workflow (even with AI's contributions vastly improving productivity in this area). This consolidation could greatly simplify the learning curve and reduce potential confusion for developers.

Additionally, I'm unsure about the notion of entirely removing a physics engine from a game engine framework to enhance it. It seems counterintuitive to remove a fundamental feature like a physics engine, as it can potentially limit the out-of-the-box functionality and accessibility for users.

Physics engines are often fundamental to game development, especially for newcomers who rely on built-in systems to kickstart their projects. Removing this core feature might pose challenges in terms of accessibility and might steepen the learning curve, potentially discouraging some developers.

from phaser.

photonstorm avatar photonstorm commented on May 27, 2024

This still doesn't sound like integration to me. It sounds like fixing bugs within Matter, that for some reason (time? enthusiasm?) the Matter author has decided not to fix. They very rarely merge pull requests on the main Matter repo. So we'd have to make the fixes downstream and then just hope they merge upstream. Far more likely to happen, is they just replace whole sections of the library with new features and it utterly breaks our now out-of-sync downstream version.

As I said, if Matter was more actively maintained by its author, your idea is fine and makes sense. But sadly that isn't the case. And that's fine, like I said, it's only a hobby project for him. He has no obligation to merge PRs or fix things. However, it will not be part of Phaser 4 as a result of this.

from phaser.

monteiz avatar monteiz commented on May 27, 2024

Thank you for your response @photonstorm.

Considering the challenges with Matter.js's maintenance, I wonder if it might be worthwhile to explore an alternative avenue. Instead of dedicating resources to the development of a built-in physics engine within Phaser 3, would it be viable to consider creating an independent fork of the Matter.js project?

By forking the project and continuing its development independently, the Phaser team could potentially address improvements, bug fixes, and enhancements specific to Phaser's needs. This approach could offer more control over the evolution of the physics engine while ensuring it remains aligned with Phaser's goals and requirements.

I understand this proposal might involve additional considerations and efforts, yet it could provide a middle ground between relying on the original Matter.js and developing an in-house solution.

from phaser.

photonstorm avatar photonstorm commented on May 27, 2024

I think if we're going to adopt and use a new physics system, even one we maintain ourselves, that there are honestly better alternatives these days. It's also a massive undertaking and would take away a lot of focus from Phaser itself. But, it's also important. So something for the team to consider in the coming months.

from phaser.

monteiz avatar monteiz commented on May 27, 2024

Yeah, I'm not a big fan of Matter.js either; it feels a bit shaky. But I'm glad we could talk about the importance of a good physics engine. A game framework in 2024 needs solid physics to stay competitive, right?

Thanks for thinking about this suggestion for the future. It's tricky to balance new ideas, stability, and using resources wisely. I trust the Phaser team to handle it well and stay on track with their plans.

Thanks for the great chat about Phaser's future... I'll be excited to see how things go from here.

from phaser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.