Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

[Resource Gathering While Away] Possible Bug

A topic by gz created 80 days ago Views: 187 Replies: 3
Viewing posts 1 to 2
(1 edit)

When the game is minimized, it shifts to an "Away" mode, where when it's opened again, it shows you how many resources you gathered while the game was minimized.

I've discovered a possible bug: when the game enters "Away" mode, the amounts by which each resource grows/shrinks freezes. If you minimized the game while earning -2 food, it doesn't matter if that would be fixed in the next tick by your 20 masons, it remains "-2 food" for as long as "Away" mode is active.


If this behavior is intentional, please let me know.

Developer

The "Away" mode works only if you do not have negative earnings, else it will show a screen "workers are not happy" and such.

Games exported to Web from Godot  are paused when tab is not focused, I am not sure that a workaround exists for this.

(1 edit) (+1)

Ah, yes. That makes sense.


I can think of a way to get around the pausing:

Every tick is a set number of seconds (5, at the start of the game), and there's already a system in place that tracks how long "Away" mode was active

So, when "Away" mode is deactivated, temporarily set the tick length as low as it will go (most likely a single frame) for as many ticks as it was active before resuming play.

This should allow things to scale in the same manner as if "Away" mode was never activated, because all of the math happens while it *isn't* active very very quickly.

Developer

That's an interesting idea!


I wanted to avoid simulating ticks with "Away" mode which does more direct calculations when detected.


But perhaps the best is a mix of both worlds.