rich Posted December 3, 2014 Share Posted December 3, 2014 After hundreds of hours of hard work, 13 Release Candidates and changes pretty much across the whole board - Phaser 2.2 is out! 2.2.1 Update There were a couple of small but really important bugs that slipped in at the last minute, one involving alpha not working in Pixi.js in WebGL mode, and the other a Tween Manager update. These have been rolled into a 2.2.1 release which is now live. Everything else remains the same as with 2.2.0, no API changes took place, so it's a safe direct update. What's new in 2.2.0? One of the nicest and most surprising things about a truly open-source project like Phaser is that you never know who might jump on for the ride. I've been extremely lucky with the support I've received over the years - fellow developers both fixing bugs and reporting issues, all helping to make Phaser stronger as a result. But sometimes a single individual can come along and make a substantial difference all on their own. A quick glance at the Change Log for this release will show many different contributors, but one stood out more than any other: Paul Stickney. Thanks to his contributions alone Phaser is now sporting a powerful new Scale Manager, nicely updated API docs and many other fixes and features across the board. The Scale Manager, a core part of any HTML5 game has had its own book published about it: A Guide to the Phaser Scale Manager which is available now. One of his other major contributions was in updating Signals, the event system used inside Phaser. Before Phaser was creating thousands of Signals in a busy game, most of which sat idle. Now they've gone on a diet in terms of memory consumption and hide behind a proxy causing them to not even be created unless needed. This has cut down on the amount of objects being generated every frame dramatically. As you may have noticed we've bumped the release version to 2.2 from 2.1. This is because there are some API breaking changes and some core fundamentals have been updated as well. The biggest change here is the move to a proper fixed-step internal game loop. The logic and rendering are now fully decoupled, with both Arcade Physics and Tweens having been updated to use this new system. This is by no means a panacea for overloading low-powered mobile devices. However it will help prevent issues arising from devices running Phaser games at different speeds just because it has a slower processor. Also given a large update is the Tween Manager. This is now hooked in to the new timestep code, smoothing out tweens when the frame rate drops. New features have been added, including the ability to pause and resume a whole timeline of tweens and tween chaining has vastly improved. The Change Log is indeed extensive. I would say that if you are *already* working on a Phaser game, and a good way through development, then you should carry on with whatever version you used before. But for all new projects definitely take the leap into 2.2 and I hope you enjoy splashing around in its new features Thank you to everyone who beta tested 2.2 with us in one of its many Release Candidate incarnations. Your feedback helped fix issues that would have been otherwise troublesome to find and it's a process we'll carry on with for future builds. 2014 has been an amazing year for Phaser and I'd like to take this opportunity to thank everyone who has been involved, one way or another. Your support has been fantastic and we've built great things. Here's to 2015. Cheers, Rich ylluminarious, totallybueno, aaccurso and 10 others 13 Link to comment Share on other sites More sharing options...
wayfinder Posted December 3, 2014 Share Posted December 3, 2014 Three cheers to everyone involved - and consider me surprised that Paul's audacious pull requests are not from a Photostorm employee! Link to comment Share on other sites More sharing options...
deletedacc Posted December 3, 2014 Share Posted December 3, 2014 Sweet. Literally was going to start working on my project tonight, just in time! Link to comment Share on other sites More sharing options...
codevinsky Posted December 3, 2014 Share Posted December 3, 2014 Fantastic. Paul really outdid himself for this release. Link to comment Share on other sites More sharing options...
dmitsuki Posted December 3, 2014 Share Posted December 3, 2014 Nice timing, was just about to start a new game. Link to comment Share on other sites More sharing options...
Oscar Abraham Posted December 3, 2014 Share Posted December 3, 2014 Congratulations and thanks for that awesome release. One question: ¿do the other physic engines, ninja and p2, also benefit from the fixed step game loop? Link to comment Share on other sites More sharing options...
rich Posted December 3, 2014 Author Share Posted December 3, 2014 p2 always used a fixed step update anyway (internally, of it's own making) so it doesn't change how that works. Ninja hasn't been updated for this, no. Link to comment Share on other sites More sharing options...
JakeCake Posted December 3, 2014 Share Posted December 3, 2014 My projects updated from 2.1.3 -> 2.2.0 without any critical errors. On to reading about the scale-manager. Good job! Link to comment Share on other sites More sharing options...
rich Posted December 3, 2014 Author Share Posted December 3, 2014 Just to say that I'm aware of the issue with "alpha" not working on any display object. Was an upstream Pixi issue introduced very recently, which Mat kindly just fixed and is already in phaser dev. I'll likely do a small point release tomorrow to resolve this. Link to comment Share on other sites More sharing options...
Oscar Abraham Posted December 3, 2014 Share Posted December 3, 2014 p2 always used a fixed step update anyway (internally, of it's own making) so it doesn't change how that works. Ninja hasn't been updated for this, no. I'm reading the source code and I'm really happy with what I see on the implementation of physics. At least by what I understand and please correct me if I'm wrong, the physics step runs in the updateLogic method, which runs just enough times to keep with a desired fps, which its kind of like if it had its own clock. Even though before p2 could run with a numerically fixed step, the step method was called the same number of times that the rendering methods; so using a slower p2.frameRate in the same machine would make the game physics movements aparently go faster. It seems now the p2 clock is also properly decoupled which is a lot nicer; I can just use a p2.frameRate that is proportional to the desiredFps to solve my time accuracy problems.It still would be nice if the rendering took into account each sprite's velocity in order to interpolate its position accross multiple render updates between two logic updates, but the overall change in how the update works is very cool and makes precise mechanics much more easier to implement.So thank you again; I'm really glad for Phaser 2.2.--P.D.Also, I'm probably wrong, I'm still learning about videogame programming and programming in general, so sorry if I'm wrong. I'll say this any way for if it helps somehow:Line 774 of Game.js, which isthis.updateRender(this._deltaTime / slowStep);seems to pass to update render what is equivalent to updatesThisFrame, not elapsedTime. I doesn't seem to be used or to affect something, but I thought there's something weird with that and it might help somebody. I know I'm probably wrong, so please forgive me if i'm being a fool. Link to comment Share on other sites More sharing options...
Wavertron Posted December 4, 2014 Share Posted December 4, 2014 I'm kinda stuck on an old version for my current project. But I look forward to 2.2+ for next time. Link to comment Share on other sites More sharing options...
dimensionZ Posted December 4, 2014 Share Posted December 4, 2014 Hi,We used to be able to set the alpha of a sprite > 1. It gave a very nice looking effect (in WebGL). It seems that now the alpha behavior changed, and we lost this effect. Is there a way to get something equivalent? Cheers! Link to comment Share on other sites More sharing options...
horkoda Posted December 4, 2014 Share Posted December 4, 2014 I am using 2.1.2 and will definitely upgrade because of a few features I need (or will make my life easier).Thanks! Link to comment Share on other sites More sharing options...
lewster32 Posted December 4, 2014 Share Posted December 4, 2014 We used to be able to set the alpha of a sprite > 1. It gave a very nice looking effect (in WebGL). It seems that now the alpha behavior changed, and we lost this effect. Is there a way to get something equivalent? This was almost certainly unintentional - an alpha below 0 or above 1 makes no sense. If you could demonstrate the effect we could maybe suggest an alternative (and proper) way to achieve it? Link to comment Share on other sites More sharing options...
lewster32 Posted December 4, 2014 Share Posted December 4, 2014 Actually I've just done a little test; it seems to boost the contrast of the sprite. Interesting... this is pixi-level functionality so I think you'd maybe need to take a look over there to see what's changed. Link to comment Share on other sites More sharing options...
dimensionZ Posted December 4, 2014 Share Posted December 4, 2014 This was almost certainly unintentional - an alpha below 0 or above 1 makes no sense. If you could demonstrate the effect we could maybe suggest an alternative (and proper) way to achieve it?Quite certainly Noticed this by mistake once. Actually I've just done a little test; it seems to boost the contrast of the sprite. Interesting... this is pixi-level functionality so I think you'd maybe need to take a look over there to see what's changed. I shall look into it. Just prefered to post here first. Link to comment Share on other sites More sharing options...
jackwkinsey Posted December 4, 2014 Share Posted December 4, 2014 Just in time for Ludum Dare this weekend! Link to comment Share on other sites More sharing options...
rich Posted December 4, 2014 Author Share Posted December 4, 2014 Just in time for Ludum Dare this weekend! Trust me, that was no coincidence Link to comment Share on other sites More sharing options...
Preece Posted December 4, 2014 Share Posted December 4, 2014 Hey Rich, I'm still having an issue with the update. Here is the error and call stack: Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': No function was found that matched the signature provided.phaser.js:70314c.Tileset.drawphaser.js:69247c.TilemapLayer.renderRegionphaser.js:69368c.TilemapLayer.renderFullphaser.js:69440c.TilemapLayer.renderphaser.js:68773c.TilemapLayer.postUpdate I've been experimenting but have not had luck narrowing down the problem. Aside from the obvious fact that it is from rendering the tile layers. Link to comment Share on other sites More sharing options...
rich Posted December 4, 2014 Author Share Posted December 4, 2014 I'm afraid I'll need something specific to work from - tilemap rendering is working fine in all the Examples, so I'll need to see an example / jsbin which shows it breaking in order to advance any further, sorry. Link to comment Share on other sites More sharing options...
enriqueto Posted December 5, 2014 Share Posted December 5, 2014 Thanks Rich! Already started a game with this new version. Link to comment Share on other sites More sharing options...
Preece Posted December 7, 2014 Share Posted December 7, 2014 Hey Rich, I figured out the problem and wanted to relay the info back. I was using tilesets in Tiled that were functional and not meant to be displayed. So, I would just not load the tileset image and that was working to create the tile but prevent it appearing at all. In this version (of Phaser or PIXI, I'm not sure), something changed where an unloaded tileset will now crash instead of just not being drawn. Link to comment Share on other sites More sharing options...
rich Posted December 7, 2014 Author Share Posted December 7, 2014 Thanks Preece. I'll look out for this when updating to support the new release of Tiled. Link to comment Share on other sites More sharing options...
horkoda Posted December 9, 2014 Share Posted December 9, 2014 You mention the fixed-step internal game loop, and that logic and rendering are now fully decoupled. I assume that "logic" means the State.update() function and "rendering" means the State.render() function?Also, where can I set the "size" of the step? I wish that the update function would be called once per second without any extra code. Is that possible? And yeah, I love this release. Many useful changes/additions for my project! Link to comment Share on other sites More sharing options...
JUL Posted December 12, 2014 Share Posted December 12, 2014 Just tested version 2.2.1 on my project which was running previously under 2.1.0 (the version I decided to settle on until further improvement, after testing a bunch of versions above 2.0.7, which has an acade physic that "breaks" randomly on tile collisions, causing the player to fall off the map). ... And it works flawlessly, at least for me here on my laptop. I haven't tested with cocoonjs on android, though. Anyway, thank you a lot for what you do richard, it's awesome. Link to comment Share on other sites More sharing options...
Recommended Posts