Navigation

Phaser Dev Log - May 2023

Published on 31st May 2023

Welcome to a new Phaser Dev Log. This time we're covering what's been going on since the release of Phaser v3.60 - it's both a lot and dramatically different from usual.

After many, many months of insanely hard work, I finally released Phaser v3.60 on April 12th, ten years to the day since the release of the very first version of Phaser. It was a huge milestone for me, both personally and professionally. Honestly, I was so happy to get it out there finally!

I was also exhausted. The final few days, I didn't sleep at all, crunching like crazy to make it as good as I could. And yes, it took its toll on me. I guess I'm not as young as I used to be 🙂 So I took a week off to recharge my batteries and soak up the glow that comes from such a monumental release.

Thankfully, all of those beta releases seem to have paid off. The feedback from the community has been overwhelmingly positive. I've had so many lovely messages from people, and it's been a real joy to read them all. I'm so happy that people are enjoying the new version and that it's working well for them. It's also been great to see so many people upgrading their games to v3.60 and the new features being used in so many different ways.

It's not all roses, though. Clearly, some bugs either slipped through or just weren't known about prior to release. My aim is to start on the v3.61 version in the coming weeks to wrap up as many loose ends as possible. When you start seeing me merging Pull Requests and closing issues, you know I'm on the 3.61 warpath!

Back to the Web

So what's been going on since then? Those of you on the Phaser Discord will already be aware, but I've been hard at work rebuilding the Phaser website. I've been wanting to do this for a long time, but it's a huge undertaking. There are thousands of pages of legacy content, and it always felt like such an overwhelming task that I kept putting it off. It's always easy to find something 'more important' to do when you don't really want to do a task, isn't it? 😅

However, I received notice from my web host that our server SSL certificate was due to expire on April 21st and that the dedicated server we ran was on its last legs in terms of both security and performance, and they wanted to renew the contract and get us moved quickly.

As it was costing me a lot of money per month to maintain this server (over £600) and the SSL cert was going to cost about the same for another year, this was the kick in the pants I needed just to bite the bullet and redo the site.

My original plan was to move it to Digital Ocean and let the old site run while I built the new one. However, when I looked into actually doing this, it proved to be a nightmare. The old site was actually running and relying on a mixture of PHP 4 and Laravel 4. Yes, PHP 4. The one originally released back in 2000! It was a mess. I couldn't even get it to run on PHP 7.4, let alone 8.0. And the MySQL monitor on my server was emailing me daily, reminding me it had reached end-of-life a few years ago! Laravel is now on version 10, and there is no easy upgrade path from 4 to 10. There are services like Laravel Shift, but the amount of work involved per jump in version was just crazy. Had I even been able to configure such an outdated server, it just wasn't safe to put such an unsecured version up to the public.

As a result of all of this, I decided to just start from scratch. In reality, it was more that I was forced to do as I didn't have much choice in the matter beyond spending lots of money. But at the same time, it felt really good. I could finally start with a clean slate and build the site I wanted to build without having to worry about legacy code. Of which there was an awful lot!

I went back to the original PSDs that Tom had designed for the site and started from there.

Look at that quaint shout-out for Flixel in the footer!

As you can imagine, CSS has come a long way in the nine years since the old site was built! Things that just weren't easily possible then can now be done natively, and this was both encouraging and exciting to play with. It's been a while since I sat down and really got my hands dirty with CSS, and I've enjoyed almost every minute of it. Especially the fun you can have with keyframe animations 🙂

I also decided to use Laravel 10 for the framework. I know this would have been an opportunity to move to something else entirely, maybe even something node based, but for me, Laravel just works. I'm comfortable with its structure, how to extend it, and all of the pretty awesome packages and services it has in its ecosystem. Plus, I wanted to actively keep away from any CSR based framework because the Phaser site isn't an app - it's a website. You navigate through the content, so I much prefer Server Side Rendering. If I add any apps to the Phaser site, then I'll employ a mixture of the two, but for me, a website should be a website, so that rules out the likes of React and Vue for my use case.

I'm also really happy with PHP. I know it's not the cool kid on the block anymore, but it's still a great language, and I enjoy working with it. I first encountered it when it was called PHP/FI back in 1997, and I've been using it ever since. Side note: I was actually the first ever Zend Certified Engineer in the UK 🙂 I've seen it grow and evolve over the years, and I'm really happy with the current state of it. I know it's not perfect, but then no language is. More importantly, using it (and Laravel) meant I would be saving time. I didn't have to learn a new language or framework. I could just get on with building the site - and as I knew there was a lot to be done, this felt sensible.

Why are Game Framework sites just so boring?

Here's an interesting question for you: Why is it that the Game Framework / Engine websites are just so utterly boring? I mean, really, really boring. Unity, Unreal, Godot, it doesn't really matter how massive they are in terms of dev reach; their sites are just so dull. Typically a video or two, some links to documentation, and maybe a blog or news listings. That's it. I mean, come on, we're game developers! We're supposed to be creative!

And when I say boring, I'm not talking about the site design, although that does often leave a lot to be desired. The design, in lots of cases, is pretty nice. I think what I'm trying to convey is that there's just no excitement or charm about the fact you're making games. It's all very serious and business-like. I mean, I get it, they're all huge companies, and they have to be professional, but still, it's a bit dull.

