Ungodly Diplomacy AI 1.0.1 and Research 1.2.0

Ungodly Diplomacy Research settings

All 65 settings live in two places that stay in sync: the in-game window on F9, and the file BepInEx\config\com.stixsworldhd.ungodlydiplomacyresearch.cfg. This page also explains how repeatable research, stacking and Research Mastery work.

The F9 window

The Ungodly Diplomacy Research settings window on the Costs tab: Base Research Cost Multiplier 1, Repeat Cost Curve Exponential, Repeat Cost Growth 0.5, Repeat Cost Exponent 2.View full size 1920 × 1080
The Costs tab: a base price multiplier, and the curve that makes every extra level cost more.
  • Press F9, or your own menu key, to open and close it, at the main menu or in a mission. It has nine tabs: General, Repeatable, Stacking, Costs, Safety Caps, Mastery, Coroutines, Levels or Status.
  • Every row shows the setting, its current value, its minimum, maximum and default (plus the options, for choices) and a plain-language explanation.
  • Change a value with its slider, the − and + buttons, an ON/OFF button, the < and > arrows for choices, or, for the menu key, by pressing the new key.
  • Reset this tab to defaults and Revert my changes sit at the bottom of every tab.
  • Changes apply live. Research data re-applies about 0.35 seconds after you stop dragging a slider, and settings are saved when you close the window and every few seconds while it's open.
  • The Levels tab lists every research of the current mission with its level, next price and time, and effect multiplier. Until a mission is loaded it says Start or load a mission to see its research levels.
  • The Status tab shows engine counters, the compatibility state, the Harmony patch report and errors, with Clear faults and Re-apply now buttons.

The mouse cursor

Opening the window saves the game's cursor state, shows and frees the cursor, and blocks clicks and wheel zoom over the window. Closing it restores the exact saved state: confined to the game window, or locked and hidden while you directly control a unit. With Ungodly Diplomacy AI installed, both windows can be open at once; whichever closes last hands the cursor back.

Presets

The General tab offers three presets that set many values at once:

Classic
Gentle diminishing stacks that flatten out, pricier repeats, tighter safety caps. Closest to vanilla pacing.
Balanced
The defaults. Linear stacks, exponential prices, sensible caps.
Ungodly
Huge linear stacks, polynomial prices, very high caps. Late-game armies become monsters.

How repeatable research works

  1. Level 1 is the vanilla research. Research anything as normal.
  2. Research with stackable effects reopens. Once finished, it shows as available again, at its real price, if it contains effects from a category switched on in the Repeatable tab. Its owner building must still be built and its parent research finished, as in vanilla. There is no final level.
  3. Research it again. The price and time of the next level come from your cost curve. The tooltip title shows the level change, such as [Lv 3 -> 4], with the effect multiplier now and next. Cancelling refunds exactly what you paid, using the game's normal refund rule.
  4. On completion the new level applies to every existing and future unit of that type. Current health scales proportionally, exactly like vanilla research.
The Ungodly Diplomacy Research v1.2.0 settings window open over the main menu on the Repeatable tab: Repeat Unit Offense, Defense, Mobility and Training, and Ability Research are ON, Repeat Structure Research is OFF.View full size 1920 × 1080
Ungodly Diplomacy Research: the F9 window on its Repeatable tab, where you choose which kinds of research can be repeated. Structures are OFF by default.
CategoryEffects that stackDefault
Unit OffenseDamage %, attack range, target search range, attack interval, flat damage, splash radius, tower garrison damage, range and sight, siege (building) damageON
Unit DefenseMax health %, regeneration, regeneration delay, flat health (units)ON
Unit Mobility & TrainingMove and turn speed, acceleration, training speed, sight radius (units)ON
Unit AbilitiesHeal power, ability duration and cooldown, ability area, cast range, summon countON
StructuresThe same health, regeneration and sight effects on buildings, walls, gates and towersOFF

Unlocks, skill unlocks, economy, market, disease, spells and other global effects keep their vanilla one-time behaviour. If a research mixes both kinds, only its stackable effects grow with each level.

Stacking, caps and prices

With b the level-1 bonus, s the Per-Level Strength, d the Diminishing Factor and L the research level:

