nicholas-ochoa/OpenSC2K

Switch to PhaserIO

Opened this issue · 9 comments

Both use webgl and are considerably better than handling canvas directly.

Agreed - I've already started looking in to PixiJS - after I've got the game importing assets this is my next large milestone. The canvas performance isn't terrible now, but there is a ton of room for improvement.

#8

I raised the same suggestion here. Phaser is also built on top of Pixi - depends how far we want to go with it.

Switched from Pixi to Phaser once I realized how much Pixi is lacking (and what Phaser takes care of for you). Seeing some huge performance gains with frame rates at a solid 60fps with the entire map on screen. Still needs a lot of work specifically around z-order issues and getting animations working again, but it's progressing. Hoping to put a version up in the next day or so, eventually this will become the main branch.

It's coming along very well - I've finally got it back up and running to the point it was before switching to Phaser - just need to work out a few remaining bugs and hoping to post a commit tomorrow evening with the changes.

Solid 60fps will full animations, also have the game asset extraction / import / tile map generation completed - if a bit ugly. That'll be included as well.

Next steps after this will be removing the native SQLite dependency and restructuring the project to ES6 standards.

Side note: One nice thing about moving to Phaser, I'm already seeing some benefits of the framework in things such as Camera controls and instances - I've tested multiple cameras (similar to how the Tycoon series does it) and it works flawlessly with zero impact to the frame rate. Full zooming and controls in all cameras as well.

You're probably good for now, but Phaser 3 has just been released.

It is bleeding edge at the moment so you've probably got a bit of time but it's there.

I’ve been working with the 3.x codebase, it’s given me some headaches (most examples are 2.x) and the docs are lacking, but it’s been worth it

Any eta when the rewrite will be up? Was wanting to contribute, but have to wait till that's done.