Celeste & TowerFall Physics
68 points by FedericoSchonborn
68 points by FedericoSchonborn
TowerFall and Celeste probably have the best platforming of any 2-D video game I’ve ever played. And as a non-game-developer who reads a lot of Lobsters, I am tickled that two of the best video games of the present century were built in a GCed language with nary a data-oriented architecture nor an entity-component system in sight. And they run at 60fps on a toaster Nintendo Switch!
To be fair, those more complex systems are designed to allow extremely dynamic and custom gameplay with possibly very heavy graphics and simulation requirements the entire way through, while achieving maximum or at least decent performance.
Celeste and Towerfall are a good example of doing as much as possible with a very restricted feature set (which is basically what makes them so great), and quite lowfi graphics (while still looking awesome).
Also, every Unity game uses C#, and Unreal also has a GC even through it uses C++.
Sorry for being so negative. I do agree with you though. They made a sweet game, not a full on game engine, which is to be praised!
I have no doubt the said techniques are valuable in a context, my bemusement is not that i think we have evidence they are useless but that they generate a fair amount of Content that reaches my eyeballs. There’s a lot of allusion to game performance specifically in that setting, implying that one or another of these things is the sine qua non of any performant and well-engineered video game. So the contrast is satisfying.
I feel vindicated reading this article. In high school I made a platformer in C#, and I remember having so much trouble trying to get the collisions right ("how hard could it be to make platformer physics"). I eventually did what I considered to be conceding defeat, and moved the player one pixel at a time, and when a surface was reached, checked if there were any collisions when moving one pixel in each of the cardinal directions to figure out other properties like if the player is standing on top of something. It basically solved all my problems with bad collisions and clipping through walls etc.
Turns out my favourite platformer of all time Celeste does basically exactly the same thing! Hahaha
very interesting! it's neat how the "kind" of game, where both celeste and towerfall have small levels, and a need for "perfect" control of the character to feel "fair" lands on a solution that I would never have thought of myself: lock positions on a pixel-integer level, move X and Y separately, loop over all objects... A great read, and something I'll keep in mind the next time I want to write a platformer :)
I first read this post last year - I think this is probably one of the most important blog posts I've read as it supplanted almost all the previous knowledge I'd gained from 2D collision tutorials. There's still a lot more you can do (for example, this post doesn't touch on slopes) but for many platformers this is really all you need. The level of control here is nicer than needing to wrangle together custom physics in Unity or Godot.
The source code for Celeste's player class, the original PICO-8 game, and its sequel make for good companions to this writeup, since they show these decisions with the context of lots of gameplay code, something that's relatively underdiscussed when it comes to collision handling.