Stacking modes
Linear        b × (1 + s × (L − 1))
Diminishing   b × (1 + s × (1 − d^(L − 1)) / (1 − d))
Compounding   (1 + b)^(1 + s × (L − 1)) − 1

Diminishing approaches b × (1 + s / (1 − d)), so extra levels still add, just less and less. In Compounding, percentages multiply; training speed and attack interval compound on their own base, and flat values stay linear.

The Ungodly Diplomacy Research settings window on the Stacking tab: Stacking Mode Linear, Per-Level Strength 1, Diminishing Factor 0.85.View full size 1920 × 1080
The Stacking tab: how extra levels add up, as Linear, Diminishing or Compounding.

Research levels never stop, but each stat stops growing once it reaches its cap. If several researches push the same stat past a cap, only the stacked extra is scaled down; vanilla bonuses are never touched. Raise any cap on the Safety Caps tab.

The Ungodly Diplomacy Research settings window on the Safety Caps tab: Max Damage Bonus 500%, Max Range Bonus 100%, Min Attack Interval 30%, Max Health Bonus 1000%, Max Regeneration Bonus 1000%.View full size 1920 × 1080
The Safety Caps tab: the most any stat can grow from stacked levels. Levels never stop, but each stat stops at its cap.

Prices and research times grow with the repeat curves on the Costs tab and stop growing at Max Cost Multiplier and Max Time Multiplier, so later levels keep costing that ceiling. The population cost is left alone by default.

Research Mastery

Every finished research level gives mastery XP:

XP for one finished level
XP Per Research Level × (1 + Tier Bonus × tier) × (1 + Level Bonus × (level − 1))
  • The XP needed for each mastery level uses the Advanced Leveling System formula you pick: Linear, SineWave, Exponential, Quadratic, Logarithmic, Root, Fibonacci, Geometric, Cubic or Custom. Custom is next = previous × (1 + Growth × level^Exponent).
  • Every mastery level above 1 adds research speed, a discount on repeat levels and stacking potency, each with its own cap.
  • Mastery Max Level (2 to 200, default 30): at the maximum, extra XP is ignored, the XP bar shows MAX and a Research Mastery MAXED popup appears. Research itself keeps levelling.
  • Mastery is recalculated from your saved research levels on every load and every settings change, so it can never drift out of sync.
The Ungodly Diplomacy Research settings window on the Mastery tab: Research Mastery Enabled ON, Mastery Max Level 30, Mastery Base Required XP 100, Mastery Leveling Formula Linear.View full size 1920 × 1080
The Mastery tab: Research Mastery levels up from finished research, using the Advanced Leveling System formulas.

Saves

  • Levels are written into the game's own save as repeated research ids. Every research level above 1 adds exactly 4 bytes to the save.
  • The game loads saved research ids into a set, so the duplicates are harmless. Without this mod, the same save simply loads each research as completed once.
  • The game's version-15 migration runs before research loading, so only saves newer than version 15 are read as carrying levels.

The config file

BepInEx writes BepInEx\config\com.stixsworldhd.ungodlydiplomacyresearch.cfg the first time the game starts with the mod. Above every setting it repeats the range, default and explanation from the window. This is how the file begins:

BepInEx\config\com.stixsworldhd.ungodlydiplomacyresearch.cfg
## Settings file was created by plugin Ungodly Diplomacy Research v1.2.0
## Plugin GUID: com.stixsworldhd.ungodlydiplomacyresearch

[1. General]

## Min: any single key | Max: any key plus modifier keys (Ctrl/Alt/Shift) | Default: F9
## Opens and closes the Ungodly Research window. While it is open the mouse cursor is shown and unlocked, the game ignores clicks and mouse-wheel zoom over the window, and when you close it the cursor is handed back to the game exactly as it was (confined to the game window, or locked and hidden while you directly control a unit). Works together with the Ungodly Diplomacy AI window (F8).
# Setting type: KeyboardShortcut
# Default value: F9
Menu Key = F9

