Prisoner AI in canteen

(previously 'DEVELOPER') Private forum for registered community members. To register, please visit www.prison-architect.com/register.

Moderator: NBJeff

SuwinTzi
level0
Posts: 6
Joined: Tue Jul 16, 2013 7:06 pm

Prisoner AI in canteen

Postby SuwinTzi » Sat Apr 19, 2014 12:14 am

I've a large canteen with serving tables spread on opposite sides of the space, but I'm running into an issue with prisoners traveling from one end of the canteen to sit at the opposite side, ignoring closest bench/table. Even with 3hr meal times, not everyone is eating, as towards the end, they are still traveling the space.
User avatar
knoest26
level5
level5
Posts: 1380
Joined: Thu Jul 11, 2013 6:55 pm
Location: The Netherlands
Contact:

Re: Prisoner AI in canteen

Postby knoest26 » Sat Apr 19, 2014 8:10 am

I'm not sure to what decides the path a prisoner should take but that might be something you could investigate. As far as I understand all materials have a certain value, depending on their 'toughness to walk over' and a prisoner will take a path that will have the smallest value, aka the easiest route. The route for a prisoner to take might be calculated when he enters, telling him to walk to whatever servingtable is closest and free to use and then back to the closest table to his original position, causing prisoners to race from one end to the other.
I'm just thinking out loud there but it might be something you could check out.
Tarô11
level2
level2
Posts: 141
Joined: Mon Apr 14, 2014 4:32 pm

Re: Prisoner AI in canteen

Postby Tarô11 » Sat Apr 19, 2014 8:13 am

If they can't eat within 3h due to traveling in the Canteen, there is a problem. It makes me think that your Canteen is too big for the AI to calculate correctly where to go. You could try to create a second one and to set security levels restrictions to split the prisoners more efficiently, but I read that the cooks don't have a canteen / kitchen allocated, so it could be a problem to have food put in both of them.
User avatar
VoiD88
level5
level5
Posts: 1001
Joined: Thu Dec 08, 2005 9:24 am
Location: Soltau, Germany
Contact:

Re: Prisoner AI in canteen

Postby VoiD88 » Sat Apr 19, 2014 8:23 am

This problem is well known since Alpha 1 and does not only happen in the canteen (Prisoners ignoring objects they want close by, running to the same object hundreds of yards away). Chris tried to fix this problem a couple of Alphas ago and it did work a lot better for some time but has been broken again since then.

Perfect example of why fixing bugs like this should wait until the game is feature complete: New features break old features, that's a fact. The developer only ends up fixing the same stuff over and over again.
SuwinTzi
level0
Posts: 6
Joined: Tue Jul 16, 2013 7:06 pm

Re: Prisoner AI in canteen

Postby SuwinTzi » Sat Apr 19, 2014 10:00 am

Behavior I was noticing involved prisoner grabbing closest serving table, then walking all the way to the opposite end for a table, even with one open.

Wasn't experiencing this issue with my multiple yards and objects within; prisoners chose the yard closest to their cell block. So must just be a canteen thing.

I am tempted to make a second canteen but terrified of breaking my chow times; right now, most of the prisoners get fed, it's only about 20% that don't make it. Right now what I have is 2 kitchens at either end of the canteen due to where prisoners enter from cell blocks.
perryliu97
level2
level2
Posts: 183
Joined: Wed Nov 21, 2012 11:40 pm

Re: Prisoner AI in canteen

Postby perryliu97 » Sat Apr 19, 2014 10:50 am

I suspect that the serving tables can only accommodate a few prisoners simultaneously taking their meals. When the serving table is fully occupied, nearby prisoners are forced to go to further away tables, as the closer serving table is not available.
SuwinTzi
level0
Posts: 6
Joined: Tue Jul 16, 2013 7:06 pm

Re: Prisoner AI in canteen

Postby SuwinTzi » Sat Apr 19, 2014 11:37 am

Ran a test in a smaller canteen and it just doesn't make sense.

Nearly all the prisoners will take a tray from Serving table A, and proceed roughly 18m to Bench and Table B, as opposed to Bench and Table A that's 3m away. Same thing happens to serving table B, with all the prisoners taking trays from it going to Bench and Table A, which is again 18m away and ignoring Bench and Table B. Prisoners are taking trays at roughly the same time, so it's not that the tables are full. The prisoners end up slowing each other down just to get to where they want to go, despite making it a 6m pathway to the benches.

Canteen has 4 serving tables for 255 prisoners, with enough seating for everyone, that is 8 benches in four groupings for total of 256 seats. Everything roughly equidistant from each other. It's like the prisoner AI doesn't recognize the closest bench for meal time, when during free time prisoners grab the closest object/seat.

Edit:
That was with 6 serving tables. Was also running into problem where there's a backlog of prisoners demanding food, despite serving tables not utilized even though it was stocked with food.

Also noted that as the meals were served, the prisoners began choosing closer places to sit than the further ones. Not sure if this is another behaviour quirk or not, because seating was still open on both ends of the canteen. Canteen effective perimeter is 28x27.
perryliu97
level2
level2
Posts: 183
Joined: Wed Nov 21, 2012 11:40 pm

Re: Prisoner AI in canteen

Postby perryliu97 » Sat Apr 19, 2014 5:49 pm

SuwinTzi wrote:Ran a test in a smaller canteen and it just doesn't make sense.

Prisoners are taking trays at roughly the same time, so it's not that the tables are full.



It could just be that the planned AI routes have already reserved those seats, despite nobody using it at that particular time. See how none of the prisoners seem to fight for the same seat?
Squizzel
level1
level1
Posts: 50
Joined: Mon Apr 14, 2014 12:15 am

Re: Prisoner AI in canteen

Postby Squizzel » Sat Apr 19, 2014 9:56 pm

If that's the case it seems like the AI is just being weird. They're priotising seats on the other side of the room, in both cases. I'd say they was a logic code involved (So always seat from left to right), but that dosn't seem to be the case either. It may very well be part of the older issue prisoners were suffering from, where they'd just pick random showers or common rooms or yards, instead of the closest. It's not the Biggest issue, as you can just have more meal times (three 1 hours threwout the day works for me).

The canteens and kitchens in general just seem to have rather.. basic AI's atm (What with cooks randomly changing kitchens and prisoners dropping food on the floor if they finish work). It'll be something they address soon or later.
perryliu97
level2
level2
Posts: 183
Joined: Wed Nov 21, 2012 11:40 pm

Re: Prisoner AI in canteen

Postby perryliu97 » Sat Apr 19, 2014 10:46 pm

I don't know how exactly the AI works, so I'm just going to speculate.
The earlier the prisoner enters the canteen, the earlier said prisoner attempts to find an available serving table and bench.
However, as the vast number of different prisoners enter the canteen from multiple entrances at different times, the pathfinding system goes haywire.
Prisoners are sent on their merry way in batches, resulting in many standing motionless and blocking the way.

Another possibility is that having all the prisoners pick the closest benches would make the canteen look weird, with completely isolated benches, and so there is an element of randomness in the pathfinding.

With the eventual inclusion of gangs, I assume the canteen AI will be overhauled so that different gangs pick different tables, hence eventually solving the problem.

Return to “Community Members”

Who is online

Users browsing this forum: No registered users and 5 guests