Smart Power - ihsoft/TimberbornMods GitHub Wiki

Overview

SmartPower optimizes mechanical power networks. It reduces wasted generator output, lowers power consumption for idle buildings, and adds extra UI for battery and automation status.

The current page describes SmartPower 1.17.0 for Timberborn 1.1.

Feature overview:

  • Ironteeth Engines and other good-consuming generators can automatically pause and resume to match network demand.
  • Power Wheels can automatically pause and resume too, with separate timing settings.
  • Generators can keep batteries inside a configurable charge range.
  • Powered consumers can suspend themselves when the network cannot provide enough power, or when batteries are below a configured charge level.
  • Bot charging stations consume full power only while charging a bot. In idle state they consume 1 hp.
  • Powered attractions consume full power only while used. Without attendees they consume 1 hp.
  • Powered manufactories enter power-saving mode when they cannot produce. In that mode they consume 10% of nominal power, and they consume no power when no recipe is selected.
  • Mechanical nodes show extra battery statistics for the whole network.

Generator automation UI Battery range settings

Generator automation

In the stock game, engines keep running as long as the network has any power demand. SmartPower lets supported generators pause when their output is not needed and resume when demand rises.

Supported generator types:

  • good-consuming generators, such as Ironteeth Engines;
  • beaver-powered generators, such as Power Wheels.

Each supported generator gets an automation panel:

  • Automate this generator enables or disables SmartPower control for that generator.
  • Keep batteries charge in range sets the battery discharge/charge thresholds.
  • Apply to all generators copies the current generator settings to other generators of the same type in the same network.

Generator settings are saved and copied by the stock building copy/duplicate tools.

Check out this video to see the original idea in action. It is an old demo, so it does not show the current controls.

Battery charging

When a network has batteries and no suspended consumers are reserving power, SmartPower uses generator-specific battery thresholds:

  • if a generator is suspended and total battery charge drops below the lower threshold, it resumes;
  • if a generator is running and total battery charge rises above the upper threshold, it suspends.

The default range is 65% - 90%.

This is useful when engines are the main power source: they keep the batteries near a high reserve and avoid burning wood after the target charge is reached.

If the network also has free or intermittent power sources, such as water wheels, use a lower range. For example, 10% - 35% lets engines protect the network from deep discharge while leaving most battery capacity available for free power.

Battery charge range

Power Wheels

Power Wheels use the same automation model as engines, but their timing is different. A resumed wheel may need time before a beaver enters and starts producing power.

Because of that, when SmartPower detects a shortage in a network with suspended wheels, all needed wheels are resumed first. Once the network has enough supply, unneeded wheels can suspend again.

Power Wheel automation settings are separate from engine settings.

No active consumers edge case

If all consumers in a network are idle and create no demand, all automated generators can suspend. In that state the stock game may consider the network unpowered, and some buildings may never start working because they cannot get power.

There are two ways to avoid this:

  1. Add at least one battery to the network. Even a small charge keeps the network usable long enough for demand to appear and generators to resume.
  2. Keep one generator non-automated, or turn off automation on a generator you want to behave like the stock game.

Always-on generator option

Consumer automation

SmartPower adds automation controls to powered consumers. This applies to buildings with power input, including stock buildings and compatible modded buildings.

Consumer controls:

  • Automate enables or disables SmartPower control for this building.
  • Minimum efficiency suspends the building if the network cannot provide the configured power efficiency. The default is 90%.
  • Stop if batteries charge is below optionally suspends the building when batteries are below the configured charge. The default threshold is 30%.
  • Apply to all such buildings copies the current settings to similar buildings in the same network.

Suspension is not the same as manually pausing the building. A suspended building is temporarily blocked by SmartPower, reserves the power it needs, and resumes automatically when the network can support it again.

Bot charging stations

In the stock game, bot charging stations consume full power even when no bot is charging. With SmartPower, a charging station consumes full power only while it is charging a bot. In idle state it consumes 1 hp.

This makes it practical to build extra chargers for peak demand without paying full power cost all day.

Charging station modes

Powered attractions

Powered attractions consume full power only while they have at least one attendee. If an attraction is powered but has no attendees, it stays in low-power mode and consumes 1 hp.

This applies to stock powered attractions and compatible modded attractions.

Attraction low-power mode

Powered manufactories

Powered manufactories enter power-saving mode when they have a selected recipe but cannot produce. In power-saving mode they consume 10% of nominal power, with a minimum of 1 hp.

Recognized power-saving reasons:

  • no worker is currently at a workplace that needs workers;
  • missing ingredients;
  • missing fuel;
  • blocked output inventory.

If no recipe is selected, the manufactory consumes no power.

The building shows a status icon and a status line explaining why power-saving mode is active.

Manufactory power-saving mode

Battery stats UI

SmartPower adds battery information to the mechanical network section. When a selected building is connected to a network with batteries, the panel can show:

  • total battery charge and capacity;
  • charge as a percentage, if enabled in settings;
  • current charging or discharging rate;
  • estimated time until full charge or depletion;
  • battery idle/depleted state.

Battery stats UI

Mod settings

SmartPower settings can be changed from the mod settings UI. Battery UI settings are available both in the main menu and in game.

Battery settings:

  • show or hide battery stats;
  • show battery charge as a percentage;
  • consumer activation hysteresis, 0-5 hours, default 1 hour.

Generator settings:

  • show floating icon for suspended good-consuming generators;
  • show floating icon for suspended beaver-powered generators;
  • Power Wheel suspend delay, 0-120 minutes, default 30 minutes;
  • Power Wheel resume delay, 0-120 minutes, default 15 minutes.

Consumer settings:

  • show floating icon for suspended workplace consumers;
  • workplace consumer suspend/resume delays, default 60/60 minutes;
  • show floating icon for suspended unmanned consumers;
  • show floating icon for suspended attractions;
  • attraction suspend/resume delays, default 60/30 minutes.

Version compatibility

SmartPower 1.17.0 targets Timberborn 1.1 and requires game version 1.1.0.0 or newer.

The release package also keeps a Timberborn 1.0-compatible version: SmartPower 1.16.3 for game versions 1.0.12.7 - 1.0.99.99. Behavior and UI can differ between the 1.0 and 1.1 branches.