Skip to content

How Cities: Skylines determine where students go to school

Preface

Schools in C:S are considered workplaces for citizens in the Child, Teen or Young Adult age group. So in order to answer how a student's school is decided we need to answer how the game determines the workplace for citizens in general. In the following section we try to explain that process and then focus on the case of students in particular.

The Transfer Offer System

The game introduces a system to determine where citizens go to work (or school) where both citizens and workplaces have offers and then a certain procedure is done to match them up.

Offers are not only used for workplace determination but also for any action that requires citizens moving in the game.

A tranfer offer is an in-game object reperesting a potential transfer of a citizen to a workplace. It is either incoming (offered by workplaces) or outgoing (offered by citizens) and it contains information used in the matching process.

Some of the properties of an offer are:

  • Active - Is the offer still valid.

  • Priority - A number between 0 and 7 representing the priority of the offer.

  • Amount - The number of citizens that will use this offer (number of vacancies or applicants).

  • Position - The position of the citizen (Home location) or the workplace.

  • BuildingID - The ID of the building that is making the offer (Incoming offers only).

  • CitizenID - The ID of the citizen that is making the offer (Outgoing offers only).

  • VehicleID - The ID of the vehicle used by the citizen (Outgoing offers only).

  • TransportLineID - The ID of the public transport line used by the citizen (Outgoing offers only).

  • TransferReason - The reason for the transfer. (A list of reasons is provided in the appendix)

The Transfer Procedure

We focus in this section on the school use case. The game trys to find a workplace for citizens who don't currently have a workplace at each frame update.

Students Side

If the citizen is an eligible student, i.e. is in the right age group and has completed previous education requirements (for example a Teen who has completed elementry education is an eligible high school student) the citizen adds an Outgoing Offer to the list of outgoing offers with the following information:

  • Active: True

  • Priority: is chosen randomly (between 0 and 7)

  • Amount: 1

  • Position: position of the citizens homeplace

  • CitizenID: The citizen's ID

  • TransferReason: Student1, Student2 or Student3 (corresponding to Elementry, High and University students)

Schools Side

On the other hand, School buildings produce offers whenever there are vacant places in the building (checked every frame), these offers are added to the Incoming Offers list.

The offer will have the following information:

  • Active: True

  • Priority: 8 * Number of vacancies / Total capacity

  • Amount: Number of vacancies

  • Position: position of the school building

  • BuildingID: The school building's ID

  • TransferReason: Student1, Student2 or Student3 (corresponding to Elementry, High and University school types)

Matching

Offers are processed in order of their priority (Higher priority first).

The game starts processing incoming offers, For each incoming offer the game iterates over all outgoing offers with the same TransferReason and of the same or lower priority.

Outgoing offers of the same priority are matched with the incoming offer in order of the smallest distance between the positions of the citizen and the school first.

When an incoming offer has satisfied all its available vacancies it is rendered inactive.

In that way, students who have outgoing offers with lower priority are more likely to end up at a far away school or if they don't match up with any school they wait for the next frame updates.

Appendix

