Jump to content

Phaser 2.5 + Pixi v3 Build for testing


rich
 Share

Recommended Posts

On 09/02/2016 at 2:09 PM, rich said:

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 :(

Another FPS test run, current pixiV3 build:

Canvas:    Pixi2-52.1, Pixi3-56.1

WebGL:    Pixi2-15.7, Pixi3-15.0

 

So on this box, canvas slightly up, webgl slightly down.  No FXAA warnings, where I used to on this machine.  Render texture drawing is jagged, not antialiased.

 


 

Link to comment
Share on other sites

Hi Rich!

One question... Do you want to improve and integrate my plugin into the Phaser core? Is very necessary the scrolling in the games =)

See: http://jdnichollsc.github.io/Phaser-Kinetic-Scrolling-Plugin/

I have a idea but I don't know how to do it... I want to identify if the gesture is a tap or a swipe, what do you think?

See my draft: https://gist.github.com/jdnichollsc/b267ce2684b772169ea3 (Maybe using the time... < 300ms is a tap)

Regards, Nicholls

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

Tested this on a current game in development which has no known bugs.. Only found 1 issue.. 

(2) phaser.js:26284 WebGL: INVALID_VALUE: texImage2D: no canvas
(2) localhost/:1 [.CommandBufferContext]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.

When creating the level, sometimes the text isn't drawn to the sprite as a child, only happens sometimes, and I cannot re-produce. Restarting the state may or may not produce the same issue on separate sprites. (See Untitled.png).

Apart from that, it looks pretty good! My JS Head has decreased, performance seems to have gained, though I haven't tried out Pixi's new FXAA options, which I will do! 

    createText() {
        // create a style of text - placeholder only
        let style = {
            font: "100px Arial",
            fill: "#000000",
            align: 'center'
        };

        // Give the node it's value here
        this.nodeText = this._game.add.text(0, 0, this._value, style);
        this.nodeText.anchor.setTo(0.5);
        this.addChild(this.nodeText);
    }

Not sure if you can do a great deal with what I've given you, but it may do all the same. Code written in ES6, extending Phaser.Sprite Class. 

Keep up the great work guys!!!

Untitled.png

Link to comment
Share on other sites

Hello,

It seems that animation that uses atlas format now broken.

here goes the code example to demonstrate it (in attachment).

trimmed must to be true in order to see this.

It seems that crop calculating incorrect. and allways take all sprite size starting from x/y of frame, instead of using width/height

The atlas is from PIXI example page.

 

Thank you for any assistance and great frame work.

Sorry for my english.

 

fighter.json

fighter.png

index.html

Link to comment
Share on other sites

Oh right, that would explain that! Thanks, I'm looking forward to a stable version of 2.5 so I can start getting into pixi 3.x, though not as excited as I am about Lazer 3.0! ;) Incase people forget to tell you from time to time @rich, thanks for all the hard work you do! 

Link to comment
Share on other sites

I've still not decided what to do about Pixi 3. I thought merging it with Phaser would bring in speed increases, but it doesn't seem to have done anything beyond increase the file size. They just released a new build of Pixi 3 yesterday though, so I may give that one last go and then leave this alone as an interesting side-project, if anyone else wants to carry on with it.

Link to comment
Share on other sites

On 01/04/2016 at 0:29 PM, rich said:

I've still not decided what to do about Pixi 3. I thought merging it with Phaser would bring in speed increases, but it doesn't seem to have done anything beyond increase the file size. They just released a new build of Pixi 3 yesterday though, so I may give that one last go and then leave this alone as an interesting side-project, if anyone else wants to carry on with it.

I know what you mean, PixiV3 can be impressive and I would have expected just a little more, but it does require the driving framework to be lean and mean to carry through the performance.  Also don't overlook the fact that V3 potentially brings extra features that whilst not implemented or wired up in Phaser yet, they could be utilised in the future.

I'd say, if V3 can be incorporated seamlessly and without too much dev, then Phaser will be in the best position to use it to it's true potential - for those who are interested!  I'd use it and wouldn't be bothered by the increase in file size, if it opened the door to V3.

Link to comment
Share on other sites

57 minutes ago, rich said:

I thought something similar, but then they went and released v4 the other day :)

I purposely didn't mention the V4 elephant sitting quietly in the corner, it is relevant but only as much as Lazer is to Phaser.  Sure there's always a new kid on the block, and then a new kid after that and so on.

It boils down to effort vs reward. I do think though that Phaser usage will continue quite well into the future even when Lazer is viable, its still alive and kicking and giving it this final boost could extend it's longevity - if that is desirable.

