Results 1 to 9 of 9

Thread: Unit Recruitment Pool Limit - Crashing

  1. #1
    4zumi's Avatar This one sparks joy
    Join Date
    Feb 2015
    Location
    HRE - Aquis Mattiacis
    Posts
    1,239

    Default Unit Recruitment Pool Limit - Crashing

    Hey,

    I have a quick question.

    I want to have all units recruitable from, one building.
    But I am running into a crash (log is not helpful).

    It seems, that if I have a certain number of units at the "city" level of the recruitment building, it crashes. I have more units at the upper levels, and when I delete a certain number at the city level it does not crash anymore.

    Furthermore the crash occurs at certain factions, but I can not put my finger on it why and how.

    Is there some known unit pool limit for a single building/settlement?

    Thanks and have a nice day
    -zumi
    Proudly under the patronage of King Athelstan of the Imperial House of Hader

    Author of
    Total Vanilla Beyond mod for Medieval 2 - Kingdoms &
    Developer of
    Total Bananas mod for Medieval 2 - Kingdoms (beta)

    Steam Workshop Mods for Rome 2, Warhammer, Warhammer 2

    Discord: zumi's cookie corner
    Fighting for launch of "Cookie Friday" and "No Pants Saturday"

  2. #2

    Default Re: Unit Recruitment Pool Limit - Crashing

    Yes! Its harcoded limited! How many units do you have in your edu?

  3. #3

    Default Re: Unit Recruitment Pool Limit - Crashing

    There is a limit of 32 active recruit_pool lines per building level. An 'active' EDB effect is one for which all conditions are met at the same time for any given faction.

  4. #4
    4zumi's Avatar This one sparks joy
    Join Date
    Feb 2015
    Location
    HRE - Aquis Mattiacis
    Posts
    1,239

    Default Re: Unit Recruitment Pool Limit - Crashing

    @Callistonian
    Thanks - Thats what I needed to know. Drove me crazy.
    Could I circumvent the limit by using 2 seperate buildings, and so doubling the units possible to recruit.
    And one short for clarity: Does any given faction mean all factions that could possibly recruit or just the active faction at the time. For example "I have 64 units at the second building level, Faction 1 could recruzit or replenish 31 Faction 2 could recruit or replenish 33." If I have understood correctly the game would crash when Faction 2 has its turn, but not Faction 1?

    Thanks

    Edit: And I think I shot myself in the foot by wanting to make the exp desc buildings really neat and orderly and giving every unit one seperate unit entry...

    Edit 2: After some trys, I can say it is not the seperate recruit_pool entries, it really depends on every possible unit recruitable by every possible faction. Furthermore I think it is a settlement limit and not a building limit, as the game will crash regardless if I move the "too much" units to another building.

    Edit 3: SOLUTION!
    I found the bane of the day: It was not a hardcoded limit, it was an error that occured because of a condition

    recruit_pool "Templar Crossbowmen" 1 0.5 2 0 requires factions { england, } and building_present_min_level guild_templars_chapter_house templars_minor_ch and event_counter not_pagan_norway 1

    it was the and building present. This leads to a crash, when the building is not present....
    Last edited by 4zumi; January 25, 2024 at 05:21 AM.
    Proudly under the patronage of King Athelstan of the Imperial House of Hader

    Author of
    Total Vanilla Beyond mod for Medieval 2 - Kingdoms &
    Developer of
    Total Bananas mod for Medieval 2 - Kingdoms (beta)

    Steam Workshop Mods for Rome 2, Warhammer, Warhammer 2

    Discord: zumi's cookie corner
    Fighting for launch of "Cookie Friday" and "No Pants Saturday"

  5. #5
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Unit Recruitment Pool Limit - Crashing

    Correct me if I'm wrong, but also there's a limit for 64 active pools per region at all?

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  6. #6

    Default Re: Unit Recruitment Pool Limit - Crashing

    Quote Originally Posted by 4zumi View Post
    Could I circumvent the limit by using 2 seperate buildings, and so doubling the units possible to recruit.
    Yes.

    Quote Originally Posted by 4zumi View Post
    And one short for clarity: Does any given faction mean all factions that could possibly recruit or just the active faction at the time. For example "I have 64 units at the second building level, Faction 1 could recruzit or replenish 31 Faction 2 could recruit or replenish 33." If I have understood correctly the game would crash when Faction 2 has its turn, but not Faction 1?
    If Faction 2 has access (all conditions in EDB satisfied) to those 33 recruit_pool lines from a single building at the start of the campaign, then the game will crash with nothing in the log when you press the start campaign button. If you, for example, add an event_counter condition to the 33rd recruit_pool line and only set that event counter to 1 at the start of turn 2, the game will crash as soon as you set the event counter to 1, because now Faction 2 has 33 active recruit_pool lines from one building. The event_counter condition is just an example, this goes for any other EDB condition. As soon as the conditions are met, the recruit_pool line will count against the faction's 32 limit.

    Quote Originally Posted by 4zumi View Post
    Edit 2: After some trys, I can say it is not the seperate recruit_pool entries, it really depends on every possible unit recruitable by every possible faction. Furthermore I think it is a settlement limit and not a building limit, as the game will crash regardless if I move the "too much" units to another building.
    No, the limit of 32 active recruit_pool lines per building level is known and well-documented in the community. There are lots of threads about this here on TWC and I've tested it many times myself.

    I am not aware of any limit on the number of recruit_pools per settlement/region, aside from the limit implied by the 32 per chain and the limit of 128 chains, which gives a theoretical limit of 4096.

    Quote Originally Posted by 4zumi View Post
    Edit 3: SOLUTION!
    I found the bane of the day: It was not a hardcoded limit, it was an error that occured because of a condition

    recruit_pool "Templar Crossbowmen" 1 0.5 2 0 requires factions { england, } and building_present_min_level guild_templars_chapter_house templars_minor_ch and event_counter not_pagan_norway 1

    it was the and building present. This leads to a crash, when the building is not present....
    This is a completely separate and also a well-known bug. The building_present_min_level condition does not work for recruit_pool lines in EDB if that building level also has any other effects aside from recruit_pool. E.g. if you have a recruit_pool line with this condition and a happiness_bonus effect, the game will crash. It doesn't matter if the building tested in the condition is present in the settlement or not. Same applies to the building_present condition (which checks if any level of the chain is present).

    Interestingly, neither building_present not building_present_min_level appear to be satisfied when only the first level of any building chain tested is present in the settlement. Maybe somebody else can confirm that for us...

  7. #7
    4zumi's Avatar This one sparks joy
    Join Date
    Feb 2015
    Location
    HRE - Aquis Mattiacis
    Posts
    1,239

    Default Re: Unit Recruitment Pool Limit - Crashing

    Thanks for the info
    Sadly it was not well known to me and if I don't know why the bug occurs it is a bit hard to search for something, even if it is well documented.
    Never stumbled uppon the building_present thing in the first place, because I did not use it with another building bonus...

    Is there some thread where bugs like these are listed. All I know of is the Bugs and how to fix them list...
    But maybe I am blind.

    Anyway. Much thanks, this made some things really clear after a bit of an absence with modding
    Proudly under the patronage of King Athelstan of the Imperial House of Hader

    Author of
    Total Vanilla Beyond mod for Medieval 2 - Kingdoms &
    Developer of
    Total Bananas mod for Medieval 2 - Kingdoms (beta)

    Steam Workshop Mods for Rome 2, Warhammer, Warhammer 2

    Discord: zumi's cookie corner
    Fighting for launch of "Cookie Friday" and "No Pants Saturday"

  8. #8

    Default Re: Unit Recruitment Pool Limit - Crashing

    I don't know if either of these limitations were added to any formal guides. Honestly, these are the sort of things that are just tribal knowledge around here. You can find comments on them here, here, and here, but you would already have to know what you're looking for to find these comments.

    A crash that appears to happen at a random point in the campaign (unbeknownst to you, because some random line in EDB had all its conditions met) with nothing useful in the log is a nightmare scenario for any modder. It was fortunate that you hadn't paired the recruit_pool lines with other conditions so that the crash happened as soon as you launched the campaign which directed your attention immediately to the recruit_pool edits you'd just made.

    I document crashes I encounter but I find this to be somewhat of a ritual exercise, more useful for other people than for myself because the crashes I encounter are always novel and undocumented. Good, systematic testing, eliminating all but one variable at a time, is required to resolve these.

  9. #9
    Razor's Avatar Licenced to insult
    Join Date
    Apr 2004
    Location
    Deventer, The Netherlands
    Posts
    4,075

    Default Re: Unit Recruitment Pool Limit - Crashing

    Quote Originally Posted by 4zumi View Post
    Thanks for the info
    Sadly it was not well known to me and if I don't know why the bug occurs it is a bit hard to search for something, even if it is well documented.
    Never stumbled uppon the building_present thing in the first place, because I did not use it with another building bonus...

    Is there some thread where bugs like these are listed. All I know of is the Bugs and how to fix them list...
    But maybe I am blind.

    Anyway. Much thanks, this made some things really clear after a bit of an absence with modding

    This kind of information really should be gathered into one file, listing the do's and don'ts/bugs of every file, before the knowledge is lost.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •