Tick System - espresso20/civcli GitHub Wiki

Tick System in CivIdleCli

The tick system is the fundamental game cycle mechanism that drives all resource production, consumption, and game progression in CivIdleCli. This guide explains how the time-based tick system works and how to interpret it during gameplay.

What is a Tick?

A tick is a single unit of game time in which all game processes occur once. In CivIdleCli:

  • Ticks advance automatically based on real-world time
  • Each tick represents 5 seconds of real time by default
  • The game processes multiple ticks when you return after being away
  • The current tick count is always displayed in the status panel

Tick Mechanics

Tick Counter

The tick counter starts at 0 when you begin a new game and increases based on elapsed real-world time. This counter serves several important purposes:

  • Measuring game progression
  • Tracking when events occurred
  • Calculating total resource production over time

You can view your current tick count in two ways:

  1. On the main dashboard at the top of the status panel
  2. Using the stats command, which shows "Game ticks: X"

Time-Based Advancement

Unlike traditional turn-based games, CivIdleCli advances automatically:

  • Each tick represents 5 seconds of real-world time
  • When you return to the game after being away, the game calculates how many ticks have passed
  • Resources continue to be gathered and consumed even when you're not actively playing
  • For very long absences, tick processing is capped at 1000 ticks to prevent excessive resource accumulation

What Happens During a Tick

Each tick involves the following sequence of actions:

  1. Resource Collection:

    • Villagers gather resources based on their assignments
    • The amount gathered depends on collection rates and building bonuses
    • All gathered resources are added to your inventory
  2. Resource Production from Buildings:

    • Buildings produce their resources (farms produce food, etc.)
    • These are added to your resource totals
  3. Resource Consumption:

    • Food is consumed by your population
    • Each villager type consumes a specific amount of food
  4. Research Progress:

    • If you have an active research project, progress advances
    • Knowledge resource is converted to research progress
  5. Age Advancement Check:

    • The game checks if you meet requirements for advancing to the next age

Understanding Resource Rates

Resource rates shown in the game have the following meaning:

  • +X.X per tick: Resources gained each tick (from villagers and buildings)
  • -X.X per tick: Resources consumed each tick (primarily food)
  • Net rate: The difference between production and consumption

For example, if you see:

Food: 125.4 (+6.8, -4.2)

This means:

  • You currently have 125.4 food
  • You're producing 6.8 food per tick
  • You're consuming 4.2 food per tick
  • Net change: +2.6 food per tick

Resource Collection Formula

The exact formula for resource collection per tick is:

Resources Collected = Villagers × Base Rate × (1 + Building Bonuses) × Villager Type Modifier

Where:

  • Villagers: Number of villagers assigned to gathering that resource
  • Base Rate: The base collection rate for that resource (e.g., 2.3 for food)
  • Building Bonuses: Sum of percentage bonuses from buildings (e.g., +8% per farm for food)
  • Villager Type Modifier: Special modifiers for certain villager types (e.g., scholars get +50% for knowledge)

Practical Tips for Tick Management

Resource Planning

When planning resource gathering, consider how many ticks it will take to reach your goal:

Ticks Needed = Resource Amount Needed ÷ Net Resource Rate per Tick

For example, if you need 100 wood and your net wood production is 2.5 per tick, it will take approximately 40 ticks to gather enough.

Avoiding Food Shortages

Since food is consumed every tick, you should:

  1. Always maintain a positive net food rate
  2. Build a buffer of food before expanding your population
  3. Calculate how many ticks of food security you have:
    Ticks of Security = Current Food ÷ Food Consumption per Tick
    

Building Priority

Some buildings have greater impact per tick than others:

  1. Farms are high priority because they add +3.5 food per tick directly, plus improve gathering
  2. Lumber Mills and Mines are next, providing +2 wood and +1 stone respectively
  3. Markets and Libraries provide smaller but important resource gains

Game Events and Ticks

Major game events are recorded with their tick number:

  • Building construction
  • Villager recruitment
  • Research completion
  • Age advancement

You can view these events with the stats command, which shows the tick number for each event.

Optimizing Tick Efficiency

To optimize your civilization's growth:

  1. Minimize Idle Time: Avoid having idle villagers
  2. Balance Production: Ensure resource rates match your current needs
  3. Plan Ahead: Calculate how many ticks you need for important buildings
  4. Monitor Consumption: Always keep food production above consumption
  5. Maximize Building Synergies: Build structures that boost the resources you're focusing on

Time-Based Idle Mechanics

CivIdleCli is designed as an idle game where progress happens automatically, even when you're not actively playing:

Real-Time UI Updates

  • The game's user interface refreshes automatically every second to show your current resources and progress
  • You can watch your resources increase in real-time without having to enter commands
  • Resource colors change dynamically based on amounts (red for low, yellow for medium, green for abundant)
  • Research progress bars update live as knowledge is converted to research points

Automatic Progression

  • Your civilization continues to gather resources, build research, and consume food even when the game is closed
  • When you return and open the game, it calculates all the ticks that have passed since you were last online
  • The game processes these ticks and shows you the updated state of your civilization

Offline Progress Caps

To prevent unrealistic resource accumulation after very long absences:

  • The maximum number of ticks processed at once is capped at 1000
  • For longer absences, you'll see a message indicating that tick processing was capped
  • This prevents returning to impossibly large resource stockpiles or issues with negative resources

Interaction with Commands

  • Unlike the initial version of the game, commands no longer trigger ticks
  • Commands simply change your civilization's configuration (assigning villagers, building structures, etc.)
  • The progress of time (ticks) is completely separate from player actions

Time Scale and Balancing

The default time scale is:

  • 1 tick = 5 seconds of real-world time
  • 12 ticks per minute
  • 720 ticks per hour
  • 17,280 ticks per day

All resource rates are balanced around this time scale. For example, a food production rate of 3.0 means you get 3 food every 5 seconds, or 36 food per minute.

AFK (Away From Keyboard) Strategies

The new time-based tick system allows for AFK (Away From Keyboard) strategies where you optimize your civilization before logging off:

  1. Resource Balance: Before leaving, ensure your resource production rates are positive, especially food

    • A negative food rate can cause starvation and halt progress while you're away
  2. Buffer Resources: Build up a buffer of critical resources before going AFK

    • If you have 1000 food and consume 2 food per tick, you have 500 ticks (about 42 minutes) of safety margin
  3. Long-term Projects: Set up long research projects before leaving

    • Research that would take 500 ticks can be completed while you're away
  4. Optimal Assignments: Reassign villagers based on how long you'll be gone

    • Short absence: Focus on immediate needs
    • Long absence: Focus on resources with the highest storage capacity or those needed for your next major goal
  5. Preparing for Return: If you know you'll be gone for an extended period, consider:

    • Assigning more villagers to knowledge to advance research
    • Setting up for the next age advancement
    • Focusing on resources needed for buildings you want to construct when you return

Resource Accumulation Formula

For planning purposes, you can calculate how much of a resource you'll accumulate while away:

Resources Accumulated = Net Resource Rate per Tick × Number of Ticks Away

For example, if your net wood production is 3.5 per tick and you'll be away for 2 hours (1440 ticks):

  • 3.5 × 1440 = 5,040 wood accumulated

Remember that food consumption continues while you're away, so ensure your food production exceeds consumption!

By understanding and leveraging the tick system and time-based mechanics, you'll be able to effectively manage your civilization in CivIdleCli, ensuring steady growth and progression even when you're not actively playing!