## Min: false (off) | Max: true (on) | Default: true
## Master switch. ON: completed unit research can be researched again and again with no level limit, every level stacks its bonuses, prices and times scale per level and Research Mastery is active. OFF: the game's original research rules return instantly (prices, times and bonuses snap back to vanilla, even mid-mission). Your research levels are still kept in your saves, so switching it back ON restores them.
# Setting type: Boolean
# Default value: true
Mod Enabled = true

…
  • Edit it with the game closed. The mod saves the file when you close the F9 window and every few seconds while it's open, so edits made while the game runs can be overwritten.
  • Use a dot for decimals, such as 0.85, whatever your Windows region settings.
  • Keep each number between the Min and Max listed above it; for choices, use one of the listed options exactly.
  • To reset everything, delete the file while the game is closed. The next start writes a fresh one with every default.

General

6 settings on the General tab, stored under [1. General] in the config file.

SettingDefaultRangeWhat it does
Menu KeyF9Any key, optionally with Ctrl, Alt or ShiftOpens and closes the Ungodly Research window. While it is open the mouse cursor is shown and unlocked, the game ignores clicks and mouse-wheel zoom over the window, and when you close it the cursor is handed back to the game exactly as it was (confined to the game window, or locked and hidden while you directly control a unit). Works together with the Ungodly Diplomacy AI window (F8).
Mod EnabledONON or OFFMaster switch. ON: completed unit research can be researched again and again with no level limit, every level stacks its bonuses, prices and times scale per level and Research Mastery is active. OFF: the game's original research rules return instantly (prices, times and bonuses snap back to vanilla, even mid-mission). Your research levels are still kept in your saves, so switching it back ON restores them.
GUI Scale10.75 to 2.5, in steps of 0.05Size of this settings window. It already grows with your screen resolution; raise it if the text is still too small (for example on a 4K screen), lower it for a more compact window.
Level-Up PopupsONON or OFFON: a small banner fades in at the top of the screen when a research reaches a new level or your Research Mastery levels up, then floats up and fades away. It never blocks clicks. OFF: level-ups are only written to the BepInEx log.
Popup Duration41 to 15, in steps of 0.5How many seconds a level-up popup stays fully visible before it floats away. Higher = more time to read it; lower = less screen clutter during battles.
Error Fallback Threshold251 to 500, whole numbersSafety net. If the research engine hits this many errors inside one half-second check, it switches itself off and the game's original research rules take over, so your mission keeps running. Lower = bails out sooner; higher = tolerates rare hiccups. Use 'Clear faults' on the Status tab to turn it back on.

Repeatable

6 settings on the Repeatable tab, stored under [2. Repeatable Research] in the config file.

SettingDefaultRangeWhat it does
Repeat Unit Offense ResearchONON or OFFON: research that raises unit damage, attack speed, attack range, flat damage, splash radius, tower-garrison damage/range and siege damage can be researched again after it is finished, and every extra level stacks on top. OFF: these stay one-time researches like vanilla.
Repeat Unit Defense ResearchONON or OFFON: research that raises the health, flat health and health regeneration of units can be repeated and stacks per level. OFF: one-time only, like vanilla.
Repeat Unit Mobility & Training ResearchONON or OFFON: research that makes units move, turn and accelerate faster, trains them faster, or widens their sight radius can be repeated and stacks per level. OFF: one-time only.
Repeat Unit Ability ResearchONON or OFFON: research that improves unit abilities (healing power, ability duration and cooldown, area of effect, cast range, number of summoned units) can be repeated and stacks per level. OFF: one-time only.
Repeat Structure ResearchOFFON or OFFON: research that raises the health, regeneration or sight radius of buildings, walls, gates and towers can also be repeated and stacked. OFF (default): buildings keep the vanilla one-time bonuses, so only units get stronger with repeated research.
Show Levels In Research PanelONON or OFFON: research tooltips, the current-research banner and the research info panel show the level (for example 'Lv 3 -> 4') plus the stacked effect multiplier, and the price and time shown are the real scaled ones. OFF: vanilla titles (prices and times shown are still the real scaled ones).

Stacking

3 settings on the Stacking tab, stored under [3. Effect Stacking] in the config file.

SettingDefaultRangeWhat it does
Stacking ModeLinearOne of: Linear, Diminishing or CompoundingHow extra levels add up. Linear: every extra level adds the same amount again (level 5 = 5x the first bonus at full strength). Diminishing: each extra level adds a little less than the one before, so bonuses flatten out. Compounding: percentage bonuses multiply on top of each other (+10% becomes x1.1 x1.1 x1.1...), which grows fastest at high levels; flat bonuses stay linear.
Per-Level Strength10.05 to 3, in steps of 0.05How much of the first level's bonus every extra level adds. 1.0 = each extra level adds the full original bonus again; 0.5 = half of it; 2.0 = double. Higher = each level feels much bigger; lower = smaller, finer steps.
Diminishing Factor0.850.1 to 0.99, in steps of 0.01Only used by Diminishing mode: every extra level adds this fraction of what the previous level added. 0.85 = each step is 85% of the last one. Higher = bonuses keep growing for longer; lower = bonuses stop growing after a few levels.

Costs

16 settings on the Costs tab, stored under [4. Cost Scaling] in the config file.

SettingDefaultRangeWhat it does
Base Research Cost Multiplier10.1 to 10, in steps of 0.05Multiplies the price of EVERY research, including the very first time you research it. 1.0 = vanilla prices. Higher = research is a bigger economic investment; lower = cheaper research for a faster tech race.
Repeat Cost CurveExponentialOne of: Linear, Exponential, Polynomial or AdvancedLevelingHow the price of each extra level grows. Linear: +Growth of the base price per level. Exponential: x(1+Growth) per level, rising faster and faster. Polynomial: base x (1 + Growth x level^Exponent). AdvancedLeveling: uses the Advanced Leveling System level-up formula chosen below (Linear, SineWave, Exponential, Quadratic, Logarithmic, Root, Fibonacci, Geometric, Cubic or Custom).
Repeat Cost Growth0.50 to 5, in steps of 0.05Growth rate used by the Linear, Exponential and Polynomial cost curves. With Exponential 0.5 the 2nd level costs x1.5, the 3rd x2.25, the 4th x3.4 of the base price. 0 = every level costs the same. Higher = late levels get expensive quickly.
Repeat Cost Exponent21 to 4, in steps of 0.1Only used by the Polynomial cost curve: the power the level is raised to. 1 = straight line, 2 = gentle curve that bends upward, 4 = very steep late levels.
Cost Leveling FormulaLinearOne of: Linear, SineWave, Exponential, Quadratic, Logarithmic, Root, Fibonacci, Geometric, Cubic or CustomOnly used when the cost curve is AdvancedLeveling: which Advanced Leveling System formula shapes the price growth. Linear/Geometric/Exponential grow smoothly to fast, Quadratic and Cubic explode quickly, Root and Logarithmic grow slowly, SineWave wobbles, Fibonacci follows the Fibonacci sequence, Custom uses the Custom Formula settings on the Research Mastery tab.
Cost Leveling Multiplier1.51.1 to 100, in steps of 0.05The Advanced Leveling System 'level-up multiplier' used by the cost formula above (same 1.1 - 100 range as the original asset). Higher = steeper price growth. Prices are always limited by Max Cost Multiplier.
Max Cost Multiplier501 to 1000, in steps of 1Hard ceiling: no research level ever costs more than this many times its base price, whatever curve you use. Lower = late levels stay affordable; higher = a real late-game resource sink.
Price Rounding Step51 to 100, whole numbersScaled prices are rounded UP to a multiple of this number so they stay tidy (5 turns 143 into 145). 1 = exact prices.
Scale Population CostOFFON or OFFON: if a research costs population (citizens), that part grows with the level too. OFF (default): only resources (food, wood, stone, iron, gold, souls, bones, spirit, death metal and the other resource types) scale, so research never eats your workforce.
Base Research Time Multiplier10.1 to 10, in steps of 0.05Multiplies the research time of EVERY research, including the first time. 1.0 = vanilla times. Lower = faster research; higher = slower, more deliberate research.
Repeat Time CurveLinearOne of: Linear, Exponential, Polynomial or AdvancedLevelingHow the research time of each extra level grows (same curve types as the cost curve).
Repeat Time Growth0.250 to 5, in steps of 0.05Growth rate for the time curve. With Linear 0.25 every extra level takes 25% of the base time longer than the one before. 0 = every level takes the base time.
Repeat Time Exponent1.51 to 4, in steps of 0.1Only used by the Polynomial time curve: the power the level is raised to.
Time Leveling FormulaRootOne of: Linear, SineWave, Exponential, Quadratic, Logarithmic, Root, Fibonacci, Geometric, Cubic or CustomOnly used when the time curve is AdvancedLeveling: which Advanced Leveling System formula shapes the time growth (Root grows slowly, which suits research time).
Time Leveling Multiplier1.21.1 to 100, in steps of 0.05The Advanced Leveling System level-up multiplier used by the time formula above. Times are always limited by Max Time Multiplier.
Max Time Multiplier101 to 100, in steps of 0.5Hard ceiling: no research level ever takes longer than this many times its base research time.

Safety Caps

14 settings on the Safety Caps tab, stored under [5. Safety Caps] in the config file.

SettingDefaultRangeWhat it does
Max Damage Bonus %50050 to 2000, whole numbersMost extra damage that stacked research levels may give one unit type, tower garrison or siege attack, on top of what vanilla research gives. 500 = at most +500% (6x damage). Stops armies from one-shotting everything.
Max Range Bonus %10010 to 500, whole numbersMost extra attack range and target-search range stacked research may add. 100 = at most double range. Keeps archers and towers from out-ranging the whole map (very long ranges also make target searches heavier).
Min Attack Interval %3010 to 100, whole numbersFastest attack speed allowed: the time between attacks can never drop below this percent of the unit's base attack time. 30 = at most about 3.3 attacks for every 1 attack at base speed. Protects animations and combat timing.
Max Health Bonus %100050 to 5000, whole numbersMost extra max health (percent) stacked research may give. 1000 = at most 11x base health.
Max Regeneration Bonus %100050 to 5000, whole numbersMost extra health regeneration (percent) stacked research may give.
Max Move Speed Bonus %1005 to 400, whole numbersMost extra movement, turning and acceleration speed stacked research may give. 100 = at most double speed. Very fast units can overshoot formations and bump through crowds.
Respect AI No-Teleport GuardONON or OFFON: when Ungodly Diplomacy AI's No-Teleport guard is active, stacked move speed is additionally kept below 90% of its Speed Tolerance, so the guard never mistakes your fast units for teleporting ones. OFF: only the cap above applies.
Max Training Speed-Up %8010 to 95, whole numbersMost training-time reduction stacked research may reach. 80 = training takes at least 20% of the base time (5x faster at most). Stops instant armies.
Min Ability Cooldown %255 to 100, whole numbersAbility cooldowns can never drop below this percent of their base cooldown. 25 = abilities can be used at most 4x as often.
Max Ability Bonus %30010 to 1000, whole numbersMost extra ability duration, area of effect, cast range and healing power stacked research may give. 300 = at most 4x.
Max Extra Summons100 to 50, whole numbersMost extra creatures that stacked research may add to one summon ability (on top of vanilla). Big swarms cost CPU and pathfinding time.
Max Splash Radius Bonus %20010 to 1000, whole numbersMost extra splash (area damage) radius stacked research may give to projectiles. 200 = at most 3x the base radius.
Max Vision Bonus %10010 to 500, whole numbersMost extra sight radius (fog of war reveal) stacked research may give. 100 = at most double sight.
Max Flat Bonus Scale201 to 100, whole numbersFlat bonuses (for example '+2 damage' or '+50 health') may grow to at most this many times what vanilla research gives. 20 = a +2 damage research tops out at +40.

Mastery

17 settings on the Mastery tab, stored under [6. Research Mastery] in the config file.

