Why Underwater Browser Games Run Well on Old Devices
Vector shapes, one canvas, no asset downloads. The specific reasons a good browser game runs where a heavier one stutters.
A well-built canvas game will run at full frame rate on a phone from six years ago. A badly built one will stutter on a current laptop. The difference is almost never the game's complexity — it is a handful of specific decisions about what gets drawn, how, and how often.
This article covers those decisions, why underwater games in particular tend to be light, and what to do when one of them does stutter on your device.
The single biggest factor: no assets
Every submarine, fish, bubble, coral and light shaft on this site is drawn — a sequence of ellipses, arcs, lines and gradients issued to the canvas every frame. Nothing is an image file.
The consequences are larger than they sound:
Nothing to download. A game page here totals a few hundred kilobytes including three stylesheets and all its JavaScript, with no image transfers at all. Compare that with a game streaming sprite sheets, which measures in megabytes.
Nothing to decode. Image decoding is real work, and on a phone it happens on a busy main thread. Vector drawing skips it entirely.
Nothing to hold in memory. A large sprite atlas occupies memory for the whole session. A drawing routine occupies none.
No resolution problem. Shapes are sharp at any device pixel ratio without shipping multiple sizes.
The cost is per-frame CPU: you are re-issuing those drawing calls sixty times a second. In practice a stylised fish is about a dozen calls and a whole frame of one of these games is a few hundred, which a browser handles comfortably. The trade is overwhelmingly favourable for flat vector art.
Device pixel ratio, capped
The second-biggest factor, and the one most often got wrong.
A canvas has two sizes: its CSS size (how large it appears) and its internal pixel buffer (how many pixels it actually contains). On a high-density display these differ, and if the buffer is not scaled to match, the result is an upscaled, blurry image.
So you scale the buffer by the device pixel ratio. But that ratio can be 3 or higher on modern phones, and the pixel count scales with its square — a 3× buffer is nine times the pixels of a 1× one. That is nine times the fill cost per frame.
The games here cap the ratio at 2. On flat vector art the difference between 2× and 3× is close to invisible, and the performance difference is not. It is a deliberate trade and it is why these games stay smooth on high-density phones.
Frame-rate independence
Not a performance optimisation exactly, but the thing that makes performance variation tolerable.
Every movement in these games is expressed in pixels per second and multiplied by the time elapsed since the previous frame. Without that, a game tuned at 60fps runs at double speed on a 120Hz display and in slow motion on a struggling phone.
There is a subtlety: the delta is clamped, here at 0.05 seconds. If a frame takes longer than that — a backgrounded tab waking, a phone stalling — the game pretends only 50 milliseconds passed. Without the clamp, a one-second stall would move every object a full second's worth of distance in a single step, straight through walls.
The practical result is that a device dropping to 30fps plays the same game slightly less smoothly, rather than a different and broken one.
Keeping text off the canvas
A structural decision with a performance component: the score bar above each stage is real HTML, not text drawn into the canvas.
Canvas text has to be re-rasterised every frame. HTML text is composited by the browser and only touched when its content changes — and updating it only when the value actually changes costs essentially nothing.
The accessibility benefits are larger than the performance ones (HTML text scales with browser zoom, can be read by a screen reader, and can be selected), but on a slow device redrawing a dozen text labels sixty times a second is measurable work to avoid.
Avoiding work per frame
Three habits that keep a render loop cheap, visible in the code of any well-built canvas game.
Reuse objects instead of creating them. Particles, bubbles and spawned items are recycled or drawn from pooled arrays rather than allocated fresh each frame. Allocation itself is fast; the garbage collection that follows is what causes intermittent stutter.
Compare squared distances. Collision checks compare the squared distance between centres against the squared sum of radii, avoiding a square root. A trivial saving repeated thousands of times a second stops being trivial.
Do not draw what is off screen. Objects that have scrolled past are removed from their arrays rather than drawn and clipped.
None of these is clever. All of them are the difference between a game that holds 60fps and one that does not.
Pausing when hidden
The browser stops scheduling animation frames for hidden pages, so a backgrounded game is already not consuming much. But responding to that explicitly matters.
These games detect the page becoming hidden and pause. That avoids the enormous time delta on return (which the clamp would otherwise absorb as a frozen moment), and it means switching tabs does not cost you a run. Both are worth having; the second is what players notice.
Layout stability
Performance is not only frame rate. A page that appears fast and then shifts around as things load feels worse than one that takes marginally longer and arrives complete.
Two measures prevent that. The game stage has a reserved aspect ratio in CSS, so the space is held before the canvas initialises and nothing jumps. And every advertising placeholder has a reserved minimum height, so adding a unit later will not shift the article underneath it.
Google's Web Vitals documentation, linked at the foot of this page, is the standard reference if you want to measure this properly on your own pages.
When a game does stutter
In order of likelihood.
Other tabs. Canvas rendering shares the main thread with everything else the browser is doing. A dozen open tabs running their own scripts is the most common cause and the easiest fix.
Thermal throttling. If performance degrades after ten minutes rather than immediately, the device is reducing clock speed because it is warm. Charging while playing makes it worse, since the battery generates heat of its own.
Battery saver. iOS Low Power Mode and Android battery saver both cap frame rates, typically at 30fps. Everything remains playable and feels less responsive.
Browser extensions. Content blockers and script managers run on every page. Rarely decisive, occasionally the answer.
Very old hardware with a very high-resolution display. The worst combination, because fill cost scales with pixels and an old GPU has the least budget for it.
What is almost never the cause: your connection. These games make no network requests while running, so once the page has loaded, bandwidth is irrelevant.
Key takeaways
- Drawing graphics instead of downloading them removes transfer, decode and memory cost.
- Cap the device pixel ratio at 2 — 3× costs nine times the fill of 1× for almost no visible gain.
- Scale movement by elapsed time, and clamp the delta so a stall cannot teleport objects.
- Keep HUD text in HTML rather than redrawing it on the canvas every frame.
- Reuse objects, compare squared distances, and skip anything off screen.
- Reserve layout space so nothing shifts as the page finishes loading.
- Stutter is usually other tabs, heat or battery saver — not the game and never your connection.
Frequently asked questions
Why do these games run well on old phones?
Because they draw vector shapes rather than downloading and decoding images. There is nothing to transfer, nothing to decode, no engine to initialise and very little memory in use, so the main cost is a few hundred drawing calls per frame.
Why does the canvas look slightly soft on my high-end phone?
Because the device pixel ratio is capped at 2 rather than using the full 3 or higher. On flat vector art the difference is close to invisible, while the performance difference is substantial — a 3× buffer contains nine times the pixels of a 1× one.
Why does the game slow down after ten minutes?
Thermal throttling. Phones reduce clock speed as they warm, and charging while playing makes it worse because the battery adds heat. It appears as gradual degradation rather than immediate stutter, which is how you can tell it apart from other causes.
Does my internet speed affect gameplay?
Only for the initial page load. These games make no network requests while running, which you can verify by watching the network panel during play. Once loaded, your connection is irrelevant.
What frame rate do these games run at?
Whatever your display refreshes at, usually 60fps and up to 120 on some devices. Movement is scaled by elapsed time, so the game plays identically at any frame rate — a device at 30fps sees the same game slightly less smoothly rather than a slower one.
Where to go next
For the drawing layer in more detail, how HTML5 canvas powers underwater games. For the mechanics above the rendering, how underwater arcade games work.
And if you are playing on a phone, the mobile gaming guide covers the practical settings that keep things smooth.
References
- Canvas API — MDN Web Docs
- Window: requestAnimationFrame() method — MDN Web Docs
- Window: devicePixelRatio property — MDN Web Docs
- Web Vitals — Google web.dev
Links open on the publisher's own site. Factual claims about real oceans, depths and marine life on this page are attributed to these sources; game mechanics described on this page come from the game code on this site.