Fox Studios logo Fox StudiosGame projects, devlogs and Scratch builds
Devlogs

Fixing Godot Frame Rate Drops in Our Platformer, a Devlog

Our platformer ran at a smooth 144 frames per second on my desktop and fell to 38 on a playtester's four year old laptop, right in the busiest level.

A developer at a desk comparing a 2D platformer running on an old laptop with a performance graph on a large monitor

Our platformer ran at a smooth 144 frames per second on my desktop and fell to 38 on a playtester's four year old laptop, right in the busiest level. Godot frame rate drops like that are rarely one big mistake; ours turned out to be four small ones stacked together, and this devlog walks through how we found each one and what we changed.

The game is a 2D precision platformer built in Godot 4.3, with about 40 levels, collectible gems, moving platforms and a lot of particle effects we were proud of. The laptop in question had integrated graphics and 8 GB of RAM, which is exactly the kind of machine many of our players own. If it stutters there, it stutters for a big slice of the audience.

Measuring Godot frame rate drops before touching code

My first instinct was to start deleting effects. Mira talked me out of it, and she was right. Guessing wastes days. Godot ships with tools that tell you where the time goes, and we used three of them.

  • The Monitors tab in the debugger panel. We watched FPS, process time, physics time, draw calls and object count while playing level 27, the worst offender.
  • The Profiler tab. Start it, play for 30 seconds, stop it, and sort functions by self time. This shows which scripts eat the frame.
  • The Visual Profiler, which splits GPU time into canvas, lighting and post-processing.

We ran everything as an exported release build on the laptop itself, not in the editor. The editor adds its own overhead, and a debug build of GDScript runs noticeably slower than a release export. Our numbers in the editor were about 20 percent worse than the real build, which would have sent us chasing problems that players never see.

The baseline on level 27: 38 fps average, with spikes down to 22 whenever the player collected a gem cluster. Process time sat around 11 ms per frame, and draw calls hovered near 900.

What broke: the four culprits

1. Every gem was searching for the player every frame

Each of the 260 gems in the level ran this in its _process function: look up the player node through the scene tree group, measure the distance, and start a magnet animation if close. A group lookup is cheap once. Done 260 times every frame, it added up to nearly 4 ms.

The fix was to store the player reference once in _ready and replace the distance check with an Area2D that fires a signal when the player enters. Gems now do nothing at all until the player is near. Process time dropped by 3.6 ms on its own.

2. Off-screen enemies kept thinking

Enemies far off-screen were still running their patrol logic and physics. We added a VisibleOnScreenEnabler2D to each enemy scene, which pauses processing when the enemy leaves the camera view. For patrol enemies that need to stay in position, we kept their physics running but paused their animation and particle children.

3. Particle effects on integrated graphics

The gem pickup used a GPUParticles2D burst of 120 particles. Collect a cluster of eight gems and you have nearly a thousand particles spawning in one frame, plus the shader compile the first time each effect appears. That compile caused the worst spikes.

We cut each burst to 30 particles with slightly bigger sprites (nobody in later testing noticed), switched the pickup effect to CPUParticles2D, which behaves more predictably on weak integrated chips, and added a hidden warm-up scene that plays every effect once during the level load screen so shaders compile before gameplay starts.

4. Lights with shadows we could not even see

Level 27 had 14 PointLight2D nodes with shadows enabled, mostly torches. Most of them cast shadows onto walls where no occluder sat close enough to show anything. Turning shadows off on 11 of them cut GPU time by roughly 3 ms in the Visual Profiler, and the level looked the same in side-by-side screenshots.

Results after one week of fixes

ChangeAverage fps on test laptopWorst spike
Baseline3822
Gem signals instead of per-frame checks5127
Off-screen enemies paused5630
Smaller particle bursts and shader warm-up5852
Shadows off on 11 lights60 (capped by vsync)55

The spike fix mattered more than the average. Players forgive 50 fps that stays steady. They do not forgive a hitch right as they line up a jump, and in a precision platformer that hitch means a death that feels unfair.

Push back on the advice to rewrite it in C#

When I posted our early numbers in a community chat, three people told us to port the gameplay scripts to C#. I understand the reasoning: C# is faster than GDScript for heavy loops. But none of our four problems were about raw script speed. They were about doing work that did not need to happen at all. A C# version of a gem that searches for the player every frame is still a gem searching for the player every frame.

Rewriting would have cost us two to three weeks and introduced new bugs right before our demo build. The profiler pointed at design choices, and fixing those took five working days. If your profiler shows one tight loop eating most of the frame, such as pathfinding over a large grid, moving that piece to C# or a GDExtension can make sense. Start with the measurement, not the language.

What we changed in our process

The technical fixes were the easy part. The bigger lesson was that we only tested on fast machines for six months. We now keep a cheap laptop on the shelf as our official minimum spec, and every Friday someone plays the newest level on it for 10 minutes with the Monitors tab open. If average fps drops below 55 or any spike dips under 45, it goes on the bug list for the next sprint.

We also write a short performance note in our devlog each month, the same way we record scope changes. Writing it down keeps us honest, a habit we described in keeping a devlog that actually helps you finish. And the laptop test came from a playtester, which is another argument for sharing your game early with people whose hardware is nothing like yours.

More progress notes from our projects live in the devlogs section.

Frequently asked questions

Why is my Godot game lagging on some computers but not others?

Integrated graphics, fewer CPU cores and slower memory expose costs that a fast desktop hides. Particle effects, lights with shadows and per-frame script work are the usual suspects. Profile on the slower machine with an exported build to see which one applies.

How do I check FPS in Godot?

Open the Debugger panel while the game runs and use the Monitors tab to graph FPS, process time and draw calls. In code, Engine.get_frames_per_second() returns the current value, which you can show in a small debug label. Test in an exported release build for accurate numbers.

Does GDScript cause frame rate drops?

GDScript is slower than C# for heavy math, but it is rarely the main cause in small 2D games. Most drops come from running too much code every frame, such as lookups and checks that could use signals instead. Fix those patterns first and measure again before switching languages.

RD
Reyansh Dole

Reyansh started making small games as a teenager and now writes the devlogs and tutorials here, focused on how beginners actually ship a first project.

More posts by Reyansh

More in Devlogs

01doorganico 084goad 3hot8 4465456 after5internprogram ahandfulofblessings ahmadpc ahomcybersecurity allodialresources annodex antiquesandperiodcollectibles aotc asianworldkashmir beedlectrics bloggertemplatefree bluefeatheragency bodyweightsolution campaign08blog carfixadvisor catstreetcollective cbstvsports cnfanspurchasing committeeof500yearsofdignityandresistance covertopsdjs cs-kaiyuangame cuestacomunicaciontotal cxoutlet dancebetgame deskgearhub destinyvillastay detectmagazine di33 diamondsteelbuildings donmo dyanadropship emarsysfinance emimattl escapechan eskitarih evautoplay everythingweddings-orlando farmzone feedviewerapp gamevui123 gleasongrade greetingsday hacklabasu haskell iw-kaiyun jagoanproperti jilidskripsi joltbusinessfinance juegodepokergratis juegospucca kaeru-festival latestmehndidesigns lestanzediottaviano litemagazines localcommunityhero lustrsazan mariashebets menswheels newwebstechs1 nikkit ootheday oxigenvpn plurfitness prefetial probudgetcarpetcleaning psychicmrsmartin pyaten qvantor rejoignezlogis rexzbot riselayouts ruchin rwxqsgd5 sakaltime shibiaowang shop-bot skrtips spotlesshaven strcoding tetapatrium topselller uneplanteartificielle vipertechcr webtech1223411 wo-kygaming yamaha-mekar yeknava yoybuysheets zenunwa yamaha-mekar jilidskripsi ankertoto ankertoto ankertoto