Newsletter
Published on 1st July 2016
Welcome to Issue 37 of Phaser World
We're now half way through the year, and what a year it has been so far. Phaser continues to evolve in a solid and feature-packed direction. Lazer development is still in full swing, and you lot have been creating some amazing games and tutorials!
There's a huge Development Progress section this issue, with lots of technical details about how we've been handling Transforms in Lazer. So without any further chit-chat, let's get stuck in.
Until the next issue, keep on coding. Drop me a line if you've got any news you'd like featured (you can just reply to this email) or grab me on the Phaser Slack channel.
News
The new Phaser 2.5.1 Release Candidate is out. You can read more about it in this issues Development Progress section.
Advanced Phaser Game Development
The first 10 videos from Module 2 of this course are now out. They cover building a multiplayer Bomberman style game, with path finding.
Games made with Phaser
Game of the Week
Cast runes at the beasts to defeat them before they slash your health down.
Staff Pick
A post apocalyptic quest based rogue-like.
The animals are hungry. Feed them with the right food!
Escape from your workplace so you can go on a date with your girl!
A minesweeper permadeath game inspired by Runestone Keeper.
Phaser Tutorials
Globez has been updated to Phaser 2.5 and the full source is available.
The third episode in the video series covers the Player.
The fourth episode in the video series enhances the Player.
The fifth episode in the video series adds game UI.
The sixth episode in the video series adds obstacles into the game.
Development Progress
Release Candidate 1 of Phaser 2.5.1 is now available for download. As usual you can get the pre-built files from the `dev` branch of the Phaser GitHub repo:
https://github.com/photonstorm/phaser/tree/dev/build
You can also read about what's changed in this release in the Change Log.
2.5.1 is a point release that is specifically aimed at bug fixes and minor updates. This includes fixes such as making Input work again on Graphics objects. Also updates such as the TilemapParser pulling in extra image data, new arguments to help render Text quicker in async processes, and various docs and TypeScript fixes.
Please grab the build files and give it a test. If you're using 2.5.0 already it should be an easy swap, with zero breaking changes to your code. If you have a clone of the Phaser repo then pull down the dev branch, and you'll find updated docs and TypeScript defs too.
Lazer Development
Over the past couple of weeks we've been focusing on how to handle Transforms in Lazer. Transforms are vital to any game framework, as they handle all transformations of display objects, such as the objects position, rotation and scale.
When you have an object as a child of another, and you perform a transform on the parent such as scaling the parent, then it should influence the scale of the child as well. This is how all display lists work - the transforms flow down from the top to the bottom, branching out as they reach children on the way.
One of the biggest problems we have with Phaser is the way it uses Pixi's deferred transform system. In this set-up the transforms are only ever updated once, just before the display objects are rendered. This means that if you need to use a value, such as the scale of an object, in a calculation prior to the render loop, then the values are all 'stale', being based on the previous frame. It was important we addressed this in Lazer: if you poll an object for its rotation for example, you should get the exact perfect value back,taking all of its parents into consideration, no matter when you make that call.
As every object has a transform it's imperative that they calculate themselves extremely quickly, and that is what Felipe has been working on the past few weeks.
There are 5 Transform tests in the Lazer Labs. They are:
GPGPU
The main idea of this was to offload transformation computation to the GPU using frame buffers as a way to input and output data from it. This approach is very efficient for computing the transformations thanks to the data parallelism found in GPUs, but the main bottleneck was trying to read information and making available for users. This might be a good idea but for a different problem.
Intrusive Doubly Linked List
This approach was about implementing an intrusive linked list into the Transform class. This would allow for easy inserting and removing of items and also for easy traversing of a huge scene graph tree. This would allow as to have a nice looking API like this:
Matrix Decomposition
This implementation idea is about defining the Transform abstraction as a matrix or a simple 1D typed array. There wouldn’t be any position, scale or rotation variables but only a matrix from which we read values and apply transformations.
This approach would allow us to have a similar design like the previous one but with a small difference. Values wouldn’t be stored directly on the Transform class but would have to be used and disposed right away, especially if you are dealing with and element that is constantly having transformations applied to it:
Matrix Stack
This approach is a very known and old one. It’s used on canvas and it was also used on old OpenGL API. Basically you have a stack of matrices and you push and pop to save or restore the current matrix state.
This isn’t much for solving the original problem but more for rendering a scene graph. All computation is done on CPU but it’s an easy and clear to use interface.
Keep an eye on the Lazer GitHub repo to see all the code that has gone into these tests and more.
Geeky Links
This one has been doing the rounds, but it's a fantastic 3D re-creation of a Calvin and Hobbes comic strip.
Here's the BlinkOn 6 conference YouTube playlist from Germany. There is some outstanding and really deep content, including V8 ES6 optimisations and a good look at Ignition.
Konami have released Contra Chronicles 2 - which is a whole bunch of music, original and remixed, from the legendary Contra series of games.
Phaser Releases
The current version of Phaser is 2.5.0 released on June 17th 2016.
Phaser 2.5.1 is at Release Candidate 1 in the GitHub dev branch.
Please help support Phaser development
Have some news you'd like published? Email support@phaser.io or tweet us.
Missed an issue? Check out the Back Issues page.