Workers need to stop leaving assigned workplaces

  • 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.

Lycrist Katkiller

Colonel
26 Badges
Feb 9, 2017
980
4
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Imperator: Rome Sign Up
  • Surviving Mars: First Colony Edition
  • Crusader Kings II: Holy Fury
  • Surviving Mars: First Colony Edition
  • Surviving Mars: Digital Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Surviving Mars
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
Thank you, your video and save was useful and I examined the status of various things under the hood as the game was playing and your issues are pretty unique as I think they only really occur because of how few workslots are present in the small spacebar, aswell as no unemployed in general. I can now see your issue more clearly as I have seen an assigned worker, replaced with another assigned worker who was fired and can recreate this. I don't think your descriptions so far explained the issue clearly as it wasn't random colonists taking the jobs, it was ones who had been previously assigned there and fired.


As I said a colonist has an assigned workplace. This remains until they find a new job, so firing them doesn't actually remove this value. Them getting a new job does. This means they can rejoin that job if the worker pool is recalculated. Now various things can trigger a recalculation of the workforce, and when this happens, because more than one colonists is still set as assigned, sometimes the fired worker (if still unemployed) is taking priority and getting their job back. Usually I think another, normal worker would be displaced however I am abit surprised at some of the behaviour and looking at the code I do think I can see some mistakes.

This leads me to concede that I think there might be a bug here, but its more about the fired workers behaviour and it just occurs under such extremely narrow circumstances its gone completely unnoticed as it requires a work shift with a very low number of workers and multiple workers assigned to it trying to fill the slot. Usually this doesn't happen as most people only micro a couple of workers in each building, usually to move a low sanity worker away for example.

The issue is two fold, a colonist not losing their assigned workplace when fired, and functionality to 'avoid' a workplace seemingly not functioning.

Code:
function Colonist:GetFired()
    if not self.workplace then
        return
    end
    self:SetWorkplace(false)
    self.avoid_workplace = self.workplace
    self.avoid_workplace_start = self.city.day
    self:ChangeWorkplacePerformance()
end

The following code here doesn't make much sense, the code will always exit. If a colonist is fired then self.workplace cannot return nothing or false as you cannot fire a worker not in a workplace.
Even if you do get to the rest of the code its still wrong. Self:SetWorkplace(false) will clear the assigned workplace so the value in self.avoidworkplace will always be false.
Again this doesn't make sense.

If you are willing to put our arguments here aside, I believe I can fix it if you are willing to test it and see if there are weird behaviours elsewhere. You will need a mod to correct it, I can upload on Paradox or on Steam?
I'm going to just check with some more experienced modders too, to see if they have ever seen this.

Since I was never interest in this argument in the first place, i am more than happy to end it. Although... now I actually have to play and can not longer lurk in the forums.
However, you did point that the colonist talking the job is not random but rather a colonist who had been assigned to the job before. That is something I did not notice before. With this missing piece we could finally figure out that this can not be considered working as intented.

Any plattform is good. I assume you already saw that I posted in the bug report forum, so i hope the issue can be fixed. On the plus side is also that I know what causes the issue and can simply avoid it by not firing people who have an assignment but rather assign them somewhere else.


Edit: oh, an assigning renegades definitely looks like a bug. I didn't look into that yet.

yeah. but shhhhhh; don't tell anyone. It's my little secret.
 
  • 1Like
Reactions:

Lycrist Katkiller

Colonel
26 Badges
Feb 9, 2017
980
4
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Imperator: Rome Sign Up
  • Surviving Mars: First Colony Edition
  • Crusader Kings II: Holy Fury
  • Surviving Mars: First Colony Edition
  • Surviving Mars: Digital Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Surviving Mars
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life

Try that out for fixing the firing of workers so they will avoid that workplace and lose any assignment they previously had, even if they are unemployed.

Please give any feedback if you see any weird behaviour.

I'll give it a try once I got annoyed with my current colony because of RNGesus... see attached screenshots if you wonder why I actually sometimes struggle with colonies.
Why RNGesus? Why?
 

Attachments

  • 20210605151953_1.jpg
    20210605151953_1.jpg
    491,7 KB · Views: 0
  • 20210605151956_1.jpg
    20210605151956_1.jpg
    495,2 KB · Views: 0
Last edited: