Author Topic: Help with editing enemy numbers  (Read 1184 times)

Offline Whatever

  • Squaddie
  • *
  • Posts: 8
    • View Profile
Help with editing enemy numbers
« on: June 26, 2024, 06:54:58 pm »
Hello.
Firstly, I would like to thank the author(s) for this wonderful mod. I love how it expands the low-tier stuff and simulates humble beginnings, something mods rarely do.

Secondly
I'm currently trying to fine-tune enemy numbers in certain missions to my liking. Or maybe rather learn how to do it.

In particular, I want to start with changing the number of enemies in "apprehension" missions to be 1-3 on Experienced difficulty.
Minimum is already 1, so I opened the "alienDeployments_XCOMFILES" file, found the missions with "apprehension" type (4 of them) and in every one changed the "dQty" value from 0 to 2. Changed nothing else.

As far as I understand, this should change the number of enemies to 1-3 (1 minimum for "lowQty" + between 0 and 2 for "dQty".
Problem is, now the game always spawns 3 of them. Tried about 20 times and its always 3.

What am I doing wrong?


Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: Help with editing enemy numbers
« Reply #1 on: June 26, 2024, 08:36:58 pm »
You'll have to set difficultyDemigod=false

If you're editing XCF directly you can change it in the vars_XCOMFILES.rul file, if you're using a custom submod, you can place it on its own line without any indentation
Code: [Select]
difficultyDemigod: false
When this value is set to true, besides forcing all units to spawn even if out of spawn nodes, it will force the max value of dQty instead of making a roll, it basically has the same effect as defining lowQty:3 and dQty:0 but with extra pepper.

Offline Whatever

  • Squaddie
  • *
  • Posts: 8
    • View Profile
Re: Help with editing enemy numbers
« Reply #2 on: June 26, 2024, 09:11:06 pm »
Hey, it worked! Thanks!

Quote
When this value is set to true, besides forcing all units to spawn even if out of spawn nodes...

Does this lack of spawn nodes happen often? I understand that by turning it off I'm already lowering the baseline difficulty of the mod by making the game spawn less enemies than intended on average in most missions (unless I ramp up lowQty in every spawn by half of current dQty). I wouldn't want to break the mod by making like half of enemies not spawn in an epic endgame alien fortress siege or something.

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: Help with editing enemy numbers
« Reply #3 on: June 26, 2024, 09:45:50 pm »
It'll depend on the map and the mod, this should never happen if the map has a larger number of viable spawn nodes than its max unit count. The most likely scenario is in a base defense since the player could (knowingly) have a lower number of facilities that include nodes for aliens to spawn at, and once it uses them all up, any remaining units will be discarded.
« Last Edit: July 19, 2024, 12:42:51 pm by CrazedHarpooner »

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: Help with editing enemy numbers
« Reply #4 on: June 26, 2024, 11:05:15 pm »
Hmm, doesn't that essentially invalidate all uses of dQty in the deployments? Nothing is random anymore...

Worse, the ruleset reference makes no mention of it, so I suspect there may be quite a few modders who are unaware.

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: Help with editing enemy numbers
« Reply #5 on: June 26, 2024, 11:25:44 pm »
Yes, it essentially does. Basically, if a big mod sets this to true, it might as well set dQty to 0 and just set lowQty, highQty and if needed medQty in OXCE. It also 'invalidates' extraQty in that it also uses the max value and adds it to the total count.

And yes, I didn't see it explained in the ruleset referense either so I had to look it up in the repo:
https://github.com/OpenXcom/OpenXcom/blob/db2d8275f522d1f7f2f10fe2ca4316924b89a746/src/Battlescape/BattlescapeGenerator.cpp#L1081

Offline Whatever

  • Squaddie
  • *
  • Posts: 8
    • View Profile
Re: Help with editing enemy numbers
« Reply #6 on: June 26, 2024, 11:28:08 pm »
It'll depend on the map and the mod, this should never happen if the map has a larger number of viable spawn nodes than it's max unit count. The most likely scenario is in a base defense since the player could (knowingly) have a lower number of facilities that include nodes for aliens to spawn at, and once it uses them all up, any remaining units will be discarded.

Guess only the author would know how much does it impact this mod. Guess I'll up the difficulty to veteran to even things out and tweak the highQty so that apprehensions spawn 1-3 enemies even on veteran. Should be okeish balance for my needs.

Thank you very much for all the info!

Hmm, doesn't that essentially invalidate all uses of dQty in the deployments? Nothing is random anymore...

Worse, the ruleset reference makes no mention of it, so I suspect there may be quite a few modders who are unaware.

To an extend it seems so. At least in the few mission types I saw. But isn't there some reinforcement feature in the game in later missions or something? I'm completely new to X-COM modding, but I read somewhere about random reinforcements and the like.

Still, kinda weird to have random variable that is blocked to never be random. Browsing the deployments file I saw a few entries where the most of the enemies were in dQty, so without it some missions should very visibly spawn different numbers of enemies each time. Largest dQty I saw was like 8 and it were those modded human enemies.

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: Help with editing enemy numbers
« Reply #7 on: July 19, 2024, 12:46:51 pm »
One cavehat you can possibly expect is in gang wars or anything that has a 3rd faction, they also use the same spawn nodes and during my testing of scripts and new battles I've noticed them clumpling up around certain nodes. I expect that setting the demigod value to false will reduce their numbers on the map considerably as they seem to be spawned in after all the hostile units have and would very likely run out of spawn nodes with just a few units spawned in, if any even.