Westward dev log #5: back to Phaser

I have been following the Phaser 3 dev log for months now, getting increasingly more enthusiastic as the engine matures. Both in terms of performance and possibilities, it will be an amazing improvement over Phaser 2.

When Phaser 3 hit beta 1 last week, I decided it was time to make the jump, and at the same time to start using Phaser for Westward. It is important to operate that kind of transition early on in a project, otherwise the refactoring can become very difficult.

Working with a library in beta is not ideal, as there are still a lot of bugs going on and things missing. Still, I managed to accomplish all I needed for now, and seeing how fast Rich works, in a few weeks the bugs will be gone.

The main reason I had shunned Phaser 2 was to be able to manage very big maps in chunks. The great news is that I managed to accomplish it with Phaser 3. Although Phaser 3’s Tile Maps are insanely faster than in Phaser 2, I still had to resort to my own implementation, very similar to the one I made with Pixi. The only way to make infinite maps with Tile Maps is to shift tiles in various directions depending on the camera movement (like in this example), but if you do that you basically have to re-implement yourself all the camera-related methods, among other things. It turned out to be much simpler to forsake Tile Maps altogether and replace it by a similar, custom data structure.

The experimentations with Phaser followed by the refactoring of the existing code base took most of the few days I had to work on this since the last dev log. In parallel, I did make some progress on the procedural aspect. Below you’ll find a capture of a procedurally generated scene, including “mountains”, lakes and trees. Nothing impressive, except maybe for the fact that that scene was generated by clicking on the map a total of 9 times.

The number of clicks is not the best metric to evaluate the result, but at least it shows that the objective of generating a basic explorable environment very quickly and easily can now be achieved. Further improvements to the algorithms to generate more complex content, the addition of gameplay elements, sound and light effects, and a final pass of manual fine-tuning should ultimately yield a nice environment. We’ll see how it goes.

What’s next

I have now spent quite a lot of time on the procedural aspects. This part is not finished (and will probably never be truly finished), but it’s time for the game to start progressing in the direction of an actual game, not just a world editor. Until next dev log, I’ll be implementing the networking aspect of the game, and possibly the movement system as well (which will be click-based as in Phaser Quest). In parallel, I’ll keep working on the design document, as well as on the final world map of the game.

Jerome Renaux

I'm an independent game developer, working mainly on browser-based multiplayer online game (HTML5 & Javascript). I love to discuss about all aspects of game development so don't hesitate to get in touch!

More Posts

Follow Me:
Twitter

Jerome Renaux

I'm an independent game developer, working mainly on browser-based multiplayer online game (HTML5 & Javascript). I love to discuss about all aspects of game development so don't hesitate to get in touch!