SettingDefaultRangeWhat it does
Research Mastery EnabledONON or OFFON: every finished research level gives Research Mastery XP. Mastery levels up with the Advanced Leveling System formulas and gives faster research, cheaper repeat levels and stronger stacking. Mastery is recalculated from your saved research levels on every load, so it can never get out of sync. OFF: no mastery bonuses.
Mastery Max Level302 to 200, whole numbersHighest Research Mastery level (the Advanced Leveling System default is 30). At max level extra XP is ignored and the XP bar is full.
Mastery Base Required XP10010 to 100000, whole numbersXP needed to go from mastery level 1 to 2 (the Advanced Leveling System 'required experience', default 100). Every later level uses the formula below.
Mastery Leveling FormulaLinearOne of: Linear, SineWave, Exponential, Quadratic, Logarithmic, Root, Fibonacci, Geometric, Cubic or CustomAdvanced Leveling System formula for how much XP each next mastery level needs: Linear (x multiplier each level), SineWave, Exponential, Quadratic, Logarithmic, Root, Fibonacci, Geometric, Cubic or Custom (uses the Custom Formula settings below). Steeper formulas make high mastery levels rare.
Mastery Level-Up Multiplier1.11.1 to 100, in steps of 0.05The Advanced Leveling System level-up multiplier (1.1 - 100, default 1.1). Higher = each mastery level needs much more XP than the last.
Custom Formula Growth0.250 to 10, in steps of 0.05Used whenever a formula is set to Custom (mastery, cost or time): next requirement = previous x (1 + Growth x level^Exponent). 0 = every level needs the same amount.
Custom Formula Exponent1.50.5 to 4, in steps of 0.1Used whenever a formula is set to Custom: the power the level is raised to. Higher = the Custom curve bends upward faster.
XP Per Research Level401 to 10000, whole numbersBase Research Mastery XP for finishing one research level (first-time research counts too).
XP Tier Bonus0.50 to 5, in steps of 0.05Extra XP for higher-tier research: tier 2 gives +1x this, tier 3 gives +2x this. 0.5 = tier 2 gives 1.5x XP, tier 3 gives 2x XP.
XP Level Bonus0.250 to 5, in steps of 0.05Extra XP for every research level above the first: level 5 of a research gives 1 + 4 x this times the base XP. Rewards pushing research high.
Research Speed Per Mastery Level0.020 to 0.25, in steps of 0.005Every mastery level above 1 makes ALL research this much faster (0.02 = +2% speed per level).
Max Mastery Speed Bonus0.50 to 3, in steps of 0.05Cap on the mastery research-speed bonus (0.5 = at most +50% research speed).
Repeat Discount Per Mastery Level0.010 to 0.1, in steps of 0.005Every mastery level above 1 makes repeat research levels this much cheaper (0.01 = 1% per level). First-time research is not discounted.
Max Mastery Discount0.40 to 0.9, in steps of 0.05Cap on the mastery price discount for repeat levels (0.4 = at most 40% cheaper).
Stacking Potency Per Mastery Level0.010 to 0.1, in steps of 0.005Every mastery level above 1 makes each stacked research level this much stronger (0.01 = +1% per level). Safety caps still apply.
Max Mastery Potency0.30 to 2, in steps of 0.05Cap on the mastery stacking-potency bonus (0.3 = stacked levels at most 30% stronger).
XP Bar Transition100 to 100, in steps of 1How smoothly the mastery XP bar fills in the window (Advanced Leveling System 'transition duration': 0 = instant, 10 = quick glide, 100 = slow glide).

Coroutines

3 settings on the Coroutines tab, stored under [7. Coroutines] in the config file.

SettingDefaultRangeWhat it does
Run Game Coroutines On MEC ProONON or OFFON: the game's own coroutines (UI animations, loading steps, cutscene helpers) run on More Effective Coroutines Pro, which creates less garbage and fewer frame spikes. When Ungodly Diplomacy AI is installed with its own MEC redirect switched on, that mod handles this and this setting waits in the background, so the two never double-run anything. OFF: Unity's coroutine scheduler is used.
Log Redirected CoroutinesOFFON or OFFON: writes a log line for every game coroutine moved to MEC Pro (useful for troubleshooting, noisy). OFF: silent.
Watcher Interval (s)0.250.1 to 2, in steps of 0.05How often (real-time seconds) the MEC Pro watcher checks the Ungodly Diplomacy AI state, applies settings you changed and keeps the menu alive. Lower = reacts faster; higher = a tiny bit less CPU.