I wanted to experiment a bit with the pathfinding algorithm in the game, to try and understand how it works and how it can be used to design a prison with several independent blocks, or with independent prisoners and staff corridors.
So first I needed a prison with only one prisoner, to make it easier to experiment and see what happens. My first idea was to make a prison with only one cell, have a guard put a prisoner in there and then fire the guard. It turned out to be a bad idea, because when you fire all the guards, the prisoners just escape . So I hired a new guard and designed a second prison with a holding cell.
Here is my experimental one-prisoner prison:
And my paradise prison for all the others:
It isn't exactly a paradise (electricity and water is really overrated ) and almost all prisoners escaped on the first day. Having all 6 attempting to shower on a 1x1 space was probably kind of messy. The only one staying is injured and cuffed, it looks like those can't escape.
But I was now able to play a bit with my guinea pig.
The prisoner has a nice and comfy cell with everything he needs (except food) but I need to make him run a bit. A slight adjustment to his schedule will take care of that.
My first experiment was about those famous "staff only" doors. I can confirm one of the hypothesis on this forum: the prisoner will ignore the door type when determining the shortest path to his destination, and will just stupidly wait in front of the door that it opens. Someone else suggested that they would "memorize" a path and then always follow it, but this isn't true. I had him take the long route first, and then placed a staff door. He still wanted to take that new door and would only take the other route if I removed the door and put the wall back again.
My second experiment was to find out which of the showers the prisoner would choose if several were available. Would it be the closest one geographically, or the one with the shortest path? To check that I brought the shower closer to the cell, and put another shower over the cell. The new shower is farther away from the cell, but on a shorter path. It turns out he chose the new shower, the one with the shortest path.
In the mean time…
My third experiment was about the assigned cell. I made a new cell just next to the shower and wanted to see which one he would pick after his shower. It turns out he went all the way back to his first cell. So once you assigned a prisoner to a cell, he will always go back to this cell, not to the closest one.
Finally in my last experiments I wanted to see if it was possible to have several kitchens or canteens, as I saw in another thread it didn't work. And I'm afraid I have to agree...
I made another canteen/kitchen block and assigned a second cook to it. The cooks started to put supplies in their respective kitchen, but then moved both to the second one, and then both to the first one, until all the cookers were filled up. At the time of eating they grabbed the cooked food from both kitchens and put all of it on the serving table in the first canteen, the one on the right. The cooks just kept on switching from one kitchen from to the other. It seems to work at random, they take the food from a random fridge and put it on a random cooker. But the cooked food always end up in the first canteen. So it seems possible to have several kitchens (although the cooks will keep running from one kitchen to the other) but we can have only one canteen.
I also wanted to see which canteen the guinea pig would choose. His first meal is after a shower, and the canteen on the right is closer to his position at that time. The canteen on the left is closer to his cell. I thought he would always go to the canteen closest to his current position and I was right. He had his first meal after the shower in the canteen on the right, and his second meal (after a nap in his cell) in the canteen on the left (unfortunately for the poor guy, with an empty table). So prisoners don't have a determined shower or canteen, they just take the closest one (i.e. the one with the shortest path) when needed.
I tried to deassign the first canteen to see what happens. The cooks still put the food on the serving table in the unassigned canteen…. odd. I actually had to dismantle the serving table to ensure the cooks would start to use the other canteen.
So to summarize:
- prisoners always come back to their assigned cell, they don't switch
- when going to the showers or the canteen (and probably the yard too) they pick up the one that is on the shortest path from their current position (and not always the closest one!)
- when finding the shortest path, they ignore the door types. If one or several door on the shortest path is a staff only door, they will just wait in front of it until a staff member comes by and opens the door. Then they will walk through it. It makes it impossible to create staff only corridors or rooms if they are on the shortest path between two places a prisoner can use. -> BUG
- cooks can't be assigned to a specific kitchen, they will move randomly from one to the other. They will always put the food in the first canteen, whereas the prisoners pick up the canteen closest to them. So don't create several canteens. -> BUG
- if you need to move the canteen, make sure you dismantle the serving tables from the first one so that the cooks go to the new canteen.