Jump to content

Phaser hangs unexpectedly, "Cannot set property '__next' of null"


freelyfred
 Share

Recommended Posts

Hey,

 

We have a 3/4 perspective game running at 800x800 with about 50 32x32 sprites on the screen at one time.

 

After loading our game, within about 30 seconds with movement of our character, the game starts to bog down, shortly hangs, and we receive the error in the Javascript Console:

 

Cannot set property '__next' of null (line 4197 of phaser.js)

 

We are running the dev version of phaser, but have tried with the stable version with no success either.

I suspect we just need to optimise our game, but it doesn't seem to be overly complicated - we are surprised that it starts to bog down with only 80 or so sprites on the screen.

 

Any help would be greatly appreciated

Thanks

Link to comment
Share on other sites

That line of code is part of the Pixi library rather than Phaser itself. Something to do with WebGL batching. Might be worth asking over in the Pixi forum or on github.

 

Not sure what the problem is, but it seems that part of the code is traversing sprites with their internal linked lists - is it possible that you're setting a sprite to null before this function gets called? 

Link to comment
Share on other sites

Lewis, we looked at the code too. All we are doing is looping through our local array of sprites, and setting their velocities in the update() function.

 

On further inspection, it seems to be the depth sorting we are doing that breaks it. We can add 500+ sprites with no issues, but if we have 100 sprites with depth sorting, it starts to bog down and eventually hangs.

 

We are thinking of implementing a chunking system with groups, and then only depth sorting groups against each other. This is great and all, but what happens with the sprites? How do we depth sort them against the groups if they can move between different groups? Ideas? 

 

Thanks for your help

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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