Link to comment
Share on other sites

Given the changes I need to make to get v3 to work though, it's not a million miles away from getting v4 to work. As v4 does (apparently!) offer some serious rendering speed boosts then I can't help but think it might be a more worthwhile endeavour.

I was quite excited about putting v3 into Phaser until I realised it made no actual difference, then the enthusiasm to spend precious time on it fell away. Perhaps v4 is worth a go.

Link to comment
Share on other sites

4 minutes ago, rich said:

Given the changes I need to make to get v3 to work though, it's not a million miles away from getting v4 to work. As v4 does (apparently!) offer some serious rendering speed boosts then I can't help but think it might be a more worthwhile endeavour.

I was quite excited about putting v3 into Phaser until I realised it made no actual difference, then the enthusiasm to spend precious time on it fell away. Perhaps v4 is worth a go.

Well you and xerver probably know more about V3 integration than most, so if V4 integration isn't much more on top then it gets my vote.  V4 should also extend the Phaser lifespan more than V3 would and any noticable performance gains would be appreciable by all.

Link to comment
Share on other sites

Hey rich!

First of all I'd like to thank you for Phaser development! It's really a great framework, been working with it for already ~2 months and had a lot of fun. :) Good job, keep going - planet's gonna be filled with Phaser games! 

2All:

My last two days were dedicated to pixi v3 crop issues while using atlas for sprite animation. Animation frames are cropped weirdly as you can see in Ranaril's example: http://romanmurashov.ru/t/strange/index2.5.html

Seems that Pixi loses reference to frame data somewhere or passes incorrect values to Phaser. But when you access texture properties it gets even more weird, although sprite behavior breaks in a bit different way: http://romanmurashov.ru/t/even_more_strange/index2.5.html

 

	function create() {
			logo = game.add.sprite(0, 0, 'logo');
			logo.animations.add('run');
			logo.animations.play('run', 6, true);
			
			// crop.x, y, width and height are taken from 'frame' properties in atlas
			text = game.add.text(200, 150, 'x:' + logo.texture.crop.x, s);
			text1 = game.add.text(200, 170, 'y:' + logo.texture.crop.y, s);
			text2 = game.add.text(200, 190, 'w:' + logo.texture.crop.width, s);
			text3 = game.add.text(200, 210, 'h:' + logo.texture.crop.height, s);

			// frame width and height are spriteSourceSize width and height respectively
			text4 = game.add.text(200, 230, 'w:' + logo.texture.frame.width, s);
			text5 = game.add.text(200, 250, 'h:' + logo.texture.frame.height, s);

			// are sourceSize props from atlas ignored?

			text6 = game.add.text(200, 270, 'frame:' + logo.animations.frame, s);

			game.input.keyboard.onDownCallback = callStopAnimation;

			console.log(logo);
		}

		function update() {
			// if you access texture props, width, height and bounds of animated sprite change dynamically 
			text.text = "crop.x: " + logo.texture.crop.x;
			text1.text = "crop.y: " + logo.texture.crop.y;
			text2.text = "crop.width: " + logo.texture.crop.width;
			text3.text = "crop.height: " + logo.texture.crop.height;
			text4.text = "frame.width: " + logo.texture.frame.width;
			text5.text = "frame.height: " + logo.texture.frame.height;
			text6.text = "frame num: " + logo.animations.frame;
		}

Does anyone have a clue about internal operations with Pixi texture? Would be really great to receive any kind of advice.

Thank you in advance. :)

index2.5.html

fighter.json

fighter.png

phaser2.5.min.js

Link to comment
Share on other sites

17 hours ago, roman-murashov said:

Hey rich!

First of all I'd like to thank you for Phaser development! It's really a great framework, been working with it for already ~2 months and had a lot of fun. :) Good job, keep going - planet's gonna be filled with Phaser games! 

2All:

My last two days were dedicated to pixi v3 crop issues while using atlas for sprite animation. Animation frames are cropped weirdly as you can see in Ranaril's example: http://romanmurashov.ru/t/strange/index2.5.html

....

Does anyone have a clue about internal operations with Pixi texture? Would be really great to receive any kind of advice.

Thank you in advance. :)

 

Hi Roman, you are using a 'dev' version of Phaser, it's broken.  I tried the 'strange' example, the problem went away when I replaced Phaser with release versions of both 2.4.5 & 2.4.6 - 2.4.5 has other problems so use 2.4.6

Link to comment
Share on other sites

  • rich unpinned this topic
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...