Tranfer Reasons:

  • 1 => TransferReason.Snow,
  • 3 => TransferReason.Garbage,
  • 5 => TransferReason.Metals,
  • 7 => TransferReason.Worker0,
  • 9 => TransferReason.TouristA,
  • 11 => TransferReason.Fire,
  • 13 => TransferReason.ChildCare,
  • 15 => TransferReason.Goods,
  • 17 => TransferReason.Sick2,
  • 19 => TransferReason.Shopping,
  • 23 => TransferReason.DummyCar,
  • 25 => TransferReason.IncomingMail,
  • 27 => TransferReason.Single0,
  • 29 => TransferReason.EvacuateA,
  • 31 => TransferReason.LeaveCity0,
  • 33 => TransferReason.ForestFire,
  • 35 => TransferReason.Entertainment,
  • 37 => TransferReason.ElderCare,
  • 39 => TransferReason.PartnerYoung,
  • 41 => TransferReason.UnsortedMail,
  • 43 => TransferReason.Grain,
  • 47 => TransferReason.Family0,
  • 49 => TransferReason.FloodWater,
  • 51 => TransferReason.ShoppingB,
  • 55 => TransferReason.PassengerShip,
  • 57 => TransferReason.AnimalProducts,
  • 59 => TransferReason.Single1,
  • 61 => TransferReason.EvacuateVipA,
  • 63 => TransferReason.Oil,
  • 65 => TransferReason.RoadMaintenance,
  • 67 => TransferReason.Crime,
  • 69 => TransferReason.LuxuryProducts,
  • 71 => TransferReason.Worker1,
  • 73 => TransferReason.TouristB,
  • 75 => TransferReason.Bus,
  • 79 => TransferReason.Student1,
  • 81 => TransferReason.Ferry,
  • 83 => TransferReason.ShoppingC,
  • 85 => TransferReason.PassengerHelicopter,
  • 87 => TransferReason.DummyTrain,
  • 89 => TransferReason.Flours,
  • 91 => TransferReason.Single2,
  • 93 => TransferReason.EvacuateB,
  • 95 => TransferReason.LeaveCity1,
  • 97 => TransferReason.Collapsed,
  • 99 => TransferReason.EntertainmentB,
  • 103 => TransferReason.GarbageMove,
  • 105 => TransferReason.Mail,
  • 107 => TransferReason.Lumber,
  • 111 => TransferReason.Family1,
  • 113 => TransferReason.CableCar,
  • 115 => TransferReason.ShoppingD,
  • 119 => TransferReason.CriminalMove,
  • 121 => TransferReason.Paper,
  • 123 => TransferReason.Single3,
  • 125 => TransferReason.EvacuateVipB,
  • 127 => TransferReason.Coal,
  • 129 => TransferReason.SnowMove,
  • 131 => TransferReason.Sick,
  • 135 => TransferReason.Worker2,
  • 137 => TransferReason.TouristC,
  • 139 => TransferReason.PassengerTrain,
  • 141 => TransferReason.GarbageTransfer,
  • 143 => TransferReason.Student2,
  • 145 => TransferReason.Blimp,
  • 147 => TransferReason.ShoppingE,
  • 151 => TransferReason.DummyShip,
  • 153 => TransferReason.PlanedTimber,
  • 155 => TransferReason.Single0B,
  • 157 => TransferReason.EvacuateC,
  • 159 => TransferReason.LeaveCity2,
  • 161 => TransferReason.Collapsed2,
  • 163 => TransferReason.EntertainmentC,
  • 167 => TransferReason.PartnerAdult,
  • 169 => TransferReason.SortedMail,
  • 171 => TransferReason.Food,
  • 175 => TransferReason.Family2,
  • 177 => TransferReason.Monorail,
  • 179 => TransferReason.ShoppingF,
  • 183 => TransferReason.Taxi,
  • 185 => TransferReason.Petroleum,
  • 187 => TransferReason.Single1B,
  • 189 => TransferReason.EvacuateVipC,
  • 191 => TransferReason.Petrol,
  • 193 => TransferReason.SickMove,
  • 195 => TransferReason.Dead,
  • 199 => TransferReason.Worker3,
  • 201 => TransferReason.TouristD,
  • 203 => TransferReason.MetroTrain,
  • 205 => TransferReason.Trolleybus,
  • 207 => TransferReason.Student3,
  • 209 => TransferReason.TouristBus,
  • 211 => TransferReason.ShoppingG,
  • 215 => TransferReason.DummyPlane,
  • 217 => TransferReason.Plastics,
  • 219 => TransferReason.Single2B,
  • 221 => TransferReason.EvacuateD,
  • 223 => TransferReason.PassengerPlane,
  • 225 => TransferReason.Fire2,
  • 227 => TransferReason.EntertainmentD,
  • 231 => TransferReason.DeadMove,
  • 233 => TransferReason.OutgoingMail,
  • 235 => TransferReason.Logs,
  • 237 => TransferReason.Fish,
  • 239 => TransferReason.Family3,
  • 241 => TransferReason.ParkMaintenance,
  • 243 => TransferReason.ShoppingH,
  • 247 => TransferReason.Tram,
  • 249 => TransferReason.Glass,
  • 251 => TransferReason.Single3B,
  • 253 => TransferReason.EvacuateVipD,
  • 255 => TransferReason.Ore,
Back to top