Celeste
Maddy Thorson and Noel Berry's 2018 precision platformer.
Facts
- Released
- 2018
- Genre
- Platformer
- Platforms
- Windows, macOS, Linux, Nintendo Switch, PlayStation 4, Xbox One
- Developer
- Maddy Makes Games
- Engine
- Monocle (C#, on XNA / FNA / MonoGame)
- Series
- Celeste
- Code
- Source release by Maddy Thorson and Noel Berry
- Evidence
- Code (10)
Developer (1)
Dev blog (1) - Sources
- 3
On this page
Maddy Thorson and Noel Berry released Celeste’s player class under the MIT license, “as a learning resource and for general interest”. The release includes the built-in C# port of Celeste Classic. The license excludes the game and its assets.
All of Madeline’s movement sits in one file, Player.cs, which the developers call a conscious choice to keep its order of operations readable1. The release omits the engine classes it calls (Actor, Engine, and Calc). Some details below rest instead on the public Monocle source and Thorson’s physics write-up.
#Jumping
A jump sets the vertical speed to -105 px/s2,3. For variable jump height, holding jump keeps that speed for up to 0.2 s4,5, then halves gravity near the apex6.
Gravity is 900 px/s²7, with a normal fall limit of 160 px/s8. Units are pixels per second, multiplied by the time step of each update9. Positions are whole pixels, with the fraction kept in a subpixel remainder10.
Coyote time, the grace window after leaving a ledge, is 0.1 s11,12.
Mechanics
| Mechanic | Kind | How |
|---|---|---|
| Variable jump height | Hold timer | speed held for a timer, plus half gravity near the apex |
| Coyote time | Grace timer | JumpGraceTime, a float timer of about 5 or 6 frames |
| Jump | One speed | every jump takes off at the same speed |
| Air control | Damped | steering takes 0.65 of the ground's rates, and released, Madeline's speed falls toward 0 |
| Gravity | Lighter while held | one gravity, halved near the apex while jump is held |
| Running | Momentum | one rate to speed up, turn, and stop |
Every claim about this game, by concept (41)
References
- ^DeveloperNoelFB/CelesteReadme.md 16
How we know
The developers chose one large file of long methods for the player's behavior, so its tightly ordered logic reads in sequence.
In a platformer like Celeste, the player behavior code needs to be very tightly ordered and tuned, and this style of code was a conscious choice to fit the project and team.
Source/Player/Readme.md#L16 · upstream ↗ - ^CodeNoelFB/CelestePlayer.cs 49
How we know
A normal jump sets Madeline's vertical speed to the jump speed, −105 px/s.
49 private const float JumpSpeed = -105f;Source/Player/Player.cs line 49 at 1b0ce45 · upstream ↗ - ^CodeNoelFB/CelestePlayer.cs 1660–1673
How we know
The jump function sets vertical speed to the jump speed plus any platform lift boost, saves it as the variable-jump speed, starts the variable-jump timer at the variable-jump time, and zeroes the grace timer.
1663 jumpGraceTimer = 0; 1664 varJumpTimer = VarJumpTime; ⋮ 1671 Speed.Y = JumpSpeed; 1672 Speed += LiftBoost; 1673 varJumpSpeed = Speed.Y;
Source/Player/Player.cs lines 1660–1673 at 1b0ce45 · upstream ↗ - ^CodeNoelFB/CelestePlayer.cs 51
How we know
The variable-jump time, how long holding jump can keep the take-off speed, is 0.2 s.
51 private const float VarJumpTime = .2f;Source/Player/Player.cs line 51 at 1b0ce45 · upstream ↗ - ^CodeNoelFB/CelestePlayer.cs 2960–2966
How we know
While the variable-jump timer runs, holding jump keeps Madeline rising no slower than the speed saved at take-off, canceling gravity; releasing zeroes the timer and cuts no speed.
2960 //Variable Jumping 2961 if (varJumpTimer > 0) ⋮ 2963 if (AutoJump || Input.Jump.Check) 2964 Speed.Y = Math.Min(Speed.Y, varJumpSpeed); 2965 else 2966 varJumpTimer = 0;
Source/Player/Player.cs lines 2960–2966 at 1b0ce45 · upstream ↗ - ^CodeNoelFB/CelestePlayer.cs 2952
How we know
Gravity halves while the absolute vertical speed is under the half-gravity threshold and jump is held (or auto-jump is on), so a held jump hangs at the top.
2952 float mult = (Math.Abs(Speed.Y) < HalfGravThreshold && (Input.Jump.Check || AutoJump)) ? .5f : 1f;Source/Player/Player.cs line 2952 at 1b0ce45 · upstream ↗ - ^CodeNoelFB/CelestePlayer.cs 24, 2957
How we know
Celeste's gravity is 900 px/s²; each airborne update moves vertical speed toward the fall limit by the gravity times a multiplier times the update's time step.
24 private const float Gravity = 900f;Source/Player/Player.cs line 24 at 1b0ce45 · upstream ↗ 2957 Speed.Y = Calc.Approach(Speed.Y, max, Gravity * mult * Engine.DeltaTime);Source/Player/Player.cs line 2957 at 1b0ce45 · upstream ↗ - ^CodeNoelFB/CelestePlayer.cs 23, 2760–2763
How we know
The normal limit on falling speed is 160 px/s; entering the normal state starts the current limit there and gravity approaches it.
23 public const float MaxFall = 160f;Source/Player/Player.cs line 23 at 1b0ce45 · upstream ↗ 2762 maxFall = MaxFall;Source/Player/Player.cs lines 2760–2763 at 1b0ce45 · upstream ↗ - ^CodeNoelFB/Celeste · JamesMcMahon/monocle-enginePlayer.cs 742–744, 908, 934–935, 322–323; Entity.cs 95–98
How we know
In each update, the player's update ticks both jump timers, the state machine runs the normal state's update (gravity, hold, and new jump), and then the vertical move applies the vertical speed times the time step.
742 //Var Jump 743 if (varJumpTimer > 0) 744 varJumpTimer -= Engine.DeltaTime;
Source/Player/Player.cs lines 742–744 at 1b0ce45 · upstream ↗ 908 base.Update();Source/Player/Player.cs line 908 at 1b0ce45 · upstream ↗ 935 MoveV(Speed.Y * Engine.DeltaTime, onCollideV);Source/Player/Player.cs lines 934–935 at 1b0ce45 · upstream ↗ - ^Dev blogThorson 2020 · NoelFB/CelestePlayer.cs 935
How we know
Celeste's actors sit on whole pixels; the vertical move adds the float distance to a remainder, moves by its rounded value, and keeps the fraction.
xRemainder += amount; int move = Round(xRemainder); if (move != 0) { xRemainder -= move;
Actor Basics · archived copy ↗ 935 MoveV(Speed.Y * Engine.DeltaTime, onCollideV);Source/Player/Player.cs line 935 at 1b0ce45 · upstream ↗ - ^CodeNoelFB/CelestePlayer.cs 48
How we know
The jump grace time, Celeste's coyote time, is 0.1 s.
48 private const float JumpGraceTime = 0.1f;Source/Player/Player.cs line 48 at 1b0ce45 · upstream ↗ - ^CodeNoelFB/CelestePlayer.cs 713–720, 2970–2975
How we know
Grounded updates refill the jump grace timer; airborne ones subtract the update's time step before the normal state's update, which jumps on a press while it is above zero.
713 //Jump Grace 714 if (onGround) ⋮ 717 jumpGraceTimer = JumpGraceTime; ⋮ 719 else if (jumpGraceTimer > 0) 720 jumpGraceTimer -= Engine.DeltaTime;
Source/Player/Player.cs lines 713–720 at 1b0ce45 · upstream ↗ 2970 if (Input.Jump.Pressed) ⋮ 2973 if (jumpGraceTimer > 0) ⋮ 2975 Jump();
Source/Player/Player.cs lines 2970–2975 at 1b0ce45 · upstream ↗
Sources
Code
- Thorson, Maddy and Noel Berry. 2021. “Celeste: released class files (NoelFB/Celeste).” Commit 1b0ce45. NoelFB/Celeste @ 1b0ce45 · licence, all uses
- Thorson, Maddy. 2018. “Monocle Engine (public source, GitHub mirror JamesMcMahon/monocle-engine).” Commit 759c15a. JamesMcMahon/monocle-engine @ 759c15a · licence, all uses
Primary
- Thorson, Maddy. 2020. “Celeste and TowerFall Physics.” Medium. original · archived · licence, all uses