rich Posted February 6, 2016 Share Posted February 6, 2016 Hi all, After a bit of experimenting I've prepared a build of Phaser 2.5 that contains Pixi v3.0.9 - the latest stable build. The way it works is that I've taken the Pixi v3 build file and just include that directly. I then hook into this as needed. This means that the file size has increased quite a lot. The min.js is now 926KB for the full-monty version (all features, P2 physics, etc). This gzips down to 220KB. The Arcade Physics min.js is 763KB, which gzips to 182KB. It also means you can no longer choose to do things like 'remove Graphics' or 'remove TileSprites' from a custom build. It will remove the Phaser side, but the Pixi files will still be left in. Better than nothing though. However as a result of the merge you get all the benefits and new features that Pixi v3.0.9 brings to the table, so I guess it's a trade-off for you to decide about. I've tested lots of the Phaser Examples and most of them work. There are some known issues at the moment: Videos don't render for example, and Filters mostly work, but some of them have issues I've not tracked down yet. Oh and on Retina screens the canvas appears scaled-down (1:1 resolution). On the whole all the usual suspects are in and rendering just fine: Graphics, Tilemaps, Sprites, Physics, Text, Bitmap Fonts, etc. If you want to give this a test then grab it from here: https://github.com/photonstorm/phaser/tree/pixi3/build I'd be curious to know how you get on with it. It's entirely possible your game won't run at all, and if it crashes I'd like to know where If you do anything that modified the Phaser internals (and by proxy the Pixi internals) significantly, then that probably will no longer work either. Still - several of you asked for this, so here you go! Eat your hearts out Cheers, Rich hollygood 1 Link to comment Share on other sites More sharing options...
WombatTurkey Posted February 6, 2016 Share Posted February 6, 2016 RIP Phaser Debug Plugin, and destroyCachedSprite: Just telling you what happens when I tried it. Ofcourse, It doesn't bother me as 2.4 works fine right now, but I thought I'd load her just to test the waters. Link to comment Share on other sites More sharing options...
qdrj Posted February 6, 2016 Share Posted February 6, 2016 Thanks for this build Rich. Error on text.destroy() var style2 = { font: "10px bariol_boldbold" }; var text2:Phaser.Text = this.add.text(0, 0, "1234567890%", style2); text2.destroy(); Link to comment Share on other sites More sharing options...
bruno_ Posted February 6, 2016 Share Posted February 6, 2016 I am also getting the same error when chaging state: Phaser v2.5.0-dev | Pixi.js 3.0.9 | WebGL | WebAudio http://phaser.io ♥♥♥ Uncaught TypeError: this._destroyCachedSprite is not a function phaser.min.js:20 c.Component.Destroy.destroy @ phaser.min.js:20 c.TileSprite.destroy @ phaser.min.js:22 c.Group.removeAll @ phaser.min.js:18 c.Group.destroy @ phaser.min.js:18 c.World.shutdown @ phaser.min.js:18 c.StateManager.clearCurrentState @ phaser.min.js:17 c.StateManager.preUpdate @ phaser.min.js:17 c.Game.updateLogic @ phaser.min.js:18 c.Game.update @ phaser.min.js:18 c.RequestAnimationFrame.updateRAF @ phaser.min.js:23 window.requestAnimationFrame.forceSetTimeOut._onLoop @ phaser.min.js:23 Note that I'm not destroying explicitly any sprite. Link to comment Share on other sites More sharing options...
rich Posted February 6, 2016 Author Share Posted February 6, 2016 A new build is now uploaded which has the Destroy issues fixed in it. Should be a drop-in replacement, so please give it a go! Link to comment Share on other sites More sharing options...
bruno_ Posted February 6, 2016 Share Posted February 6, 2016 26 minutes ago, rich said: A new build is now uploaded which has the Destroy issues fixed in it. Should be a drop-in replacement, so please give it a go! Tested the new build and it worked ok with my game . Both phaser.min.js and custom phaser build with arcade physics were ok. I had to change sprite.worldPosition.x to sprite.world.x Also, for every game.add.tileSprite(0, 0, game.world.width, game.world.height, 'my_image'); I get the following warning (it's just a warning, it still works): The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on I didn't fully understand your first post regarding custom builds. I actually use this build: grunt custom --exclude gamepad,bitmapdata,graphics,text,bitmaptext,retrofont,rope,net,debug,create,flexgrid,color,ninja,p2,tilemaps,particles,creature,video --filename phaser --uglify that gives me an awesome 405kb build (versus a 746kb for the arcade physics build, which is also not bad). Will I be able to do a custom build of the 2.5 version when (if it will) be released as stable? Thanks Link to comment Share on other sites More sharing options...
bruno_ Posted February 6, 2016 Share Posted February 6, 2016 I did some more testing, this time on mobile. I tested in a cordova/crosswalk (both latest stable versions) application on android tablet and phone. I noticed an overall fps drop. With phaser 2.4.4 I get near 60fps on both devices. With phaser 2.5 I got near 30fps also on both. It only worked ok with canvas (Phaser.CANVAS). With WebGL (Phaser.WEBGL) the images were blurry and with no color. Link to comment Share on other sites More sharing options...
rich Posted February 7, 2016 Author Share Posted February 7, 2016 Hmm TileSprites work fine for me without throwing any errors. Very weird! My comment about the Custom builds means that in Phaser 2.4 if you exclude say Graphics from your custom build, it doesn't include any of the Pixi Graphics files either, saving lots of space. But with the way I have to do it for Pixi 3 all of the Pixi Graphics files remain in there no matter what, they cannot be excluded now. Only the Phaser Graphics file is removed. Basically it takes up more room. Link to comment Share on other sites More sharing options...
bruno_ Posted February 7, 2016 Share Posted February 7, 2016 It's not throwing an error, it's a warning. Link to comment Share on other sites More sharing options...
rich Posted February 7, 2016 Author Share Posted February 7, 2016 Yes the deprecation warning from Pixi. But it doesn't throw that at all for me, in any of the TileSprite Phaser examples. Link to comment Share on other sites More sharing options...
rich Posted February 7, 2016 Author Share Posted February 7, 2016 New build uploaded. Tightens up the BitmapText Destroy function on State swap. Also game.resolution now matches the device pixel ratio. Link to comment Share on other sites More sharing options...
nkholski Posted February 7, 2016 Share Posted February 7, 2016 Tested it in my Metroid remake and the tilemap wont scroll. As expected it's only a graphical bug, the collisions works as expected where the tiles should be and the sprites scrolls correctly. What are the benefits of integrating Pixi 3? Performance? Link to comment Share on other sites More sharing options...
stupot Posted February 7, 2016 Share Posted February 7, 2016 Stress testing (mostly straight blitting, a little masking and render targetting) on windows7 Chrome, I get these FPS: Canvas: Pixi2-41, Pixi3-40 WebGL: Pixi2-15, Pixi3-5 Notes (with Pixi3 in WebGL mode): - the render target isnt quite right, of the gfx drawn into a render target the position is offset and the scaling too small - I get this warning "FXAA antialiasing being used instead of native antialiasing" Link to comment Share on other sites More sharing options...
rich Posted February 7, 2016 Author Share Posted February 7, 2016 1 hour ago, nkholski said: Tested it in my Metroid remake and the tilemap wont scroll. As expected it's only a graphical bug, the collisions works as expected where the tiles should be and the sprites scrolls correctly. What are the benefits of integrating Pixi 3? Performance? I've just uploaded a new build which should solve that, but let me know if not please. Link to comment Share on other sites More sharing options...
rich Posted February 7, 2016 Author Share Posted February 7, 2016 1 hour ago, stupot said: Stress testing (mostly straight blitting, a little masking and render targetting) on windows7 Chrome, I get these FPS: Canvas: Pixi2-41, Pixi3-40 WebGL: Pixi2-15, Pixi3-5 Notes (with Pixi3 in WebGL mode): - the render target isnt quite right, of the gfx drawn into a render target the position is offset and the scaling too small - I get this warning "FXAA antialiasing being used instead of native antialiasing" Most people are reporting it to be much slower, which is hardly encouraging. The FXAA warning - is that coming from Chrome itself, or from Pixi? Link to comment Share on other sites More sharing options...
stupot Posted February 8, 2016 Share Posted February 8, 2016 11 hours ago, rich said: Most people are reporting it to be much slower, which is hardly encouraging. The FXAA warning - is that coming from Chrome itself, or from Pixi? I'm on a different machine today, but with the same code and browser and OS and WebGL mode, I'm not getting the FXAA warning and the FPS has jumped up to 59. I'm pretty sure the FXAA warning was originating from phaser.js. My stress tester app is nothing specific, it's just a 'normal' game but I don't use much of the capabilities of Phaser, like physics or tilemaps as these appear to bog it down, I just mostly use plain drawing and the scenegraph - so my app is a fairly good for testing the performance of the underlying renderer and I loop the render call to stress it out (currently it took 33 render loops before the FPS showed any movement away from the max). I've also juist noticed that text isn't being updated in WebGL mode, it gets set correctly when created but subsequent updates to the text aren't appearing. Link to comment Share on other sites More sharing options...
rich Posted February 8, 2016 Author Share Posted February 8, 2016 Ok there's a new build uploaded with FXAA and AntiAlias disabled. This should help things considerably and I'm curious if it'll put the frame rates back up again. Link to comment Share on other sites More sharing options...
rich Posted February 8, 2016 Author Share Posted February 8, 2016 Oh and I've fixed Text update too. Link to comment Share on other sites More sharing options...
AGulev Posted February 9, 2016 Share Posted February 9, 2016 Phaser with pixi v3 it's a great news!!! I tryed run my current project on iPad, it's doesn't start. Show me next error On desktop game was start, but I'm using this.game.load.atlasJSONArray (atlas was create with texture packer) and my sprites bounds calculate incorrect, for example: Link to comment Share on other sites More sharing options...
rich Posted February 9, 2016 Author Share Posted February 9, 2016 New build uploaded with fix for SoundManager unlock in. Red Spark and tips4design 2 Link to comment Share on other sites More sharing options...
stupot Posted February 9, 2016 Share Posted February 9, 2016 15 hours ago, rich said: Oh and I've fixed Text update too. Yup, that's fixed it. Link to comment Share on other sites More sharing options...
nkholski Posted February 9, 2016 Share Posted February 9, 2016 On 2016-02-07 at 0:53 AM, rich said: I've just uploaded a new build which should solve that, but let me know if not please. Whatever you did fixed it. I'm unable to see any changes in performance compared to 2.3.x (60fps as before) and everything seems to work alright, but I literally tested it with my left hand only having a sleeping baby on my right arm. I'll test it more thoroughly when I get a chance. Link to comment Share on other sites More sharing options...
rich Posted February 9, 2016 Author Share Posted February 9, 2016 I'm still not sure this endeavor is actually worth it. Perhaps someone could show me something that Pixi 3 has that is a big benefit over Pixi 2? So far I seem to be getting the same FPS rate as before, with nothing but an increased file size (and broken filters) to show for it Link to comment Share on other sites More sharing options...
Red Spark Posted February 9, 2016 Share Posted February 9, 2016 3 hours ago, rich said: New build uploaded with fix for SoundManager unlock in. Thanks for this! Should I just call this.game.sound.unlock() on first interaction, or does it happen automatically under the hood? Can't readily test it on iDevice unfortunately, hence asking. Link to comment Share on other sites More sharing options...
rich Posted February 9, 2016 Author Share Posted February 9, 2016 It doesn't it automatically, like it always has. Link to comment Share on other sites More sharing options...
Recommended Posts