Unit Limit Enforcement

If you liked this item, please rate it up on Steam Workshop page.

Author: TC

Last revision: 22 Apr, 2020 at 16:34 UTC (1)

File size: 81.92 KB

On Steam Workshop

Description:

BASICS

This gameplay mod sets dynamic limits to the number of units each civ may have at a given time. A new top panel is included showing your current #units and the limit for that unit type. The purpose of this mod is to prevent an overcrowded map due to AI unit spam.

Units are broken into 5 main groups:

  • Land Combat
  • Naval Combat
  • Air Combat
  • Support
  • Religious

Additional limits placed on individual units:

  • Settlers
  • Builders
  • Naturalists

Each player has a maximum of each group of units, which changes throughout the game, based on:

  • # Cities
  • # Districts (encampments for land/support, harbors for naval, aerodromes for air, holy sites for religious)
  • # District Buildings (corresponding districts, listed above)

Beyond the variable limits, there is a hard cap for each type. This hard cap is based on the size of the map(smaller maps = fewer units). Default hard cap values are shown in an image above. To disable the hard caps, see notes below.

Note: Individual civilian unit limits do not increase with additional districts/buildings.

Default limit variables are listed a the table in the images above. Limits are easily adjusted by editing the values in TCUnitLimit.lua and TCUnitLimitTopPanel.lua.

Top Panel

The new top panel shows your current units and unit limits for Land Combat, Support, Naval, Airforce, and Religious Units. I decided against tracking the builder, settler, and naturalist limits up there, because I didn’t want to clog it up with too much info. Those limits should be easily tracked without the UI element.

Since the Top Panel will replace any other modded top panel you may be using, I have also included a indicator for overall amenities. On that indicator’s tooltip, you will find a full list of the luxury resources you currently have. I was using the CQUI top panel before this, so I couldn’t live without luxury resources being accessible up there.

HOW DOES IT WORK?

Upon reaching the limit of any unit type, that type will no longer be producible in your cities. When you drop back below that limit, or the limit increases due to a new city/disrict/building, you’ll once again be able to produce that unit type.

If a civ surpasses their unit limit (from losing a city, being rewarded units from villages, etc), the extras will not be removed.

Under the hood:

  • All units have been given a prereq building, such as "Army Unit Unlock", "Settler Unit Unlock", etc.
  • While below the unit limit, this building will be placed in your cities and allow creation of the corresponding units.
  • Once the limit has been reached, this building will be removed from your cities, and those units will no longer be producible.
  • When you are no longer at or above the limit, the building will be created in your cities again, unlocking unit production.

Important: In order for this mod to work, units may no longer require a separate building to produce. Therefore, all units that previously required a building (missionary, apostle, military engineer, etc) now require the tech/civic of those buildings instead. For all practical purposes, the only gameplay difference is now you may create an Apostle before building a Temple.

COMPATIBILITY

This mod IS COMPATIBLE with DLC and modded units.

Compatibility has been confirmed with the following unit mods:
Steel and Thunder Units
Steel and Thunder Unique Units
Warfare Expanded: Complete Edition

Potential compatibility issues:

  • Building prereqs for modded units will be removed. Those units that have only building prereqs, and not a tech/civic prereq, will then be buildable from turn 1.
  • This mod will overwrite any other top panel mods you are using.

HOW TO CHANGE THE LIMITS:
  • Navigate to your steam workshop folder(Program Files -> Steam -> steamapps -> workshop -> content)
  • Find the folder which contains this mod’s files. Locate TCUnitLimit.lua and TCUnitLimitTopPanel.lua. Open the files with your choice of text editor.
  • The variables within this file are well documented. Read the notes and change whichever values you wish. MAKE SURE the values match in both files.

HOW TO DISABLE THE HARD CAP:
  • Navigate to your steam workshop folder(Program Files -> Steam -> steamapps -> workshop -> content)
  • Find the folder which contains this mod’s files. Locate TCUnitLimit.lua and TCUnitLimitTopPanel.lua. Open the files with your choice of text editor.
  • Towards the top of the files, find the variable "bEnableHardCap" and set it = false. Make sure you change it it both files.

Check out my other mods here:

Strategic Forts (Updated 2020)
Expanded Initial Vision (Verified 2020)
Removable Districts (Updated 2020)
Removable Resources and Features (Updated 2020)
City State Introductions Reworked (Updated 2020)

Download
Revisions:

Old revisions of this mod are available below. Click the link to download.