Idle Gods is the first game I developed solely for mobile, and I designed it as an idle game where eventual death is possible, and the game's goal is survival.
Like any Idle game, the player's focus is on managing their resources. Even when the game isn't playing, a timer constantly counts down. When it hits 0, the game increments progress, adding and reducing resources. If resources run out or go over their cap, discontent will rise and a civilian will eventually quit.To make it easier for players, the game's signature mechanic is the winter mechanic, where progress halts and the people spend fewer resources. This balances the player's need to check the game during the day by giving them a rest period where they are in no danger of damaging their civilisation.
UI Design and Future Ideas
- ⦁ On the first screen, players can build and assign workers to various buildings and jobs.
- ⦁ On the second screen, players can view their workers and assign professions.
- ⦁ On the third screen, players spend their blessings, earned from gods by playing the game, to cast spells and upgrade the city.
- ⦁ On the final screen, players can buy and trade resources, including civilians.
Future Development.
The end goal of this project of this game would be something similar to a roguelike, where the difficulty curves can be prepared for, death is expected, and the lifetime of the village would be a lot smaller than a normal idle game.
Perks like divine blessings would carry over to incentivise continued play.
The tick function is the most important part of the game, as it updates everything in the civilisation, from the workers to the gods and the marketplace.
It begins by cycling through every villager, reducing their fatigue and food if they're resting, or increasing their fatigue and possibly causing them to take a break if they're working.
The function then cycles through each building, causing them to generate resources, upgrade, and increase discontent if they're empty.
While coding a function like this, care must be taken to ensure the functions Big 0 Notation does not go over N2, as the function can play dozens of times when the player returns from a break.
Saving Data between sessions.
The process of saving an idle game is a bit difficult when using unity.When the player hits the quit button, void OnApplicationQuit() plays, saving the game then closing it.
But if the player minimises or closes the game without shutting down, OnApplicationPause(bool pause), plays. If Pause is true, the player has closed the game, calling for a save. If Pause is false, the player is returning, and the only part of the game that needs to reload is the timer.
Calculating Away progress when resuming play
When the player returns to the game, it must calculate how long the player was gone.It does so by first taking the clock's current time, and subtracts it from the time when the player left. The time is then converted from hours and minutes to just minutes. If the time the player was gone is greater than 15 minutes, the tick function runs, and the time the player was absent is decreased, and then the check is repeated until the timer goes under 15 minutes. When it does so, any remaining time is added to where the timer was at when the game stopped, and the game can begin.