Data doesn't matter when this is what the code literally does, which proves it is fairly random, though with caveats to priority specifics:
// New job giving system by Donkie
// This will cause lots of more loops, but since it's only done once it shouldn't really matter much at all.
// Hopefully this will add more randomness and fairness to job giving.
// Loop through all levels from high to low
var/list/shuffledoccupations = shuffle(occupations)
// var/list/disabled_jobs = ticker.mode.disabled_jobs // So we can use .Find down below without a colon.
for(var/level = 1 to 3)
//Check the head jobs first each level
CheckHeadPositions(level)
// Loop through all unassigned players
for(var/mob/abstract/new_player/player in unassigned)
// Loop through all jobs
for(var/datum/job/job in shuffledoccupations) // SHUFFLE ME BABY
if(!job || (job.title in SSticker.mode.disabled_jobs) ) //11/2/16
continue
if(jobban_isbanned(player, job.title))
Debug("DO isbanned failed, Player: [player], Job:[job.title]")
continue
// If the player wants that job on this level, then try give it to him.
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
// If the job isn't filled
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
Debug("DO pass, Player: [player], Level:[level], Job:[job.title]")
AssignRole(player, job.title)
unassigned -= player
break
In essence, the Low/Medium/High job preferences hold significance as anyone with a High Level job preference with a specific job will prefer to have that job considered first before being rolled through their other job preferences. Thus, if they fail to get that job, they're considered through their other medium priority jobs for that character as a fall back, as long as those medium priority jobs preference are set. If not, the person usually goes back to the lobby on this server.
The job controller randomly chooses among the subgroups generated by the tiers of job preference. 1 = High 2 = Medium 3 = Low. Therefore, if there is only one person with Captain on High, they're guaranteed to get the job regardless of whomever has Captain on Medium or Low in the other categories. This is so individuals can dedicate themselves to "main" a role if it is not in major demand, but any degree of High Level job preference competitiveness over a single roll throws this "guarantee landing my desired job" into total flux. So, there is an individual, predictable aspect of this where it relies entirely upon a player to ready for a job in the first place. But when several individuals want the same job, that's when randomness is at play. Because there's only one slot, only one person of a set sample group can have it. Out of a group of say, 3 people who want (all three have high priority preference for it, and are readied) the captain slot, guess what that chance is? You do the math.
Another thing is that theoretical probability != experimental probability. Flip a balanced coin 100 times, let it fall on your desk. How many times do you get heads and tails each? Supposedly, you should get 50/50 theoretically because it is a double-sided, balanced coin - in theory, right? Realistically, that won't always happen. Such as not getting that perfect 50/50 that you so wanted, but sometimes 52/48. Which is still *relatively close* to the theoretical posed, therefore the theory was still pretty damn good, it just couldn't account for whatever happened that made the two flips fluke out.
The factors that matter at play are:
1. The requirement of someone to ready for a role.
2. If a person has a high priority role preference for a specific job, they are guaranteed to get that job over anyone else unless someone else readies in high priority preference for the same job.
3. A group of people who have high priority role preference for the same one-slot job are fairly chosen among the number of people who readied with the intent of that one job.
4. Role preference goes all the way down to secondary/tertiary/etc preferences, however many jobs you have flagged for medium/low preference, until you get that job. Note that you will always lose against other high priority preferences when you're filtering down to medium.
5. All of this only rolls once. Whatever you get is final, based on what the job controller system succeeded in giving you.
Further, true, the odds are not totally even. They can't be even if the percentage chance of acquiring a contested role is an odd number.