Sid Meier's Civilization VI

Sid Meier's Civilization VI

218 ratings
Unit Limit Enforcement
4
3
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
83.877 KB
27 Mar, 2020 @ 3:06pm
22 Apr, 2020 @ 9:34am
6 Change Notes ( view )

Subscribe to download
Unit Limit Enforcement

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)



216 Comments
rilquermascarenhas 19 Aug @ 11:20am 
Any way to make the Venetian Arsenal increase the naval unit limit?
rilquermascarenhas 14 Aug @ 8:55am 
I also noticed the limit calculation is rounding up, instead of down. For instance, if I have +2.5 units due to building, that counts as 3, instead of 2. Is there any place in the files that I could change that? I think I'd prefer for it to round down.
rilquermascarenhas 14 Aug @ 8:53am 
I love this mod, really bought the balance I wanted to the game. I have noticed that the unit limit changes the moment you start building a district (e.g., encampment), not when it is completed. Would it be possible to change that to assure the unit limit is only incremented when we finish building the district/building?
rilquermascarenhas 9 Aug @ 5:55pm 
FIXED: I checked the DebugGameplay.sqlite file and noticed all religious units were assigned as FORMATION_CLASS_SUPPORT. I don't know when it changed, but since the code for this mod picks all support class units, religious units were going there too. Here is how to fix it (in case anyone runs into a similar issue): change the line defining units that will be limited by Holy Site infrastructure:

Old:
1 CREATE TABLE ULE_HolyFormationClassUnits AS
2 SELECT UnitType FROM Units
3 WHERE TrackReligion='1' AND FormationClass='FORMATION_CLASS_CIVILIAN';

New:
3 WHERE (TrackReligion = '1') AND (FormationClass = 'FORMATION_CLASS_SUPPORT');

Then modified the line for support units as well, to make sure that it is pulling only support units that are not related to religion:

Old:
1 CREATE TABLE ULE_SupportFormationClassUnits AS
2 SELECT UnitType FROM Units
3 WHERE FormationClass='FORMATION_CLASS_SUPPORT';

New:
3 WHERE (TrackReligion = '0') AND (FormationClass='FORMATION_CLASS_SUPPORT')
rilquermascarenhas 9 Aug @ 12:17am 
I confirmed that it is not a conflict with ARS - Unit Stacking, and I can't think of any other mod I'm using that would be affecting categories of units and or buildings prereqs. I noticed a couple things tho: 1) in the code tho that there are four lines to change the prereqs for Apostole, Guru, Inquisitor and Warrior Monk to CIVIC_THEOLOGY, but the Missionary is not there; should there ba a line changing their prereq to, maybe, TECH_ASTROLOGY? 2) The civiliopedia flags Support Unit Unlock as a prereq building for all religious units, but shouldn't it be Religious Unit Unlock?
rilquermascarenhas 8 Aug @ 8:49pm 
I have one missionary that is falling into the support unit limit, instead of the religious unit limit. Anyone seeing the same issue? I have ARS - Unit Stacking mod as well, which categorizes military units, but I wonder if there is any conflict there.
ChrisMartin 7 Apr @ 12:15am 
@faber_avgust Change the Hard Cap number in the mod files.
@petr.surgay No. I use a mod for make building Settler harder
petr.surgay 31 Mar @ 9:07am 
Is it possible with this mod to set up limit of cities per player to certain ammount? Let say hard cap settlers to 3 minus number of build cities?
faber_avgust 20 Jan @ 6:33am 
How i can expand the HARD CAP? I don't want to disable, just increase
faber_avgust 20 Jan @ 4:01am 
Seems like this mod disable some battle sounds of units. Is it someone mentioned this?