Phaser v3.61 Beta 3 is now available

Published on 13th October 2023

Hi everyone!

This is just a very quick post to say that Phaser v3.61 Beta 3 is now available from npm (under the beta tag) and GitHub. Updated TypeScript defs are also available.

https://github.com/photonstorm/phaser/releases/tag/v3.61.0-beta.3

This is the final beta release and closes all significant issues that I wanted to address in this version, including some tricky little sods that took ages to track down! Fixes include a WebGL memory leak when creating and destroying Dynamic Textures, an issue where Bitmap Masks would distort if the canvas resized, an issue with particles picking the wrong frames from multi-atlases, a fun issue where Line widths were double the thickness they should be on WebGL and loads more.

Plus, Some Fun New Things

This version also includes a new test for 'roundPixels' where the rounding is applied in the vertex shader, rather than via JS, which should give much quicker results as it will remove a load of rounding math off the CPU. This is available on the Multi Pipeline and once I'm happy with it, I'll migrate to the other pipelines. But you can test it right now by just adding the property into your game config as usual.

Arcade Physics Bodies have a new property called slideFactor. This is a Vector2 that controls how much velocity is retained by a Body after it has been pushed by another Body. The default value is 1, which means it retains all of its velocity. If set to zero, it will retain none of it. This allows you to create a Body that can be pushed around without imparting any velocity to it.

There's a basic demo available in the labs here. Arrows to move.

If you click, it toggles the character's ability to slide the blocks. Previously it was quite hard to emulate this situation in Arcade Physics. You'd need to mess around with mass and friction values, but now you can just set a specific value. Much easier.

Arcade Physics has also gained the ability to create and use collision categories and collision masks. This means you can define up to 32 different categories, and Arcade Physics will use those internally, along with the body masks, in order to very quickly skip collision processing. You can set a category/mask on any Body, Group, or Tilemap Layer and easily add and remove categories on the fly. This should give you a lot more control over what collides with what and when. I need to prepare some more examples for this, but you can get the general idea by checking out the relevant parts of the Change log.

This will be the final beta release. If all goes well, I hope to get 3.61 out next week. I have already started work on the 3.62 release in a new branch. This release is going to focus almost exclusively on making Phaser 3 capable of handling WebGL context loss and recovering from it gracefully. I've made some progress towards this already, with a new WebGL texture cache and other internal changes. Still, lots more work to do yet.

Phaser 3 Guide

I've also been really busy working on the Phaser 3 Guide. So many times, people would come to the Phaser Discord and ask why we didn't have the same kind of documentation as Unity, etc. I.e. guides on how things work internally, not just API docs. I had always said that if you give me millions of $, like Unity has for their documentation team, then I would create that for Phaser too. But a month ago, I came to the realization that this was really just an excuse. I mean, sure, of course, it's easy for them - they've whole teams working on it, and with Phaser, it's literally just me.

But that didn't mean we couldn't have any guides like this. I knew I wouldn't be able to just sit down and work non-stop on it, so I planned out how to break it into lots and lots of small sections. And then, I set myself the task of making sure I write one section every single day. So far, I haven't missed a single day. Writing it in smaller, more focused chunks means I can spend an hour or two, get another part done, and then just come back to it the following day. To this end, I have completed tens of thousands of words worth of guide already! With whole massive areas now completed. I haven't yet decided how to release this - even so, progress is steady, and by year-end, we should have a substantial chunk of 'guide style' documentation for the community.

Hi everyone!

This is just a very quick post to say that Phaser v3.61 Beta 3 is now available from npm (under the beta tag) and GitHub. Updated TypeScript defs are also available.

https://github.com/photonstorm/phaser/releases/tag/v3.61.0-beta.3

This is the final beta release and closes all significant issues that I wanted to address in this version, including some tricky little sods that took ages to track down! Fixes include a WebGL memory leak when creating and destroying Dynamic Textures, an issue where Bitmap Masks would distort if the canvas resized, an issue with particles picking the wrong frames from multi-atlases, a fun issue where Line widths were double the thickness they should be on WebGL and loads more.

Plus, Some Fun New Things

This version also includes a new test for 'roundPixels' where the rounding is applied in the vertex shader, rather than via JS, which should give much quicker results as it will remove a load of rounding math off the CPU. This is available on the Multi Pipeline and once I'm happy with it, I'll migrate to the other pipelines. But you can test it right now by just adding the property into your game config as usual.

Arcade Physics Bodies have a new property called slideFactor. This is a Vector2 that controls how much velocity is retained by a Body after it has been pushed by another Body. The default value is 1, which means it retains all of its velocity. If set to zero, it will retain none of it. This allows you to create a Body that can be pushed around without imparting any velocity to it.

There's a basic demo available in the labs here. Arrows to move.

If you click, it toggles the character's ability to slide the blocks. Previously it was quite hard to emulate this situation in Arcade Physics. You'd need to mess around with mass and friction values, but now you can just set a specific value. Much easier.

Arcade Physics has also gained the ability to create and use collision categories and collision masks. This means you can define up to 32 different categories, and Arcade Physics will use those internally, along with the body masks, in order to very quickly skip collision processing. You can set a category/mask on any Body, Group, or Tilemap Layer and easily add and remove categories on the fly. This should give you a lot more control over what collides with what and when. I need to prepare some more examples for this, but you can get the general idea by checking out the relevant parts of the Change log.

This will be the final beta release. If all goes well, I hope to get 3.61 out next week. I have already started work on the 3.62 release in a new branch. This release is going to focus almost exclusively on making Phaser 3 capable of handling WebGL context loss and recovering from it gracefully. I've made some progress towards this already, with a new WebGL texture cache and other internal changes. Still, lots more work to do yet.

Phaser 3 Guide

I've also been really busy working on the Phaser 3 Guide. So many times, people would come to the Phaser Discord and ask why we didn't have the same kind of documentation as Unity, etc. I.e. guides on how things work internally, not just API docs. I had always said that if you give me millions of $, like Unity has for their documentation team, then I would create that for Phaser too. But a month ago, I came to the realization that this was really just an excuse. I mean, sure, of course, it's easy for them - they've whole teams working on it, and with Phaser, it's literally just me.

But that didn't mean we couldn't have any guides like this. I knew I wouldn't be able to just sit down and work non-stop on it, so I planned out how to break it into lots and lots of small sections. And then, I set myself the task of making sure I write one section every single day. So far, I haven't missed a single day. Writing it in smaller, more focused chunks means I can spend an hour or two, get another part done, and then just come back to it the following day. To this end, I have completed tens of thousands of words worth of guide already! With whole massive areas now completed. I haven't yet decided how to release this - even so, progress is steady, and by year-end, we should have a substantial chunk of 'guide style' documentation for the community.