Phaser 2 and our plans for the future

phaser2-github

Exactly 6 months after the release of Phaser 1.0 we released version 2. It was a huge update. Not so much in terms of new features, although it did bring its fair share of tasty new treats to the table. But more so it underwent a large internal change. We upgraded to the latest version of Pixi.js, our renderer and this in turn allowed us to literally shave thousands of lines of code out.

The core update loops of all the game objects like Sprite and Button, were dramatically reduced. Lots of the things that caused Phaser 1.x to not be quite as optimal as it could be were eliminated. Expensive routines and processes were either removed entirely or disabled where possible.

It was a big update, but it felt good. It felt clean and fresh. Like when you tidy-up your work space, or white wash a room ready for painting. You know you’re building on top of something sound.

There were a number of API breaking changes moving from v1 to v2, which is why we jumped version number so high (originally it was just going to be the 1.2 release). It was a lot of simple but important alterations. Things like the Group class now properly extending a DisplayObjectContainer, so they can easily be nested and shifted around the display list. Or Sprites no longer having physics bodies by default, or input handlers, which meant the amount of code they process during their basic update is now utterly minimal. Those features are still available of course, you just have to activate them explicitly. The changes were so extensive we produced a Migration Guide to help developers shift over.

The TriForce

Traditionally Phaser has had the ArcadePhysics system built in. This was a port of the one found in Flixel and our Flixel Power Tools. It was fundamentally basic, but still covered quite a lot of bases and most importantly was very easy to use. However the limitations really started to bug us, and we tried to address them in the 1.1.4 release of Phaser, with less than stellar results.

A strong reason for us developing Phaser 2 was so that we could use a proper full-body physics system, in our case the excellent p2.js by Stefan Hedman. And for a good while this was the only physics system we had built in. But as we worked through the weeks of development, it became apparent that there was a real need to keep ArcadePhysics around. Not the broken 1.1.4 version, but the earlier release that mostly just worked, because it didn’t try to be too clever.

We started to re-implement ArcadePhysics¬†alongside of P2 (the one we were affectionately referring to as ‘advanced physics’). And then it struck me: why limit ourselves to just 2 physics engines? As great as P2 is, lots of people like using Box2D or Chipmunk, just because they’re familiar with them. Wouldn’t it make more sense to write a unified Physics Manager, and then extend that with as many different engines as we needed? Make it clear-cut enough and the community could contribute their own too. So that’s exactly what we did.

phaser-p2-cannon

Gone was the notion of ‘basic’ and ‘advanced’ and in was the concept of you telling Phaser to start-up a specific physics system and then enabling objects to use it.¬†As it stands we support p2.js, Arcade Physics and Ninja Physics out of the box. Ninja being our port of the Metanet N+ Flash physics library.

So you as the developer are free to pick which one you feel will work best for your game. Indeed you can even mix and match them together in the same game. We provide special custom builds of Phaser in the repository that allows you to pick which components you have included or not, and our build script lets you control this even further.

So far we’ve seen the start of a powerful Box2D extension being contributed, and are also investigating adding support for Matter.js and Chipmunk too. It feels great to not be saddled to just one option, and although it’s taken a little more community education to explain how it now works, we feel it’s been worth it.

Weekly Update Cycle

As Phaser 2 was such a large upgrade it was inevitable we would need to refine it post-launch. We were determined that with this release we would stablise the API. Previously we had been chopping and changing the API around at will, which makes it really tricky for those teaching Phaser in class, or writing books or tutorials, to have a stable “starting point” to base their work on.

Phaser 2 was to mark a solid line in the sand. Any significant API changes that may be required from that point would be community voted and approved first, but fundamentally we’d try to avoid them. Even so we still knew there would be some issues to fix and areas to tighten up. So we entered a weekly update cycle to ensure things were resolved fast. Phaser 2.0.1 was pushed out last week and 2.0.2 today. The change list is quite sedate, but it’s still important – especially if you use ArcadePhysics. And we’re making sure the API remains consistent throughout.