The other day I came across a copy of the book Dr C. Wacko's Miracle Guide to Designing and Programming Your Own Atari Computer Arcade Games (how's that for a snappy title?!). Published back in 1983, it took the reader on a cartoon-filled journey as they explored their 8-bit Atari computer and learned how to make games with it.

I mean, just look at that cover! Yes, it's clearly now very dated. A genuine time capsule of the era. Yet it's so much fun. And the book itself is just as fun. It's full of cartoons and illustrations, and it's just a joy to read.

Even though it dives into dealing with machine code, binary handling, and lots of other topics that reach far beyond the level you'd expect from the cartoon nature, it's still a fun and informative read. If you fancy learning to code an Atari 8-bit, then this is the book for you! My point here is that this wasn't uncommon back then. Programming, especially aimed at kids, used to be shown to be fun. It was something you could do and enjoy doing. It wasn't all serious and business-like.

I'm not saying that the Phaser site should be like this, but I do think there's a lot to be said for injecting a bit of fun into it. I mean, it's a site about making games, so it should be fun, right? I've always tried to incorporate a distinct personality into the Phaser branding, and I think I've succeeded in that.

This is helped in no small part by the great characters that Illija designed, and Tom bought to life. I want to go further with the new site. While I don't want to get in the way of finding actual content, I still want it to be fun to use and explore with little incidental animations and things to discover. I want it to be a site that you could just get lost in and enjoy doing so.

I know I won't achieve that entirely with the first version of the new site, but it's something the 3 of us are actively working towards. I'll be introducing new areas and features into the site in the coming months that help me realize that vision.

The amount of legacy content is insane, but important to preserve

I mentioned earlier that the old site had thousands of pages of legacy content. I wasn't kidding. I've been working on the new site for four weeks now, and I'm still not done migrating the old content over. It didn't help that it was spread over several different locations and in a variety of formats. I've had to write a lot of custom scripts to help me with this.

My vision was always that the Phaser site should start to consolidate everything Phaser in one single location, rather than having outdated docs on GitHub, the examples in the Labs, old content on the HTML 5 Game Devs Forum, blog posts split across Patreon and my own personal web site, and so on. I wanted to bring it all together, and that's what I'm doing.

I went right back to the very, very start to do this. I found the first releases of Phaser and the corresponding blog posts on my Photon Storm site. This was back when I didn't use the GitHub Releases feature, and Phaser wasn't on npm, so I literally had the find the correct commits and timestamps in the GitHub repo and then manually store these. There are nearly 19,000 commits. It took a while!

Lots of the content was in MarkDown, which is easy to deal with, but equally, things like the Phaser World newsletters were only available on the MadMimi site or in PDF. So again, I rolled out custom Laravel CLI scripts to help scrape this content to a format I can use.

The Examples area also needed a re-vamp. While I'm happy to direct people to the Labs for now, it's less than ideal and takes you away from the Phaser site. So it was important to me to get that content merged properly. I can still use Labs for quick tests, but I really wanted a way to browse this from the Phaser site - and include all of the previous content, too, like the v3.55 or Phaser 2 examples.

I also wanted a proper Playground, so you could hit a URL, have an editor, start coding, and save it, much like Codepen or JSFiddle. The old site had a variation of this with its Sandbox, but it was only for Phaser 2.6.2, and it was a bit clunky. I wanted something that was more modern and easier to use. So I built one. It's not quite ready yet, but it's getting there. Based on the Monaco Editor, which is the same one that VS Code uses, it's really nice to work with, and I'm enjoying building it. Having the ability to help users debug their code by pointing them at a URL is going to be a huge help, plus it'll be great to be able to 'fork' any of the examples into the Playground.

The cherry on the cake is to have a proper User Registration system in place on the new site.

We have never had this before, and it has always bugged me, just not enough to spend time doing anything about it 🙂 Now I have the opportunity; it's exactly what I'm going to add next. Finally, the ability to register on the site, have a profile, and a dashboard, and a way to track your progress through the examples and tutorials.

I'm really excited about this, and I think it's going to be a huge benefit to the community. I don't mind launching the new site without this feature, as it's important we get back online as soon as possible, but I'm going to try and get it done before I do.

In the future, my plan is to stop using Patreon and move everything over to the Phaser user accounts instead. Patreon is just so difficult, it has the most horrible post-editing experience you could ever imagine, and it makes it actively difficult to use. When I'm writing a post, such as this one, if I insert an image, the editor scrolls back to the top of the page! This gets tiresome if you have a few images to insert in a row. It can't insert code, the link insertion is a mess (often, when you paste in the URL, it instantly clears it!), and I just really, really want to move away from it.

We are a way away from this yet, so please don't cancel your Patreon memberships just yet! I'll give you plenty of heads-up when the time comes, but I simply want to make it easy for me to give back to those of you who support Phaser financially, and Patreon is a real blocker, trying its absolute best to make it hard for me to do this. I need to be able to create exclusive bits of code for you all, hit a button, and bang - you've got them. Not have to upload them somewhere and then fight with the interface from hell 😣

So really, that's all I can talk about for now. It's been a month of hard work, with my head deep inside modern CSS and Laravel, and I've loved (almost!) every minute of it. It's being creative in an entirely different way. I'm not making games, but I am building a site that will help people make games, and that's just as rewarding. With all of this in place, I honestly feel like we'll be ready to jump in to Phaser 4 and actually talk about it in a single unified location. About time, too!