Queries & Quotes: Thoughts on HTML5
Heya everyone!
I felt like writing today, so I've decided to start a new series: Queries and Quotes! Whenever I get a minute, I'll answer questions you leave in the comments and do a bit of a deep-dive into how certain systems work, and other general technical details on the game.
For the first post, I'm going with a question I get asked a lot: Why does Club Penguin Zero use Flash instead of HTML5?
#1: Stick To What You Know
Admittedly, this is the weakest reason of the bunch. Phaser, (the engine Yukon uses, which is the open-source HTML5 CPPS software the communtiy uses) while similar to ActionScript in many regards, is still a completely separate language. Additionally, it's very obscure, especially in comparison to Flash, the software that ran the Internet for like 20 years, thus making the learning curve that much harder.
Since I am currently the only main developer, switching at this stage would mean a full stop to Zero's development (no more parties, catalogues, etc.) for an indeterminate amount of time in order to convert everything, and had I begun prior to launch, we would have had an even worse time actually releasing, and that's not even taking into account the current state of functionality of Yukon.
#2: The Current State of Functionality of Yukon
While Comfy (the sole developer of Yukon) is fantastic, he — like all of us — has a life. As such, progress on Yukon has been very slow since it began in 2021. Of course, it's leaps and bounds ahead of where it once was, but it's still missing a number of core features, such as stamps, the newspaper, a number of regular rooms, multiplayer minigames like Dance Contest or the elemental Card-Jitsus, etc.
And given the double-whammy of the rest of the HTML5 community not seeming particularly eager to contribute their own reconstructions back to main Yukon, and Comfy being notoriously slow to accept pull requests, I do not anticipate this state changing very much very soon. (As of writing, the last commit was last year, and there are 8 pull requests open ranging from last year to 2 years ago.)
Houdini, (the server emulator that all Flash servers today use) on the other hand, is feature-complete. Every aspect of the original game has been reimplemented, albeit with varying levels of accuracy. Thus, the only things I have to make are the brand-new systems and features.
So, with that in mind, I would have to spend a lot of time reimplementing the features everyone just expects to be there, instead of the cool new stuff you all really want to see. And to make matters worse, that job is about 4x harder.
#3: The Development Process
Creating anything in Yukon is a lot harder than the same thing in Flash. The workflow to edit a room in Flash consists of a three-step process: Decompile the file with a decompiler like ASV or JPEXS, (also known as FFDEC) bring it into Flash and make whatever changes you want to make, then export it for the game.
For that same room in Yukon, you must:
*It's worth noting that there are tools to make parts of these processes easier. For example, to my knowledge all three major servers have a room exporter that automatically exports everything from the Flash file. Unfortunately, none of these tools are public.
*Also worth noting that I have not personally worked with Yukon, this list was compiled both from my own knowledge obtained through osmosis and the current publicly-available tutorial, which shows a simple conversion of an original room with no changes.
So as you can see, this does not sound particularly appealing for me. With Flash, once everything's mostly designed, I can put together a party in an afternoon. (I have on a number of occasions. Lighthouse Grand Opening, anyone?) The simple development of a room takes around an hour on average, not counting the time it takes to actually design it, and also not factoring in the number of additional animations and sound effects that are so core to Zero's design philosophy. And speaking of Zero's design philosophy, there are also some other elements that need to be considered.
#4: Other Elements That Need To Be Considered
If you've ever asked me this question personally, one of the stock answers I give is that the day/night cycle isn't possible in HTML5. Of course, this isn't entirely true — anything is possible with enough effort and corner-cutting — but to make it easy to design and develop for, the methods that I've used when creating it are simply not translatable for Yukon.
For example, to make the objects change colour to mark the different times of day (becoming dark and bluer at night, for example) in Flash, I used Color.setTransform), using the GreenSock library.
Phaser does actually have something very similar, ColorMatrixes! However, they come with the caveat of slowing the game down immensely when there's more than 10-20 of them in a room, per a friend of mine when they played around a little while back.
(For reference, the default Town has 33 separate objects listed that need to be coloured. The Town is on the lower end of outdoor rooms, and that's not taking into account the clouds and sky, which use different methods.)
Another important aspect to consider, the fundamental differences between Flash and HTML5.
#5: The Fundamental Differences Between Flash And HTML5
Flash and HTML5 are, at their cores, very different technologies. Flash is a program that runs on your computer, and injected into your website to be displayed. HTML5 runs entirely within the browser.
One of the many frustrations of web developers around the world is when the browser overlords disagree. There are three main web browsers: Google's Chrome, Apple's Safari, and Mozilla's Firefox. (Just about everything else you use is almost certainly based on Chromium, or the base layer of Google Chrome.) When these companies disagree on how a certain feature should be added, haven't gotten around to building something into their own browser, or just handle things differently, the game can break. For example, I can remember a time on another server where a WebM video file was used to help loading times on a large animation. The video used transparency, because penguins could walk around it. It did not display as transparent on Firefox. I don't actually recall for certain what we ended up going with in that scenario, but I believe it was swapped to an MP4, which was heavier and increased the load time. Fonts are also often particularly annoying across browsers for seemingly no reason.
Flash bypasses these issues because it's a singular program running on your computer itself, that the browser then displays, meaning the browser has no control over what Flash shows at all. This makes debugging and fixing problems far easier, and therefore faster.
Now let's say theoretically, if Yukon was as feature-complete as Houdini the process to convert a room from Flash to HTML5 was instant and perfect, and browsers were actually a good piece of technology, would I use HTML5 then?
#6: Probably Not, It Looks Awful
This is admittedly a bit more of a nitpick on my part, but we're at the utopia hypothetical stage anyways, so I don't care! Club Penguin was programmed, drawn, and animated in 24 frames-per-second. Most HTML5 servers run at 60 frames. This causes a visual disconnect where the penguin sprite is moving at 60 frames-per-second but is still animating at 24, which to me just looks off.
Penguin Origins' Classic FPS setting does help this and is quite possibly the greatest feature ever implemented in an HTML5 server, but it's also not perfect. (If I recall correctly, it actually runs at 30 frames because for some reason 24 makes it run very slowly.)
Also, due to the nature of raster vs. vector, you cannot scale HTML5 like you can with Flash, so it can look pixelated on larger displays. And finally, there's just a lot of little quirks in how Club Penguin runs that HTML5 doesn't have, which gives me the creeps. (PERSONAL NOTE: If you ever get to the point where you can diagnose an issue in a game based on half-second loading times, please go outside. Learn from my mistakes. I beg of you.)
Please Wrap It Up
To conclude, the question essentially boils down to my belief that neither Yukon nor HTML5 as a technology are ready to support something at the scale of Club Penguin. I want to make it clear that I have nothing but respect for the all of the people on the various HTML5 servers that have to deal with Phaser on a daily basis. The technical accomplishments on the other side of the digital ocean are incredibly impressive. I just think my way is better for how things work around here.
Now then, if you have any questions relating to this post, leave them in the comments, and I'll do my best to answer them. If you have a question about some other technical element behind-the-scenes, leave a comment and it might just be featured in the next post!
That's all from me, Waddle On!
Comments
Want to leave a comment?
Please log in to share your thoughts with the community. Comments are moderated and must be approved.
No comments yet. Be the first to share your thoughts!