itch.io is community of indie game creators and players

Devlogs

The Wait is Finally Over!

Sendit Soccer
A browser game made in HTML5

This is, essentially, the postmortem to a rewrite of a game prototype.

After wrestling a few-hundred-too-many times with Phaser's lack of a standardized programming pattern (you have to use three patterns to instantiate some objects -- and they don't see the issue if you complain about it) and poor documentation, I went looking for a new engine.  Phaser is what happens when you have too many cooks and not enough oversight in open source (but light-years better than with Flame, I might add, just to poke that Flame beast once more and plug Pogo instead).  Anyway... I landed on Godot because it builds easily to WebAssembly (important) and gives me WebRTC as well.  I thought Godot would also give me a Firebase RTDB plugin but, well, I ended up writing my own Godot Firebase Lite plugin -- which is another story you can find elsewhere.

Now, nearly a year later, I have finally finished the Sendit Soccer rewrite in Godot.  Of course, I didn't work on this full time, but it was still maybe three or four months of work.  Was it worth the switch to Godot?  I think maybe so... but it's really hard to call it right now.  While I don't regret leaving Phaser behind, Godot was such a fight to get the game port working, I can't be sure I'll ever get back the time lost between Phaser and Godot.  Also, the Godot build came out at about 6 times larger than the Phaser build (the minimal Godot custom-web-engine build being about 8 times larger than the sum of the packages I used with Phaser).  If itch.io would implement gzip support for HTML games, I could compress Godot's wasm file small enough to not worry about the size increase.  But, alas, I can't, and I worry about the 9.5 MB overhead being too much.  Too much for my liking, anyway, for a browser game.  Then again, hey, it could have been worse.  It could have been Unity's wasm engine (which, I think, is self-zipped to not make it seem so fat... luckies).

Aside from the Firebase disappointment and subsequent adventure ("Yay! Godot users now have a better Firebase option."), the biggest slice of work with porting to Godot was adapting to their absolutely crazy kinematic character controller.  This was so insanely-maddening of a physics controller it led to me blogging about it here: The Annoying Quirks of Godot’s Kinematic Bodies.  That was definitely the worst thing about Godot... and avoidable if you ignore kinematics and go straight to dynamic rigidbodies (and maybe what I should have done with Sendit Soccer, if I could guess the performance impact of it in a browser).

After that, Godot's inability to refactor classes without throwing dependency errors all over the place, also wasted a stupid amount of time.  You see, Godot won't re-evaluate such class errors unless you reload Godot and/or the project (or you get very lucky with some super-secret mojo-like editor actions).  It should be relatively easy to add more class-evaluation triggers to mitigate most of this... but reading the issue discussions reveals that nobody cares to even try to fix the worst parts of this... because they can't also fix the edge complaints as well.  Whaaaaat!!!!!  They're waiting for a hopeful class system rewrite in Godot 4 instead -- or some excuse like that.  Always waiting for a better Godot.  Sigh.

On the positive side, this rewrite brought about a total rethink on the lobby code and the result puts it in a much better place for filling out the needed features there.  That's a pretty big win.  Also, the annoyances with the kinematics forced me to redo the collisions in a much-more-deliberate/less-lazy way.  As much of a pain as that was (and still is) it should bring about much better performance -- something that might prove critical with a lot of players on the field in a browser-as-a-server (BaaS?) product.  How overall performance compares between Godot and Phaser, I don't know.  I don't immediately know how to test that myself and I don't care to look it up to try right now.  Maybe I just don't want to know.  I can admit that.  I am curious, regardless, in spite of myself.

One other perk with Godot is that it gives an easy route to native builds for Windows and Linux.  (No apologies, but Mac has become too difficult to bother supporting anymore as an indie dev -- use Safari.)

Overall, I'm happy with Godot... but it sure can be a hard beast to love at times.  Hard to contribute to as well with it's 5,491 open issues, onerous reporting expectations, and jerks aplenty.  Expect most things to be swept under the rug.  Perhaps more the fault of open-source circumstance than those involved (aside from the jerks).  For free, however, it's outstanding and I'm hooked!  See ya, Unity.

Photo credit: Tambako The Jaguar - Flickr

Updates

As to the game, this rewrite doesn't bring much in the way of new features.  But, just because, I did add a few.  Godot also helped me break many things.  I eventually worked around most of those, but not all.

I upped the version to 0.3.0 mostly because of the rewrite.  Not features.  Features, however, should start coming quicker now that this big lift is done.

Added

  • Sniper Mode!  In this mode -- which defaults to "on" because, well, what did you think "send it" meant? -- when you "send it," the ball essentially becomes a bullet and knocks down anyone in its way.  It will go through them as well (except for goalkeepers -- it should bounce off the goalkeeper while knocking them down [when I get around to making goalkeepers]).
  • Gamepads are now supported (as well as browsers can support them).
  • Better disconnect handling and notification... maybe.
  • Some super-secret surprise I'll let you discover.

Changed

  • Much nicer menus (with back buttons even!).  "Thanks, Godot, you kicked Unity's butt on this front!"
  • Godot's scripting performance is also somehow really bad compared to JavaScript, so palettizing the sprites takes forever and a day now... so I had to put up a progress bar for it.  You would think that after export to JS and Wasm, this would catch up with JS but... whatever.  I think it is something about Godot's dictionaries.  I should try dumping them for more arrays.
  • Fewer characters allowed for player names due to using a raster font atlas instead of TTFs.  Latin extensions for all of Europe should be included.  A few other interesting characters included.  I may try to add Hangul and the kana next.  We'll see.
  • 22 players max changed to 24 max (just because).
  • Minor art tweaks.

Fixed

  • Certain characters in the name field and/or certain names were bombing connections.
  • Something about tackling.  I forget what exactly.  It was a long haul.

Broke

  • I just noticed (because it only happens on itch.io, not locally) the keyboard doesn't work in full-screen mode UNTIL YOU SCROLL THE MOUSE.  Very weird, Godot.  Very weird.
  • The game window steals all the browser keys, failing to pass them through (and this Godot post was entirely unhelpful regarding that).  This makes sense given how the engine works... but the workaround, if any, should be mentioned somewhere.

TODO next... maybe

  • Harden the networking code to prevent short disconnects from killing the game.
  • Allow a return to the lobby/room.
  • Oh, yeah, update the CHANGELOG.

Files

  • sendit-soccer.zip 2 MB
    Nov 18, 2021
Read comments (2)