Implementation

This is somewhat more technical and not of interest to everyone.

Considerations

 * When first starting a game the user wants to be able to do a lot more, and a lot faster.

Facility Info
type, initial energy capacity, energy consumption, energy production, (input material, input amount)*, (output material, output amount)*, (build material, build amount)*, build time, build energy,

Facility
user, id, type, energy capacity, energy, last user interaction, state, next state change

if a building needs a lot of material (more than a user may carry ones), YES!, it must be able to keep track of how much has been inserted already - Idea: collect it in the yard of the facility and have a marker if the building has been built or not. User may change its mind and get items from there before starting the build. Once the build process start the items are remove from the yard.

The facility may have some build statuses. See Facility

When building the user may show up and speed up the building. Can be done once per x time unit and speeds it up by x time.

Material Info
type, weight per unit, name, unit name, image

Material
user, id, at facility/inventory/on ground, type, amount

Off net

 * Working off-net handling. All actions take place in the user device and are only synchronized to the server in the background (this includes signing in is user has signed in once).
 * Client knows all about my structures and items. Play without network until you get it. Show a yellow/red marker if old pending stuff.
 * Use may only have one active device at the time, to avoid clashes between action from several devices. If the user want to log in using a new device, synchronizations from the old one will no longer be used after that moment. (The user may switch back but then the other one will be deactivated)
 * Client calculate producer/grid calculations and let the user act on them.
 * Time: Compare the system time with the one from GPS signals. It should not differ more than a minute. Note what the time in location is: https://stackoverflow.com/questions/7017069/gps-time-in-android
 * User movements and device check are stored and sent to server on synchronization.

Keep track of if the data is "dirty", send every X time, and try to send it onPause if not yet

Cheating prevention
All I will do is log. Log actions, device checks, timestamps, movements etc. This actually lets the user cheat in several ways. If they find it fun to cheat, well, go ahead. You will not harm anyone else.

But, when it comes to the score listing on the server: The uncertain players will be marked, and cheaters will be removed from the list.