Three job weight corrections, code included

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

SpreadsheetGamer

Second Lieutenant
34 Badges
Sep 24, 2017
105
203
  • Stellaris - Path to Destruction bundle
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Prison Architect
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Stellaris: Distant Stars
  • Surviving Mars: Digital Deluxe Edition
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Surviving Mars
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Synthetic Dawn
  • Cities in Motion 2
  • Europa Universalis IV: Res Publica
  • Magicka
  • Hearts of Iron III
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • Europa Universalis IV: Art of War
Change #1

Indentured and Domestic slaves are special types of slavery that theoretically allow them to work some specalist jobs. Due to the current weightings, they will displace all other farmers, miners and technicians first, displacing even driods and other slaves, even those who have relevant traits/upgrades (such as Agrarian). The only situation where they will work in applicable specalist stratum jobs is if all farmer + miner + technician jobs are occupied by Indentured or Domestic slaves.

03_worker_jobs.txt, Line 826
Code:
modifier = {
            factor = 10
            is_enslaved = yes
            can_take_servant_job = no
        }

Change to:
Code:
modifier = {
    factor = 10
    is_enslaved = yes
    can_take_servant_job = no
    OR = {
        has_slavery_type = { type =  slavery_normal }
        has_slavery_type = { type =  slavery_military }
    }
}

Note
The changes also need to be applied to lines 320-324 and lines 166-176 to apply this fix for miners and technicians, respectively.



Change #2

The Syncretic Evolution origin grants a second species, and as slaves they have an abnormally high weight towards farming in particular. They will displace all other farmers, regardless of their own slavery type and regardless of the traits or slavery types of the other possible farmers. This appears to be an unintended repetition of of modifiers.

03_worker_jobs.txt, line 869-872
Code:
        modifier = {
            factor = 1.5
            has_trait = trait_syncretic_proles
        }
Delete this code block (see line 853 for duplicate modifier)



Change #3

A biological race that has robots (either through technology or the Mechanist origin) will find their robots will displace any worker in a strategic resource job, such as Mote Harvesting. This can be undesirable if the robot is better suited to a specific worker job such as farming or mining due to upgrades.

If a robot has a specialisation upgrade, it may be appropriate to reduce the job weighting for strategic resource jobs to allow other non-specalist robots or biologicals to take the job instead.

03_worker_jobs.txt, line 668 add the following modifier
Code:
modifier = {
    factor = 0.1
    OR = {
        has_trait = trait_robot_harvesters
        has_trait = trait_robot_propaganda_machines
        has_trait = trait_robot_domestic_protocols
        has_trait = trait_robot_superconductive
        has_trait = trait_robot_power_drills
        has_trait = trait_robot_emotion_emulators
        has_trait = trait_robot_logic_engines
    }
}

Note
This modifier also needs to be added after lines 558 and 451 to apply to Gas and Crystal jobs, respectively.


Big thanks to @abregado for taking the time to examine my bug reports, as well as coming up with these solutions and testing them. Unfortunately the bug reports are so old they don't seem to gather any traction on the bug report forum, but they are all still a problem in the current version of the game. These changes will probably help the AI with their economy, which is a nice bonus. Hopefully we can get some attention drawn to these easily fixable issues here.
 
Last edited:
  • 8
  • 6Like
  • 3
  • 1Love
Reactions:

Stardance

First Lieutenant
56 Badges
Apr 19, 2017
238
640
  • Europa Universalis IV: Cradle of Civilization
  • Age of Wonders III
  • Stellaris: Synthetic Dawn
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Stellaris: Necroids
  • Stellaris: Megacorp
  • Battle for Bosporus
  • Cities: Skylines - Campus
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall Premium edition
  • Age of Wonders: Planetfall Season pass
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall - Revelations
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Crusader Kings III
  • Europa Universalis IV
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: By Blood Alone
  • Victoria 3 Sign Up
  • Europa Universalis IV: Mare Nostrum
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Cadet
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Nemesis
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Conquest of Paradise
I’ve seen the displacement the robots do (addressed in change #3) in version 3.02, so I can confirm that one is happening. I didn’t realize it was a job weight issue. My robots had traits for +5% all productivity, so it didn’t impact my game much.
 
  • 3
Reactions:

Don_Quigleone

Field Marshal
87 Badges
Jan 19, 2007
5.019
2.133
  • Stellaris
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Cities: Skylines
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Divine Wind
  • Europa Universalis IV
  • Crusader Kings II
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
Another error for technicians:
modifier = { factor = 8 is_enslaved = yes can_take_servant_job = no NOR = { has_trait = trait_syncretic_proles has_trait = trait_nuumismatic_administration has_trait = trait_robot_superconductive has_trait = trait_ingenious }

Normally enslaved pops have higher priority for worker tier jobs. For technicians, this is not the case if you have the "ingenious" trait (which increases energy production). The NOR items should either be entirely removed, or replaced with an "OR".
 
  • 3Like
  • 3
  • 1
Reactions:

Oculument

Captain
1 Badges
Feb 10, 2020
338
763
  • Victoria 3 Sign Up
Change #3

A biological race that has robots (either through technology or the Mechanist origin) will find their robots will displace any worker in a strategic resource job, such as Mote Harvesting. This can be undesirable if the robot is better suited to a specific worker job such as farming or mining due to upgrades.

If a robot has a specialisation upgrade, it may be appropriate to reduce the job weighting for strategic resource jobs to allow other non-specalist robots or biologicals to take the job instead.

03_worker_jobs.txt, line 668 add the following modifier
Code:
modifier = {
    factor = 0.1
    OR = {
        has_trait = trait_robot_harvesters
        has_trait = trait_robot_propaganda_machines
        has_trait = trait_robot_domestic_protocols
        has_trait = trait_robot_superconductive
        has_trait = trait_robot_power_drills
        has_trait = trait_robot_emotion_emulators
        has_trait = trait_robot_logic_engines
    }
}

Note
This modifier also needs to be added after lines 558 and 451 to apply to Gas and Crystal jobs, respectively.
Regarding change 3, I usually avoid researching droid technology so this other block of code fires:

Code:
modifier = {
            factor = 200
            OR = {
                is_non_sapient_robot = yes
                is_shackled_robot = yes
            }
            can_take_servant_job = no
            owner = { NOT = { has_technology = tech_droid_workers } }

I think your suggested change will result in no effect for nonsapient robots, because factor 200 is so large.
 

SpreadsheetGamer

Second Lieutenant
34 Badges
Sep 24, 2017
105
203
  • Stellaris - Path to Destruction bundle
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Prison Architect
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Stellaris: Distant Stars
  • Surviving Mars: Digital Deluxe Edition
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Surviving Mars
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Synthetic Dawn
  • Cities in Motion 2
  • Europa Universalis IV: Res Publica
  • Magicka
  • Hearts of Iron III
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • Europa Universalis IV: Art of War
Normally enslaved pops have higher priority for worker tier jobs. For technicians, this is not the case if you have the "ingenious" trait (which increases energy production). The NOR items should either be entirely removed, or replaced with an "OR".
Something does seem off there, but I'm not sure it has any bad consequences. If an ingenious slave will take a mining or farming job over a technican job, then I would agree that it needs attention. Can someone verify that with a screenshot of the job priorities?
 

Oculument

Captain
1 Badges
Feb 10, 2020
338
763
  • Victoria 3 Sign Up
Something does seem off there, but I'm not sure it has any bad consequences. If an ingenious slave will take a mining or farming job over a technican job, then I would agree that it needs attention. Can someone verify that with a screenshot of the job priorities?
No screenshot handy, but I've seen it happen everytime. The presence of the NOR is also unusual, its the only one and it looks like a typo error. User WealthyAardvark made a post on r/Stellaris about it an presumably the same username here filed a bug report on it. It was his post that prompted me to start my own collection of fixes in a custom mod. His technician priority fix is in the Airphaos Unofficial Patch mod.
 
  • 2
Reactions:

Morfane

Sergeant
16 Badges
Dec 8, 2018
54
142
  • Cities: Skylines
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Stellaris: Synthetic Dawn
No screenshot handy, but I've seen it happen everytime. The presence of the NOR is also unusual, its the only one and it looks like a typo error. User WealthyAardvark made a post on r/Stellaris about it an presumably the same username here filed a bug report on it. It was his post that prompted me to start my own collection of fixes in a custom mod. His technician priority fix is in the Airphaos Unofficial Patch mod.
Does this mod have a link handy, by chance?
 

SpreadsheetGamer

Second Lieutenant
34 Badges
Sep 24, 2017
105
203
  • Stellaris - Path to Destruction bundle
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Prison Architect
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Stellaris: Distant Stars
  • Surviving Mars: Digital Deluxe Edition
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Surviving Mars
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Synthetic Dawn
  • Cities in Motion 2
  • Europa Universalis IV: Res Publica
  • Magicka
  • Hearts of Iron III
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • Europa Universalis IV: Art of War
I think your suggested change will result in no effect for nonsapient robots, because factor 200 is so large.
What it will do is allow a non-specalised robot to take the job. In the absence of a non-specalised robot, would you prefer a robot or a bio to take the job? That's not easy to answer for me because it depends on habitability and happiness. Given it is a worker stratum job, I would generally prefer a robot. As a min-maxer, I would eventually upgrade all my non-specalised robots to have efficient processors.
 

SpreadsheetGamer

Second Lieutenant
34 Badges
Sep 24, 2017
105
203
  • Stellaris - Path to Destruction bundle
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Prison Architect
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Stellaris: Distant Stars
  • Surviving Mars: Digital Deluxe Edition
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Surviving Mars
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Synthetic Dawn
  • Cities in Motion 2
  • Europa Universalis IV: Res Publica
  • Magicka
  • Hearts of Iron III
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • Europa Universalis IV: Art of War
I'm loath to do this, but hey @MrFreake_PDX this is my last attempt at getting these bugs fixed. I know there's a lot going on right now (as always) but I've spelled out the bugs and solutions, we have tested the solutions and they seem robust, so this is as easy as I can make it. Is there anything you can do to help? I haven't played Stellaris since January because of these bugs.
 

Faeelin

Field Marshal
79 Badges
Dec 15, 2001
7.274
2.444
Visit site
  • Stellaris: Galaxy Edition
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Victoria 2: Heart of Darkness
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Crusader Kings II
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For The Glory
  • Heir to the Throne
  • Europa Universalis III Complete
  • March of the Eagles
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Victoria 2
This explains a lot about how messed up the optimization in my slaver game was. Looking forward to seeing this post made again in 2 years..
 
  • 2Like
Reactions:

SpreadsheetGamer

Second Lieutenant
34 Badges
Sep 24, 2017
105
203
  • Stellaris - Path to Destruction bundle
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Prison Architect
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Stellaris: Distant Stars
  • Surviving Mars: Digital Deluxe Edition
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Surviving Mars
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Synthetic Dawn
  • Cities in Motion 2
  • Europa Universalis IV: Res Publica
  • Magicka
  • Hearts of Iron III
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • Europa Universalis IV: Art of War
So in 3.0.3, criminal jobs are also broken due to job weightings. Criminal jobs are often not filled at all, and if they are, you can avoid that by prioritising other jobs. I wonder if this will be the straw that breaks the camels back, convincing Paradox that job weights needs attention. All the bugs listed above are still in effect.
 
  • 1
Reactions: