Can we talk about the methodology for job weights and fixing pop-job allocation?

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

Pancakelord

Lord of Pancakes
43 Badges
Apr 7, 2018
3.369
12.251
  • Cities: Skylines - Green Cities
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Ancient Relics
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Imperator: Rome
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Cities: Skylines Industries
  • Imperator: Rome Deluxe Edition
  • Cities: Skylines - After Dark
  • Stellaris: Nemesis
  • Europa Universalis IV
  • Stellaris: Necroids
  • Crusader Kings III
  • War of the Roses
  • Cities: Skylines
  • Stellaris: Federations
  • Magicka: Wizard Wars Founder Wizard
  • Cities: Skylines - Snowfall
  • Stellaris: Lithoids
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Stellaris - Path to Destruction bundle
  • Stellaris: Megacorp
  • Stellaris: Synthetic Dawn
  • Crusader Kings II
  • Stellaris
  • Cities: Skylines Deluxe Edition
  • Sword of the Stars II
  • March of the Eagles
  • Darkest Hour
So job weights, they are interesting. A huge amount of importance is placed on the "individual" - traits and strata (ironic, given the game uses planned economies, but I digress). Below, I look at how these job weights work to allocate pops - and why they fail to work when the number of jobs exceeds the number of pops, and how to fix this, by making pops think about national [resource] income, instead of (just) thinking about their own trait-suitability for a job.

Each job has a "base weight" value it pulls off, based on a static value (e.g. 1000 for rulers, 5 for criminals, 10 for any specialists, ive inserted foundry and artisan workers as an example below to indicate that their base weight is that of a specialist - and yes, clerks do have a relative negative weight - pops want to be criminals more than clerks, who can blame them lol).

1619743008717.png


