Resource Gathering template, tracks time while game is closed or inactive

ArmellineArmelline Member, PRO Posts: 4,971

So last week there was a thread that asked about tracking the time when a game is closed. It turned out that the the most commonly used method no longer works for some reason. While trying to figure out why it didn't work, it seemed easier to just come up with a new method that does work.

So I built this template.

What I aimed to do was to create a template that did two primary things:

  1. Allowed for tracking of resources even when the game is inactive or closed.
  2. Allowed as few or as many things as needed to be tracked at once.

Here's a video of it in action, taken on an iPhone 5S:

How does it work? Well, it uses the popular method of counting seconds from a certain date, but does so while taking into account the different lengths of each month and the extra day introduced by leap years. Every second it updates a table with new values based on the inputs it receives.

There are two inputs: Number of workers, and the multiplier. Every 1s it will add new resources using this basic formula:

Number of workers x Multiplier

If the multiplier is, for example, 5, it will add 5 resources per worker every 1s. So if you have 5 workers, it will increase the resource by 25 every 1s. The multiplier is unique to each resource, and can be set to as high or as low as desired. The interval resources are recalculated can also be easily changed, as can the number of workers available.

New resources can be added and tracked by simply adding a column to the table and adding that reference to the Change Table Value. Takes literally 10 seconds to add a new resource!

I added the Workers as an optional extra. It allows you to prioritise one resource over another, and split your available manpower between them however you want.

The resources table is very simple and looks like this:

One of the most important things about this template is that it will keep track of elapsed time when the game is closed or inactive. As with all GameSalad games, it cannot function when not active, so the effect is achieved by quickly calculating the time it has been inactive and updating the various resources accordingly. I firmly believe my method is the best, most accurate and easiest method of doing this.

It has been tested on both iPhone and Android and is confirmed as working on both.

If you plan on making a Clash of Clans, or Virtual Pet or Cookie Clicker type game, this may be exactly what you need!

The rules regarding posting paid content haven't yet been clarified, but a precedent has been set and accepted with recent Arcade posts acting as advertisements, so I'll not put the link directly in here but point you to the description of the Youtube video and my signature if you're interesting in buying this!


Sign In or Register to comment.