phaser-p2-boxes

So what next?

We’ve closed down so many issues and stomped on so many bugs that we’re happy to move to a bi-weekly update cycle starting in April. This will free-up time to shift focus to creating new tutorials and beefing up the examples and documentation. After all, we know what can be done with Phaser (and it’s a lot!), but if we don’t impart this knowledge to you, then what was the point in building it in the first place? It’s also time to get the full web site online. So start looking out for more tutorials soon.

Premium Support Packages

As more studios and agencies start using Phaser it has come to the point where we need to offer proper premium support packages. We’ve always offered free support via email, github and the forum, but you were never guaranteed a reply and certainly not within a specified time limit.

By making premium support available we can start to offer larger companies and organisations the sorts of assurances they require when entering into development with Phaser. Services include project planning consultancy, technical support and custom plugin development. If any of these things sound like they may interest you then please get in touch. Pricing is available on an hourly and daily basis, pre-paid or on demand.

Custom Game Development

Traditionally we have always offered game development services, and we’ve always used Phaser in one incarnation or another for this. As we enter Q2 2014 we are looking to book in new projects to see us into the Summer. Truth be told, we made the fatal mistake of taking on too many projects in 2013. A common issue for new companies, especially ones in such demand as we are. But of course this stretched our resources too thin and caused us complications.

To combat that we’ve been much more selective and careful about what we’ve been doing in 2014 and it has paid off. We’ve invested in additional developers and artists, but crucially are now far better at planning and managing workload. I feel that this all warrants a blog post in its own right at some point. But if you have a project that you need a highly skilled HTML5 game development team for then please get in touch.

phaser2-fonts

Gamelab Marketplace

In partnership with Kiwi.js we are soon to be opening a section on the forth-coming Gamelab Marketplace. This will give us a professionally supported and managed shop front from which to offer pre-made game templates and premium plugins for sale.

Phaser and Kiwi.js themselves will of course always be free and open source, but it was our intention all along to support their development costs with commercial services and add-ons. Gamelab will be our platform for that. It’s also a marketplace that will be open to fellow developers to sell their premium plugins in, regardless of framework. More details will be posted as they become available.

spacedancer4x

In short we’ve got some truly exciting times ahead of us!

Developers are using Phaser to create, release and sell games more than ever before. Literally hundreds of games have been released in the short time it has been available, and we’re constantly ranking high in the github top trending JavaScript repositories. This is a sure sign to us that (a) we’re doing something right here :) and (b) there is a real demand for web based gaming across desktop and mobile.

We have a number of exciting plans for future additions to Phaser, and the best way to stay up to date with them is to subscribe to the Phaser newsletter. Also we’d just like to take a moment to thank every member of our community. The forum is bristling with activity and well worth joining. Your kind feedback honestly helps motivate us to work every day to improve Phaser. After all, the better we make it, the more we all win.

Posted on March 29th 2014 at 2:34 am by .
View more posts in Phaser. Follow responses via the RSS 2.0 feed.


3 Responses

Leave a comment
  • March 30th 2014 at 5:31 am

    The Gamelab Marketplace sounds like a great idea. Can’t wait to see it come to life! Very exciting stuff!

  • JD
    May 17th 2014 at 3:53 am

    Sounds like some good stuff. More docs and tutorials would be really good (I’m about to download and start testing out Phaser right now so I may be biased :) ).

  • Withjam
    June 23rd 2014 at 3:12 am

    I’m just getting started with Phaser (after much shopping around and trial/error with others) and very happy/excited about the framework. Since I didn’t go through the upgrade experience – rather I just understand that Phaser has 3 different physics offerings for now – could you compare/contrast the 3 different systems for those of us who are unfamiliar? I am currently building with Arcade physics because all of the examples I’ve found use them. But I’d love to know why/if I should choose one of the others instead.

Make yourself heard