Energy System & Math

  • The article about the various energy and power maths, systems, algorithms, and mechanics in the game.
    (This article is currently under construction!)


    1 Overview

    The most essential energy and power system mechanics are already well-documented in the official Urban Assault Help files. Therefore, please refer to the game's Help or readme files. This article aims to explore more in-depth systems and mechanics.


    2 Official Summary

    NOTE: This is the official summary of power management and energy system from the official readme file of the game. It is highly recommended to read the document.


    3 Basics

    3.1 Three main components of energy and power generation mechanics and management

    3.1.1 Power Rating

    Coming soon.


    3.1.2 Energy Status

    Coming soon.


    3.1.3 Sector Control

    Coming soon.


    3.2 Efficiency (Output/Input)

    Coming soon.


    4 Energy Math

    The information in this section will explain internal mechanics and algorithms of the energy systems, for both the user and the AI algorithms.


    4.1 Script integer values to energy conversion

    The energy values defined in scripts are converted into the game through various modifiers. The script values are also x100 times higher than in-game display. For example, '1000000' energy value for the host stations in the level scripts will translate to 7500 (2500 x 3 Batteries) total energy reservoir for the player, and 10000 (10000 x 1 Battery) total energy reservoir for the AI.


    The missing 1/4 portion of energy for the user is caused by the removed 4th battery that was exclusively designed and used for building construction. In the final version of the game, this 4th battery does not exist and its functionality has been combined with the unit creation battery.


    AI uses only 1 battery (System Battery) for all tasks. This sole battery functions as its life energy reservoir as well as unit and building creation battery. The AI cannot teleport their host stations, but instead can move their host stations manually. This does not cost energy, but it is much more inefficient and slow compared to the user's teleportation ability. Which renders AI host stations very vulnerable while they are displacing positions (see: Teleportation).


    4.2 Drak/Reload Constants and the conversion factors

    The Drak constant (or Reload constant) values that are defined in the level scripts determine the packet amount of possible energy absorption of the user and AI host stations from the power sources. The higher the value, the more energy can be gathered from the power sources for each power status from each packet.


    Like the total energy reservoir values, different levels (in both single-player and multiplayer) are assigned with different Drak constant values for each user and AI host stations based on individual level designs. The exact math for the actual amount of energy that can be gathered from each power packet that is relative to Drak constant values will be covered below.


    4.3 Power Rating and Energy Status and Sectors

    All energy sources (power stations) have unique power rating values that determine how much potential power (and therefore, energy) generation capacity they can provide. Which correspond with power strength boxes that appear on

    power station sectors on the map screen. For example, the Resistance Power Station 1 in single-player mode has 50 power rating values (64 in multiplayer for balance), and the Resistance Power Station 1+ (Power Station 2 in multiplayer) has 128 power rating values.


    Power stations supply energy into adjacent power grid matrix components (sectors) that share the same faction ownership as the power stations, providing energy to entities that belong to the owner faction while draining energy from entities that belong to other factions that are situated on these sectors.


    The collective power rating signals of the adjacent power stations are directly translated into energy status for host stations, which can take values between 0 (no power supply) to 255 (max power supply). Any energy status above maximum will result in a power saturation with no extra absorption benefit, but the total number of power stations will still affect efficiency between controlled sectors.


    4.4 Conversion Factor for Drak/Reload Constant to Power Rating/Energy Status

    Coming soon.


    4.5 AI-Only Unit Maintenance/Upkeep Mechanics

    Urban Assault is a quite generous game in regards to unit limits during the gameplay. In single-player mode, the players can virtually create as much units as they want without any hard restrictions. However, the same is not the case in multiplayer mode, where various types of soft limit and hard limit mechanisms exist to encourage efficient management of units and decision-making based gameplay to counter enemy strategies.


    However, unlike the human players, the AI players in single-player mode of UA are subject to various hardcoded handicaps and limitations that do not apply to the human players.

    One notable example is the unit maintenance/upkeep mechanics for AI host stations. Basically, unlike the players whose unit creation costs are static regardless of circumstances, the unit creation costs for AI host stations are fully dynamic. For the AI host stations, the energy required to create additional units will change depends on the number of total units (vehicles and turrets) that are currently under the command & control system of each AI host station.


    The math algorithm formula for calculating the AI host station maintenance/upkeep mechanics for the units is as follows:

    Code
    K = (k/2)+(kn/40)


    Or more simply,

    Code
    K = k*(20+n)/40


    Where 'k' is the cost of a unit, and 'n' is the current number for all units and turrets that an AI host station has control over (this includes the host station component itself).


    The result is an arithmetic progression that can be expressed in a linear function with no defined limit, so the unit creation cost for AI host stations will continuously increase without any restrictions as they field more units and flak/radar stations on the battlefield. For example, an AI host station can create its 20th unit (including all individual units and turrets currently present under their control) at a same price as the original unit cost. But the creation cost of its 100th unit will be 300% (+200% higher) of the normal cost. Likewise, its 200th unit creation cost will require 550% (+450% higher) of creation energy than the standard energy value. Which is prohibitively high.


    On the contrary, the construction costs for buildings remain identical for AI in all situations, same as the players. This is why many AI host stations prefer to construct numerous flak stations around their bases in later missions, where their manufacture costs of normal units become excessively high to be practical. Still, the individual flak turrets (and the radar antennae) will contribute to the total number of units under the AI control, which will resultantly affect their attack capabilities in favour of defensive advantages the emplacements offer.


    It is also worth noting that individual AI host stations possess independent command & control system. So when there are multiple AI host stations present for a faction in a level, only one of these AI host stations will be responsible for controlling all pre-deployed squadrons and automated structure components in the level. Which means the energy penalty for this 'master' AI host station will be usually greater than the other AI host stations in the same faction that only manage their own units, unless the pre-deployed assets are exhausted.


    4.6 Multiplayer Unit Limits

    See Main Article: Official Multiplayer Notes



    (This article is currently under construction!)

Share