Skip to content

For developers

How to Implement Offline Progress: 12 Techniques From Real Idle Games, With the Code Paths That Ship Them

Idle game offline progress implementation: 12 techniques, from timestamp formulas to full simulation and time banks, as used in Cookie Clicker and Melvor Idle.

Offline progress is not the game running while closed. Every implementation works the same way at the start: save a timestamp, and when the game opens again, compute how many seconds passed and award what would have happened. The real decisions come after that: whether you award it with one formula or by simulating ticks, how long a cap you allow, what rate you pay, which activities count, and how you show the result.

The 12 techniques below are each taken from a real game, mostly from code we could read directly (Cookie Clicker's public script, the open-source Antimatter Dimensions and The Modding Tree) or from the game's official wiki. Of the 1,618 games in our catalog, offline behaviour is recorded for 279: 247 progress offline, 23 cap it, and 9 have none.

02

Full simulation as if the game stayed open: best for skilling and RPG idlers with items, XP and drops

Platform: Browser, Steam, Mobile · paid

The Melvor Idle wiki describes its offline progression as calculating everything as if the player had been online for up to 24 hours: skill XP, mastery XP, items and level-ups, including synergies unlocked during the absence. The wiki is explicit that there is no actual offline progression; the time is processed when the player returns.

Pick simulation when outcomes depend on discrete events, like a drop chance per action or a level-up that changes the next action's speed. Run your normal update function in a loop over the elapsed time and skip rendering until it finishes.

Watch out for: Simulation cost scales with time away. The wiki notes that mods removing the 24-hour cap make the game load for longer and longer, so set a cap or a tick budget before players find the problem for you.

03

Reduced-accuracy ticks with a progress bar: best for complex economies where a formula is impossible

Platform: Browser, Steam, Mobile · free

Antimatter Dimensions' simulateTime function runs the real game loop over the time away. It normally ticks at 50 milliseconds, but caps the number of offline ticks (the default setting is 100,000, and the options slider allows up to 1,000,000) and never lets a tick get shorter than 33 milliseconds. Fewer ticks means each tick covers more time, which is the accuracy trade.

It runs the simulation asynchronously with a modal titled Offline Progress Simulation, a progress bar, and a Speed up button that cuts the remaining tick count. Short absences of 10 to 50 seconds use a fast path of 50 ticks with no modal.

Watch out for: Long ticks can skip thresholds that a 50 ms tick would hit, such as an autobuyer firing or a challenge goal. AD exposes the tick count as a player setting so people can trade load time for accuracy.

04

A time bank that fast-forwards: best for small web games that want visible catch-up cheaply

Platform: Browser · free

The Modding Tree, the engine behind The Prestige Tree and its many descendants, stores time away in player.offTime.remain when a save loads. Each 50 ms tick then spends the larger of the normal tick or a tenth of the remaining bank, so the game visibly races forward for a few seconds and settles. The bank is capped by modInfo.offlineLimit, which is 1 hour in the default mod file.

This gives most of the accuracy of simulation for very little code, and players enjoy watching numbers fly. It also works for time lost when the tab is throttled, because the bank is just extra seconds.

Watch out for: Spending 10 percent per tick means the first ticks are huge. The Modding Tree also clamps any single tick with maxTickLength (3,600 seconds by default); keep a similar limit so one tick cannot jump past unlock checks.

05

Offline cap as a progression track: best for mobile idlers built around daily check-ins

Platform: Mobile · free-to-play

In Egg, Inc. the cap is something you build. The Egg, Inc. wiki says each Grain Silo adds a base of one stored hour of income, and the Silo Capacity research adds six minutes per silo per level, up to two extra hours per silo. Cookie Clicker does the same with heavenly upgrades: its code doubles the base one-hour cap for each of seven demon upgrades and adds two days with Chimera.

Turning the cap into upgrades gives players a reason to come back and a goal to work toward, and it lets you start with a short cap that protects early balance.

Watch out for: Players hit the cap overnight and feel they lost income. Show the current cap clearly and warn when the player is near it, or they will blame the game rather than their choices.

06

Offline rate as an upgrade: best for games where early offline income would break balance

Platform: Cookie Clicker heavenly upgrades · Egg, Inc. Pro Permit

On the web, Cookie Clicker pays nothing offline until you buy the Twin Gates of Transcendence heavenly upgrade, which starts at 5 percent of normal production; each angel upgrade then adds 10 percent. Egg, Inc. pays half the online rate on the free Standard Permit and the full rate with the $9.99 Pro Permit, according to its wiki. Both are in our catalog: Cookie Clicker and Egg, Inc..

A reduced offline rate keeps active play worth something and makes the first offline upgrade feel like a real gift. Treat the rate and the cap as two separate dials.

Watch out for: Selling the offline rate for money works, but players are quick to call it a punishment for having a life. If you charge for it, make the free rate generous enough that the game still feels idle.

07

Only automated things run offline: best for tycoon clickers where automation is the reward

Platform: Steam, Mobile · free-to-play

In AdVenture Capitalist a business only keeps earning while you are away if you have hired its manager. The AdVenture Capitalist wiki says managers automatically start a profit cycle after one ends, even if the player is disconnected, and that this is what makes it an idle game. Unmanaged businesses wait for a click.

This makes offline progress fall naturally out of the design: compute offline income only from automated sources. It also gives every manager purchase a clear, felt reward the first time the player returns.

Watch out for: If automation arrives too late, new players close the game, come back to nothing, and assume offline progress is broken. Give the first automation in the first few minutes.

08

Risky actions need an opt-in: best for games where offline play can lose progress

Platform: Melvor Idle's Toggle Offline Combat setting

Melvor Idle simulates combat and thieving offline only after the player turns on a Toggle Offline Combat setting, because both can kill the character. The wiki tells players to equip enough food and check their success rate before going offline.

If any activity can fail, cost resources or end a run, let players choose whether it continues while they are away. A loss that happened when nobody was watching feels worse than the same loss on screen.

Watch out for: Opt-in settings are easy to forget. Remind players on the way out or in the welcome-back summary that the risky activity ran while they were gone.

09

Treat throttled tabs and sleep as offline time: best for browser games left open in a background tab

Platform: Browser games · timers, visibilitychange and sleep

Browsers slow background tabs: Chrome checks timers in hidden tabs once per second and, after five minutes hidden and silent, can drop to once per minute. Melvor's wiki notes its offline progression may also trigger when the tab is throttled, and Cookie Clicker has a sleep mode that kicks in when too many frames are skipped and pays offline production during it. Antimatter Dimensions has a separate hibernation catch-up option for computers that slept with the game open.

In practice: on each tick, if real elapsed time is much larger than the tick interval, route the excess through your offline path instead of one giant tick. Browser games are often left open in a background tab for hours, so this path runs far more often than a true close-and-reopen.

Watch out for: Listen for the visibilitychange event too. Saving when the tab is hidden means a closed laptop lid or a killed mobile browser never loses the last minutes.

10

Decide how much you trust the clock: best for games with leaderboards, trading or paid currency

Platform: Godot, Unity, JavaScript · system time vs monotonic time

Offline progress needs wall-clock time, and wall-clock time belongs to the player. Godot's documentation warns that its from_system methods use the system clock that the user can manually set, and recommends the monotonic get_ticks_msec for precise timing within a session. The same split exists everywhere: Date.now() versus performance.now() in JavaScript.

Use monotonic time while the game is running and system time only for the gap between sessions. Clamp negative gaps to zero, as The Modding Tree does, and cap huge ones. If players compete or spend money, get the time from your server instead.

Watch out for: Do not punish clock changes harshly in single-player games. Travel, daylight saving bugs and dead CMOS batteries all move clocks, and a reset save is a worse outcome than a few stolen hours.

11

A welcome-back summary: best for making offline gains feel like a reward

Platform: Any engine · a modal or notification on load

Whatever method you use, tell the player what happened. Cookie Clicker shows a Welcome back! notification with the amount earned and the time and rate used. Melvor shows a summary of everything gained while offline, and Antimatter Dimensions shows its simulation progress before returning control.

List the totals, the time counted, and anything that hit a cap. A clear summary is also how players learn what is worth leaving running, which matters most in deep games with many systems.

Watch out for: A summary that shows only one number hides the interesting parts. Include unlocks and level-ups, and say plainly when the cap cut the payout.

12 · Ours

Mushies!: best for games that deliberately skip offline progress

Platform: Browser, Steam

Mushies! is the site maintainer's own Godot clicker, included here as the counterexample. It has no offline progress by design: a comment in its pond code says plainly that "Mushies never has offline progress", and anything that would quietly tick while closed is treated as offline progress in disguise and kept out. The save stores a last-save timestamp only for display.

That suits a cozy, hands-on village game whose sessions are about clicking, building and watching the shrooms work. If your game is meant to be played rather than checked, saying no to offline progress is a legitimate choice, and it removes clock trust and balance problems entirely.

Watch out for: Genre players often expect offline progress. If you leave it out, say so on your store page and in the game so nobody thinks their progress was lost.

How to choose an offline progress method

Pick the method that matches how your production works, then tune the cap and rate.

01

Match it to your economy

Constant rates: one formula, like Cookie Clicker. Discrete events and drops: full simulation, like Melvor Idle. Feedback loops and autobuyers: tick simulation with a tick budget, like Antimatter Dimensions, or a time bank, like The Modding Tree.

02

Match the cap to your session design

A one-hour cap says check in often; 24 hours says play once a day; uncapped says leave it for a week. Mobile games usually make the cap an upgrade track, as Egg, Inc. does with silos. Players can see what other games do on our offline progress list.

03

Match the rate to how idle the game should be

Full rate makes the game truly idle. A reduced rate, like Cookie Clicker's starting 5 percent, keeps active play meaningful. Gating offline income to automation, like AdVenture Capitalist's managers, ties it to progression. Whatever you pick, write it on the store page; players filter for it, and mostly idle games are a category people search for.

Add a lastSaveTime field today

Even if offline progress is weeks away, start saving a timestamp now so existing saves have one when the feature ships. Then build the formula version first, measure how far it drifts from an open tab over an hour, and only move to simulation if the gap matters. Our JavaScript tutorial and save system guide cover the surrounding code.

When your game is out, list it on IncrementalGames.org for free and tell us how offline progress works; it is one of the facts players filter by. The optional Get featured placement adds a labelled Featured card on the home page, game pages and best-of lists from $30 a week.

List your game free →

Common questions

How does offline progress work in idle games?

The game saves a timestamp. When it loads again, it subtracts that from the current time and awards the production for the gap, either with a formula (rate times time) or by running the game loop over the elapsed time. Most games cap the time counted.

Should offline progress be capped?

Usually. Caps protect balance and bound simulation time. Melvor Idle caps at 24 hours, The Modding Tree defaults to 1 hour, and Egg, Inc. and Cookie Clicker let players raise the cap with upgrades.

How do you stop players cheating offline progress by changing the clock?

In single-player games, clamp negative time to zero and cap large gaps; most developers accept the rest. If there are leaderboards, trading or paid currency, use server time. Godot's docs warn that system time can be set by the user.

Is it better to simulate offline time or calculate it?

Calculate it when production is a constant rate, because it is instant and exact. Simulate when outcomes depend on events such as drops, level-ups or autobuyers. Antimatter Dimensions simulates with a capped tick count to keep load times reasonable.

Why does my idle game lose progress in a background tab?

Browsers throttle timers in hidden tabs, to once per second in Chrome and as little as once per minute after five minutes. Measure real elapsed time on each tick and pay out any gap, rather than adding a fixed amount per tick.

Sources