But then, each job has "sub-weights" - factors (multiply base weight by X if Y is true) or additors (add to base weight by Z if K is true) etc. These largely boil down to one of 4 things
  1. species traits (e.g. smart pops want to be scientists)
  2. social class (e.g. academic privilege wants to be scientists)
  3. slavery (more manual tasks)
  4. Are you already in your job (to stop pops jumping around too much I guess).
  5. There are a few other things like are you voidborne, or is this a base energy/min/food job, but the above 4 (particularly #1 and #3) come up the most.
To help visualise this, this is what the weights look like [note am using an exponential left axis, to accentuate changes]
1 for a slave pop (10 > 20, as slaves have a factor of 2x)
2 for a slave + robust-trait pop (10 * 2 * 10 (2x for slave, 10x for robust)
1619743709562.png

So this is how, and why, some pops will prioritise certain jobs over other pops, based on their traits. There is no mystical AI at work, it is simply a giant conditional probability tree, with the pop picking the "most highly weighted" job (either 100% the time, or like 95% the time from what I can see).

But... Why go through all this effort?
  • Sure I get the idea behind selecting for traits, you individually make jobs efficient by matching the best pop (though not really always the case when you factor in strata limits and edge cases I wont go into, here).
  • But this effectively creates an NP complete situation with diminishing returns (do you really care if your charismatic slaves are working as entertainers or in the mines, when you have your 15th colony, so long as amenities are positive and the planet is stable? No, probably no)
  • This works fine for rulers (they all have 1000 weight, and there are not many to begin with, so they fill fast, and not too many traits matter for ruler jobs)
  • Likewise, this tends to work OK for workers, as you (pre 3.x) usually have enough to meet your base income needs
  • BUT this is actually quite bad for specialists. Specialist jobs compete to produce the 4 most vital (and hardest to evaluate based on circumstance) resources in the game - Admin Cap, Science, Consumer Goods and Alloys. Without a good balance of all 4 you lose. Pre 3.0 this wasnt much of an issue, but population issues in 3.x have started to reveal the cracks in job allocation.
What could be done about this? Enter "Country-income-adjusted weights"

So what do I mean by this? Well its simple. Job weights are all handled on the "individual level" - in the "pop scope" for modders out there. But its easy to make a pop ask... what
can I do for my country?
First, for reference, This is what the vanilla Artisan job weights look like

Code:
    weight = {
        weight = @specialist_job_weight
        modifier = {
            factor = 2
            is_enslaved = yes
            can_take_servant_job = no
        }
        modifier = {
            factor = 5
            has_job = artisan
        }
        modifier = {
            factor = 10
            has_job = artisan
            OR = {
                has_trait = trait_robust
                has_trait = trait_robot_efficient_processors
            }
        }
        modifier = {
            factor = 1.5
            has_trait = trait_void_dweller_1
        }

And this is what they could look like (see my 4 new blocks at the bottom) if they took your national (CG) income into account. In short, if youre short of CGs staffing artisan jobs should be a priority, whilst if you have 51+ CG income, stop staffing artisan jobs (unlike humans who will setup trades, or move pops around, this is needed as this way unemployed AI pops should go and find work elsewhere, i chose 50 CG income as the breakpoint as thats what the lategame AI economic plan targets)
Code:
    weight = {
        weight = @specialist_job_weight
        modifier = {
            factor = 2
            is_enslaved = yes
            can_take_servant_job = no
        }
        modifier = {
            factor = 5
            has_job = artisan
        }
        modifier = {
            factor = 10
            has_job = artisan
            OR = {
                has_trait = trait_robust
                has_trait = trait_robot_efficient_processors
            }
        }
        modifier = {
            factor = 1.5
            has_trait = trait_void_dweller_1
        }

        # if low on CGs get artisans in the factory
        modifier = {
            factor = 100
            owner = { has_monthly_income = { resource = consumer_goods value < 6 } } #default production is 6 min = 6 cgs
        }

        # if low on CGs get artisans in the factory
        modifier = {
            factor = 20
            owner = { has_monthly_income = { resource = consumer_goods value < 12 } } #default production is 6 min = 6 cgs
        }

        # if low on minerals, but have enough CGs, reduce artisans
        modifier = {
            factor = 0.5
            owner = {
                AND = {
                    has_monthly_income = { resource = minerals value < 6 }
                    has_monthly_income = { resource = consumer_goods value > 12 } #default production is 6 min = 6 cgs
                }
            }
        }

        # There is literally no point in running a surplus this big, as this is what the "default" AI Econ plan targets.
        modifier = {
            factor = 0.001
            owner = {
                AND = {
                    is_ai = yes #only AI-nation pops should cut back at 50+ CGs, some humans may want more, for some reason.
                    has_monthly_income = { resource = consumer_goods value > 50 }
                }
            }
        }
    }

But does this work?

Yes,
with some very quick testing. I have created a rough map filter that shows national cg income for each nation in observer mode.
Scale: grey = <10 CG income, red is 10-20, orange is 20-30, green is anything more than that, basically, i need to make it a smother scale
1619744463615.png
Start of test
1619744382746.png
3 years later

See how the empire in the top left is very green and became less green over time(it produced fewer CGs)? This is because, it started with +65cg output [this is the one i'd been playing], in the next frame it had dropped to +47 CG output [adhering to my ~50CG limit for AI nations] but as a trade off that empire increased alloy output by 20 (by me manually checking) This is because there were more jobs than pops to work them all, so the pops re-shuffled themselves over to forge jobs once the 50-CG cap had been hit and they didnt need to be artisans.

You also see several nations have become lighter shades of red, or moved in to orange [meaning higher monthly CG income] - these were the ones with excess industrial capacity but insufficient pops to work all jobs (so there was room for pops to immediately jump to working as artisans). This indicates that pops understood their national income weights and moved to CG production as needed.
Countries that remained in grey (i.e. no CG output improvement) Lacked extra industrial capacity (i.e. they didnt have many extra free industrial jobs for pops to move between). With more time most of the galaxy would become green (high positive CG income).

TLDR:
The above evidence is illustrative of the fact that these income-adjusted pop-job weights DO work to fix the AIs shortcomings with resource production IF it has more jobs than pops. if it has less (or parity) jobs than pops, the issue remains with it picking and choosing the right districts/buildings - which it usually does an OK job at - if it is able to have a population that intelligently assigns itself to jobs that best boost their nation.

  • Whilst ive not looked into it yet, it may be possible to flip colony specs (factory / forge) based on country income, too, to further help the AI figure out how to get an output of 6~50 CGs per month (using my earlier values)

So why not post this in the 3.0.3 beta threads?
Simple, pdx want to test their current changes, and have asked that people dont test with mods or non-vanilla setups, which is fine and good for controlling data incoming on the changes they've already made.

But, hopefully the devs will see this and start to think about making pops work the jobs that are best for their country, not just what is best based on their traits. Prioritising National income levels is more important than dogpiling a job, just because you've got the right traits for it (especially for AI nations that cant react/disable jobs like players can).
 
Last edited:
  • 29Like
  • 11
  • 6Love
  • 1
  • 1
Reactions:
AI mods often have done something similar to what is suggested however there is an issue:

All pops simultaneously update their weights when using resource income.
This cause pops to flip flop back and forth as a group between jobs. At first there's too few pops working a job then to many and then it repeats.

In fact the the vanilla AI even uses the job "focus" to alter job weights (focus just puts a large additive boost to the job weight) which is supposed to help it get the pops in the jobs it needs (Note: the weight boost isn't enough to pull specialists down to workers...). It suffers from exactly this job swapping issue where it will shuffle pops from one resource deficit to another but is unable to split them properly to address all resources appropriately.

Other than this job shuffling probably being terrible for performance it also can badly confuse the other AI logic and I am sure a player wouldn't like it if all of their resource incomes flipped every month.

While something like this idea is needed the current weight based job assignment has some issues that makes it not actually appear to work very well.
 
  • 5Like
Reactions:
This sounds like a generally bad way of doing things. For the general case I believe most people are going to build out a planet as needed, and so won't have an excess of jobs compared to population. Worrying about extra values in that case will only decrease performance by adding additional checks in the weighting algorithm. And if you do find yourself having issues with resources, a better option comes in to disable individual jobs and/or get better about what and where you build. A player playing decently shouldn't have to worry about this. And even if things aren't spread in a way to keep things positive, the current algorithm is built to maximize overall production. Using the market is a good idea here to keep things moving smoothly.

If there's AI issues with them having too much of some resources, then they should have their building code changed, or alternatively should have code that shuts off jobs as needed to adjust. That'd have a much smaller impact on performance, and functionally achieve the same thing.
 
  • 7
  • 3
Reactions:
Yes, while the suggestions are definitely good on paper, those kinds of per-pop calculations are PRECISELY what caused so much late-game lag and in part prompted the pop growth reductions.

Besides, I also dislike the idea that every planet should manage itself perfectly on its own and basically fix your economy for you - managing your planets is supposed to be part of the challenge of the game. And while this suggestion might help the AI play better, it's really just a band-aid - the AI should be fixed by improving the AI player's decision making logic, not by making individual pops smarter.
 
  • 8
  • 1Haha
  • 1
Reactions:
I feel like this is a duct-tape solution.

I would suggest making changes to the core algorithm by making the planet more proactive when handing out jobs.
  1. All jobs may have one of the 4 stati
    1. Employed
    2. Employed but not needed
    3. Open
    4. Closed
  2. The planet should read the country's income and manage the jobs.
    1. Take total number of Pops on the planet, close down the unneeded jobs.
    2. If country has low income of something, open all slots of the corresponding jobs and close down jobs of the most abundant resource.
    3. Pops only choose according to their Traits on available Open jobs. Jobs that are vacant but closed by the planet should not be taken.
    4. For the sake of migrations and Events, Closed jobs are counted as open jobs. It's just that the planet needs to open up these jobs for the Pops to choose.
  3. Problems now
    1. Pops see all jobs to be equal, so they will choose the one best suited to their own traits.
    2. All jobs don't count how many other jobs there are. A miner job doesn't know how many miner jobs there are on the planet. So when it is attactive, it attracts all.
    3. Jobs also don't see the country's income.
Others like to say that playing with the economies is a part of fun for the player. But it isn't for the AI.

AI still holds the majority of players in any game. AI doesn't know how to micromanage. Letting the AI taking high level decision checks probably impact more performance since it needs to react quickly and unnecessarily "just in case". So improving low-level functionalities for Pops choosing jobs benefits both the AI and the players, especially new players who are simply overwhelmed by the sudden jumps back and forth of resources, especially those beset by Clerk Jobs.
 
All pops simultaneously update their weights when using resource income.
This cause pops to flip flop back and forth as a group between jobs. At first there's too few pops working a job then to many and then it repeats.
I assumed this would be the case too, however I did not observe any flip flopping, this is likely because quite some time ago job checks were revised to not fire daily and I think they use a internal cooldown on pops individually evaluating jobs (so if you've moved, you're unlikely to be allowed to move again for a while, unless a full calculation is sent). Beyond that, having large, staggered resource floors/ceilings will also help prevent this, for mathematical reasons. Likewise double conditions would further reduce this chance for flipping worker/specialist jobs (e.g. dont take Artisan job if minerals <6 AND a mining job is free on that world AND the pop is a worker)
Note: the weight boost isn't enough to pull specialists down to workers...)
Yep. There's also stratum limits that affect what jobs they look at, not just absolute weights.

Yes, while the suggestions are definitely good on paper, those kinds of per-pop calculations are PRECISELY what caused so much late-game lag and in part prompted the pop growth reductions.
This galaxy had 3k pops in it and it was running just as fast with a country income check as without. There are no maths operations running, i'm not calculating variables, im simply asking is X < Y, where Y is net resource income - something already computed and cached. Asking "am I robust" takes as much CPU overhead.
Likewise, no more or less checks are being run, thats governed by code and has not changed at all, now the checks are just less useless.
the AI should be fixed by improving the AI player's decision making logic, not by making individual pops smarter.
Er did you read all of my post? You do understand that "AI" isn't a thing, right, and that the pops arent actually any smarter? This is how the system works already.
A function - a block of of code - rolls through each pop/planet on a cycle and asks itself -
  1. Can I move you somewhere? Yes/no?
  2. If yes, where is best based on the conditions set to all the jobs on this world (constrained by strata and species rights)?
There is no Azimovian intelligence that runs the AI, it's literally just this for everything it does - it's a glorified seek and match function lol.
  • Can I build a District? Y/N? [do i have enough resources, do i have no build cooldowns etc]
  • What kind of District? [Picks whichever complements it's Economic plan best]
  • Can I now assign pops as jobs have updated? Y/N?
  • Do I have capacity for a ship? Y
    • Can I afford a ship? Y
      • What's my current ratio of CV/DD/CR/BBs? x:y:z:k
        • Picks whatever adheres to its needs.
There Is no such thing as Artificial Intelligence.

Besides, I also dislike the idea that every planet should manage itself perfectly on its own and basically fix your economy for you
Code:
is_ai = yes/no
This can be used to apply some weights to only the AI, and not players (in fact I literally use this in my OP) So this point doesnt really make sense. But more than that,
- managing your planets is supposed to be part of the challenge of the game. And while this suggestion might help the AI play better, it's really just a band-aid
This is just plain false. Managing pops isn't a challenge for a human that knows how to play the game, it is a chore. It detracts from the "Grand" in grand strategy, and having an AI that puts up a fight is far more challenging and entertaining to me than playing Galactic Communist Economic Planner Simulator. I only care about results. Many other players must too, as there are perpetually calls for improved Automation. One can follow the exact same build order 90% of the time in the early game. Hell, I could script in the micro setup a "good" player does for the AI to follow in the first 5-10 years, as it's that much of a standardised process.

  1. Take total number of Pops on the planet, close down the unneeded jobs.
  2. If country has low income of something, open all slots of the corresponding jobs and close down jobs of the most abundant resource.
This is edging into some very maths heavy simulations.

Step 1 is easy at first glance, if all income is green, shut any additional jobs (consume cpu cycles).
Oh something happened, income not green anymore? open all jobs (EVERYWHERE - leading to a huge frame stutter as all jobs will then force all pops to recompute simultaneously) as we cannot test for output from a job without knowing what kind of pop will fill it first [unless you only use the base income, normally this goes up over time but can drop too from -stab or -happiness], if you knew opening 3 miner jobs for robust miners was possible and just that would solve your issues, that would be fine, but to do that you either have to compute jobs fully, Or you have to run something like binomial distribution maths to have any hope of accuracy - is this pop likely to fill a job?, is it likely to exist? are other factors likely to affect the rolls?)

The only way it makes sense to do this would be to have a separate script replacing jobs but this still adds more load than you'd realise as every time one is added or taken away it will lead to job shuffles, unless you force it to skip the pop job calc - a narrow version of this just for industrial jobs, however, does work. I came up with this system for the computer to bias Artisan/Foundry jobs on non-player worlds directly via planet decisions, this was to compensate for supply gluts when the AI sets up a foundry world or factory world. Combined with the job weights in the OP this would be perhaps too strong a change lol.

Pops see all jobs to be equal, so they will choose the one best suited to their own traits.
Leaving aside the fact that, outside of amenities, traits are pretty much worthless now (all the mining and repeatable techs and edicts horrendously outclass the extra crap 10/15/20%+ bonuses from species after like 2240 - it may even make sense to stop checking species traits for jobs in the late game), I can get behind removing specialist/worker strata hard limits, There isnt much point in it.
Rulers are fine though, as the system uses a top-fill first.

  1. All jobs don't count how many other jobs there are. A miner job doesn't know how many miner jobs there are on the planet. So when it is attactive, it attracts all.
  2. Jobs also don't see the country's income.
As for the first, that can be done too, However ... It would be a bad bad idea to do it with the current system (I can tell the script to consider each pop for a job, in terms of N+1 output by getting an approximate projected income change and the number of vacant jobs, on the colony or nationally of that type and working from there) - but it will lead to too many repeated calculations that will bog down a system.

So it makes more sense to go with the second option for performance reasons and just weight job selection by a desired income level. I've also only used hardcoded values here (6/12/50) but I could re-write the economic plans to all use @Variables and tell this to plug pops into jobs on the same basis. So if an Ai is on the basic plan, it can target 6-20 CG income, if its on the midgame/lategame plan it can target 6-50 etc.

You can break all resources down in to
  1. maintenance (i.e. you want the minimum, or some low amount)
    • Food (if your food upkeep is met, any more is pointless)
    • Strategic resources (gas/motes/crystals/Dark matter etc) - if you've met your min requirements, having any more is just for selling or edicts (if you have enough energy you can buy as needed for edicts).
    • Minerals (in the late game - they're only good for construction and meeting your alloy upkeep)
    • Consumer goods
  2. conditional (you want to hit a threshold)
    • Admin cap. You always want just enough to not have sprawl > Admin cap.
    • Amenities (if youre going for the happiness soft cap, otherwise minimum is fine)
  3. Maximisation (you want the most you can get)
    • Alloys, Science, energy
    • Minerals (in the early/mid game - they're good for construction booming)
Based on that, you can write up job income rules that
  1. target only ever having the minimum of resources in category 1 (=<5 for Strat res =<10 for food with a script forcing the AI to buy food for faster colonisers)
  2. only employ bureaucrats if sprawl > AC / entertainers if amenities < 1.25x planet-wide usage.
  3. Always max weight Alloys, science. EC, and minerals(early/mid game or assign a dynamic country variable that asks how many free districts are there[updates every 12m] to get a sense for how much building is still needed)
If a Pop fails to satisfy any job based on the above 3 weight classes, it will just pick whatever is left with the highest weight (so long as it isnt zero - only use weight mults not -add) they always want to work, from my tests and dont want to be unemployed.

Then once you can reliably know jobs are actually going to be intelligently filled, you can work on AI district decision weights (though they're mostly OK).
 
Last edited:
  • 6
  • 3Like
  • 2
  • 1Love
Reactions:
Man, I really like your in-depth analyses of issues and testing around for potential solutions.
I wouldn't mind the devs checking out your posts regularly to get some inspiration for balance changes and fixes. (I honestly hope they do.)

I would agree that necessity-based job assignment should overrule qualification-based job assignment.
I think, as you said if i understood correctly, trait-based assignment should be used if there are no economy gaps to fill. I feel that is especially necessary if you are being attacked and your most significant consumer goods planet is occupied and so pops should shift towards artisan jobs on other planets automatically as you have a sudden drop in you economy.

I feel this is necessary, as micromanaging pops is also what they wanted to get rid of in 3.0 with the automatic resettlement. Just replacing it was automatic job juggling is just recolouring the issue instead of solving it.
necessity-based job assignments would help significantly.

It should really be considered to maybe give players the option to set your economy goals. (i.e. +50 CG, 0% sprawl penalty, +100 alloys, 25% amenity abundance) That way you could do away with a lot of job juggling with ease. And it would actually make use of the overabundance of jobs in 3.0 compared to the now lower pop counts.
 
  • 2
Reactions:
I would agree that necessity-based job assignment should overrule qualification-based job assignment.
I think, as you said if i understood correctly, trait-based assignment should be used if there are no economy gaps to fill. I feel that is especially necessary if you are being attacked and your most significant consumer goods planet is occupied and so pops should shift towards artisan jobs on other planets automatically as you have a sudden drop in you economy.
Yep.
  • If jobs > pops, the most important thing is meeting a minimum income threshold should come first. traits should be the second thing considered. Not the first, or only.
  • If jobs ≈ pops or or income is already positive, then traits should be considered as a "win harder" metric, (squeezing out 10% more income is rarely going to make a difference in breaking even, but it will give you a competitive lead, so it should be #2 on job assignment priorities)
  • If jobs < pops, then worker/specialist strata limits should be bypassed and the best pop should be stuffed in the best job, based on traits. This will then force shittier pops to become unemployed and migrate to somewhere else, hopefully where they can be more useful.
    • You only want to do this on worlds with more pops than jobs, any other time, its not worth the effort to consider traits, after the very early game.
It should really be considered to maybe give players the option to set your economy goals. (i.e. +50 CG, 0% sprawl penalty, +100 alloys, 25% amenity abundance) That way you could do away with a lot of job juggling with ease. And it would actually make use of the overabundance of jobs in 3.0 compared to the now lower pop counts.
This could be doable with scripted variables - IF jobs can take scripted (rather than static) variables for job-weights. By setting country variables (and manipulating them with a mod UI) and telling the job scripts to check for those variables you could create a menu that lets you set your own target incomes/priorities on an empire level. The AI would have to follow variables based on some other pre-set conditions or its economic plans (which probably could do with more complexity and sub-plans, or factoring in resource difficulty modifiers tbh).
 
  • 2
  • 2
Reactions:
Code:
 modifier = {
            factor = 10
            has_job = artisan      # <-------------
            OR = {
                has_trait = trait_robust
                has_trait = trait_robot_efficient_processors
            }
        }
Some versions ago, this wasn't here. The modifier was merely factored by the other "has_job = artisan" modifier for the same result (e.g. 5 x 2 = 10). If I understand that a capable artisan is of greater value than a random artisan, shouldn't a capable unemployed / non artisan be more valued than a random one, if a certain patriotism/opportunism is taken into consideration as when country's income is taken into consideration?
 
As long as demotion timers exist, Specialist and Ruler job assignments need to be "sticky".

I mean, my solution would be to throw demotion timers in the fragging bin, but what do I know?
 
  • 3Like
Reactions:
@Pancakelord The method paradox have chosen to solve pops & jobs is absolutely not NP complete. The computation required is linear with the number of pops & jobs. An example of an NP complete problem would be if every pop calculated every possible job and then all the outputs were compared to find the global maximum. That type of calculation would allow situations where a pop might accept a slightly worse job in exchange for a higher global output. I'm emphatic about this because I've had this discussion before on the forums with someone else who thought it was NP complete.

Next, if I was to identify one problem with the current method of allocation pops to jobs, it would be the difficultly of maintaining the system as new features and DLCs are introduced. It really desperately needs unit testing. It literally has duplicate entries within the same code block at the moment. It will be awkward to maintain because the philosophy behind it is not consistent so far - some modifiers push, some pull; some modifiers are 0-1 scalar, others are "chose an arbitrarily large number" like 200 for robot jobs. You can encourage a worker to do something in 03_worker_jobs only to discover that there is a stronger factor for them to do something else in 02_specalist_jobs. As the number of tags grow, it becomes necessary to include and exclude more things everywhere in an N² way.

More broadly, it's also important that the pops & jobs algorithm does NOT try to deal with wants versus needs. In other words, a planetary shortfall should not be addressed by weightings. Instead, a planetary governor should manage (add/remove/temporarily suppress) the available jobs in response to planetary needs versus empire wants. That separation of responsibilities would simplify the problem space.

Lastly, your concern about specalist jobs balancing is valid but largely obscured by the game design. Namely, planetary specalisation combined with a lack of trait/upgrades relevant to specalist jobs. Based on what you and I know about how these systems work, it's easy to see why paradox has shied away from traits like metalurgist/artisan. There is only one specalist trait/upgrade and it's limited in that way because they know the current (and all previous) systems would not cope.
 
  • 2Like
Reactions:
This feels like a whole mess unnecessarily complexing our maths...

How about this other new design.
  1. Planets no longer have "Jobs", but "Labours".
  2. Buildings open "Labour" positions and modify the output.
    1. Say you have a Science Lab and an Alloy Foundry, you get 4 Specialist Labour positions.
  3. Each Labour position has the output of some Science and some Alloy, according to the ratio the Labour positions are designs.
    1. In the above example, each Labour produces 1/2 Science and 1/2 Alloy.
  4. When new buildings are built, it opens both new Labour positions and make changes to the things it produces.
    1. Say if you build a new Temple. Now you will have 6 Labour positions and each Labour position produces 1/3 Lab, 1/3 Alloy and 1/3 Temple.
  5. All Pops will just occupy the Labour positions.
  6. Pop Traits give bonus (to be balanced) to the overall production.
    1. Say in the above example if one of the Pops out there is good at Physics, then you still produce 1/3 Lab stuff, but the Physics category is boosted.
  7. The Planet chooses which Pops to promote.
 
  • 6
Reactions:
@Iosue Yu
Ideas like that have come a lot recently and i am going to repeat my usual answer:

A more "fluid" pop dynamic (less relevance of individual pops) is a really good idea, but NOT as a rework for Stellaris. Do that in Stellaris 2, please. Hamfisting that into Stellaris 1 would be bigger than all the past reworks combined and the game would need to be rebalanced from scratch.

It's a great concept, but there is no way a rework like that isn't going to be a disaster that the community dissatisfaction of 3.0 pop growth limitation can come even close to. This is such a fundamental change it's bound to break pretty much everything, considering how integral pops are to the game's calculations.

My ideal for Stellaris 2 would be a much more fluid pop dynamic. It could solve many issues regarding large pop counts.
Pop Growth could also be handled much more fluidly and not a sudden burst of 50% more people when you colony goes from 2 to 3 pops.
But I really don't want a rework attempt of Stellaris 1 in that regard.
 
  • 3
  • 1Like
  • 1
Reactions:
Honestly, if PDX could implement this suggestion just for Scientists, Artisans, Bureaucrats and Metallurgists it would be such a great help for the AI. Taking care of these four jobs will mean a healthier economy, which the AI can then use to be more active in other parts of the game.
 
  • 1
Reactions:
Next, if I was to identify one problem with the current method of allocation pops to jobs, it would be the difficultly of maintaining the system as new features and DLCs are introduced. It really desperately needs unit testing. It literally has duplicate entries within the same code block at the moment. It will be awkward to maintain because the philosophy behind it is not consistent so far - some modifiers push, some pull; some modifiers are 0-1 scalar, others are "chose an arbitrarily large number" like 200 for robot jobs. You can encourage a worker to do something in 03_worker_jobs only to discover that there is a stronger factor for them to do something else in 02_specalist_jobs. As the number of tags grow, it becomes necessary to include and exclude more things everywhere in an N² way.
This was what I discovered last night. I tried to pull all the factors in to excel and to try and make sense of it (after making the initial bar graphs) I ended up producing a disgusting plot of the multipliers themselves - which doesn't even track second order factors (e.g. 10x2x0.8).

I do wonder how(if) they keep track of all of their balanced variables internally.

1619799211597.png
discrete
1619799256194.png
additive
(roboticist has a weight of 500, and no other factors, was pointless to add it given the scale of everything else, so thats blank)
Priests are the most aggregious at 22 ! modifiers that can be applied to the job. Not all of those can be applied at the same time, but easily half could be in some cases, often they bias the number up and down cancelling eachother out. Such a mess.

This is all tallied up, where it is valid, and each job is then given a stat, and (i think) all these stats are normalised into a percentage (e.g. if one job has a weight of 400 and another has one of 39 the pop has a 90+% chance of picking A. then its run for each pop). To consider all valid permutations, simply isn't workable.

@Iosue Yu
Ideas like that have come a lot recently and i am going to repeat my usual answer:

A more "fluid" pop dynamic (less relevance of individual pops) is a really good idea, but NOT as a rework for Stellaris. Do that in Stellaris 2, please. Hamfisting that into Stellaris 1 would be bigger than all the past reworks combined and the game would need to be rebalanced from scratch.

It's a great concept, but there is no way a rework like that isn't going to be a disaster that the community dissatisfaction of 3.0 pop growth limitation can come even close to. This is such a fundamental change it's bound to break pretty much everything, considering how integral pops are to the game's calculations.

My ideal for Stellaris 2 would be a much more fluid pop dynamic. It could solve many issues regarding large pop counts.
Pop Growth could also be handled much more fluidly and not a sudden burst of 50% more people when you colony goes from 2 to 3 pops.
But I really don't want a rework attempt of Stellaris 1 in that regard.
Imperator does this. It has buildings (or districts) and the output is just multiplied by the number of pops of X class (with there being 4 classes) no traits are considered, [obviously] no species are considered, no happiness etc. Its far more streamlined... yet somehow it still has a more interesting economic system to me.

The problem with jobs is you can either
  1. teach an AI to build "jobs" (that don't need pops - like an RTS game) and play fine with it.
  2. You can teach an AI to grow pops that automatically multiply output (i.e. a "jobless system" similar to imperator) and play fine
but if you try and combine the two, its like solving a simultaneous equation each and every time. You cant know the output of the job without knowing what pop is being crammed in there. But yes, trying to overhaul how jobs work is pointless at this stage. re-working the weights to be A more efficient by considering fewer traits in some cases, or just focusing on income at the expense of flavour will lead to a stronger AI and (minor) performance increases, without breaking the economy... further.

I think there is still a fair amount that can be done to salvage the current system.
Each Worker and Specialist (as Rulers have extra checks on leadership) job needs to consider the following 3 categories, in this order:
  1. Prioritise jobs by their resources and if they are being met or not:
    1. By category
      • Is this need to have (alloys, science, etc),
      • does this need to meet a threshold (planet amenities, empire wide bureaucrats)
      • or a minimum level (food etc)
    2. Would taking this job put its input resource negative, when this job is already positive?
      • E.g. take a CG job, making minerals negative, when CGs are already positive - should not be done.
  2. Is this pop a slave / citizen / academic privilege [handled via pre-checks for slaves, so its faster]
  3. Standardising trait checks:
    1. Does the pop have "ANY TRAIT" that is good for Worker / Specialist roles? (compressed off into a scripted trigger, written in an optimised way, so this isnt a disgusting mess in the job files)
    2. ANY TRAIT that is good for [resource]
      1. And standardise resource traits.
        1. Have a generic +15%worker trait, +10%specialist trait,
          • (rulers dont get one, as it would either be broken-good or trash, give them -ruler upkeep or something else).
        2. and specific +30%[resource name trait] {maybe 20% for important specialist stuff like Alloys} for each of the main resources in the game (skipping weird stuff like nanites or dark matter).
          • And these would be mutually exclusive traits, so you can have the +worker and +mineral but not +worker +mineral +food traits. Simply to simplify pops.
And that's basically it.
Each job should have its modifiers compressed down to those 3 blocks (5 if you count the sub-blocks).​
And, ideally, those should all be fed in to a CSV file, or at least be defined in their own variable short-list, rather than being held in plain text scripts directly.​
 
Last edited:
  • 4Love
  • 4
  • 2Like
  • 1
Reactions:
I think there is still a fair amount that can be done to salvage the current system.
Each Worker and Specialist (as Rulers have extra checks on leadership) job needs to consider the following 3 categories, in this order:
  1. Prioritise jobs by their resources and if they are being met or not:
    1. By category
      • Is this need to have (alloys, science, etc),
      • does this need to meet a threshold (planet amenities, empire wide bureaucrats)
      • or a minimum level (food etc)
    2. Would taking this job put its input resource negative, when this job is already positive?
      • E.g. take a CG job, making minerals negative, when CGs are already positive - should not be done.
  2. Is this pop a slave / citizen / academic privilege [handled via pre-checks for slaves, so its faster]
  3. Standardising trait checks:
    1. Does the pop have "ANY TRAIT" that is good for Worker / Specialist roles? (compressed off into a scripted trigger, written in an optimised way, so this isnt a disgusting mess in the job files)
    2. ANY TRAIT that is good for [resource]
      1. And standardise resource traits.
        1. Have a generic +15%worker trait, +10%specialist trait,
          • (rulers dont get one, as it would either be broken-good or trash, give them -ruler upkeep or something else).
        2. and specific +30%[resource name trait] {maybe 20% for important specialist stuff like Alloys} for each of the main resources in the game (skipping weird stuff like nanites or dark matter).
          • And these would be mutually exclusive traits, so you can have the +worker and +mineral but not +worker +mineral +food traits. Simply to simplify pops.
And that's basically it.
Each job should have its modifiers compressed down to those 3 blocks (5 if you count the sub-blocks).​
And, ideally, those should all be fed in to a CSV file, or at least be defined in their own variable short-list, rather than being held in plain text scripts directly.​
If someone made this as a mod it would become a must have. It would make everything more balanced and make the AI survive.
 
  • 1Like
Reactions:
@Pancakelord If your trial for this gave you good results, can you consider bringing this topic up with the creator of the Starnet AI mod? Getting a mod to do it is better than not getting any improvements at all. I've checked the Starnet mod files, and this weighting based on country income is not implemented there. I don't know if they will implement it (as this affects players too, not only AI), but it's worth the benefits.
 
  • 1
Reactions:
@Pancakelord If your trial for this gave you good results, can you consider bringing this topic up with the creator of the Starnet AI mod? Getting a mod to do it is better than not getting any improvements at all. I've checked the Starnet mod files, and this weighting based on country income is not implemented there. I don't know if they will implement it (as this affects players too, not only AI), but it's worth the benefits.
Ive not looked at starnets files, do they touch job files at all? if not, I "could" (not promising I would) write up weights for the below ,based on the yellow text here, loading that as a mod after starnet would be compatible, (but would overwrite any job changes they make)
1619809026682.png
(really its just the 01 - 04 files)
 
  • 1
  • 1Like
Reactions: