Comments (6)
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.
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.
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.
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.
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.
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)
- `Friction` property does not work with `.setDirectionControl()` method HOT 1
- Post FX Blur With Mask on Graphics Loses Position/Scale on Resize HOT 7
- Allow overriding `contextRestoredHandler` in WebGLRenderer so we can control when a restore is called
- game focus not work when use inside iframe
- A project launched using the Vue3 template, I don't know why it keeps repeatedly rendering the DOM HOT 1
- `getPipelineName()` errors with the Canvas renderer
- scene plugin install failure HOT 4
- Nineslice objects
- Nineslice object bug
- Inconsistent Versioning and the Case for Adopting SemVer HOT 2
- Creating a dynamic texture from an image with preFX has wrong dimensions and coordinates HOT 1
- BitmapText setMaxWidth() bug
- Angle and rotation animations with tweens and scene update are smoother in 3.60 than 3.80 HOT 4
- Camera shaking HOT 1
- ConicGradient feature is very important HOT 1
- Meshes are missing parts when multiple batches are needed to render scene
- DomElement position is not kept correctly in the scene when a camera zooms out HOT 1
- [Input] disableInteractive() with NOT topOnly case
- SceneManager.getScene has wrong return type in ts definition
- Tilemap support for spacing and/or margin broken since 3.80 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phaser.