January 17, 2018, by Stuart Moran

Corrupt Kitchen VR Dev-Diary 3

Paul Tennent,  Research Fellow, Mixed Reality Lab

Welcome to the next section of the Corrupt Kitchen VR development diary. Today we’re going to talk about the events and aspects of the system beyond the core task of burger making. These fall largely under the separate headings of ‘health and safety’ and ‘corruption’. In general, Corrupt Kitchen VR is a game about balancing your principal resource of time against the need to perform other tasks. The more of these tasks you perform the more ‘correctly’ you’re doing the work, but consequently the less money you are likely to make. The game questions how much a player is willing to cut corners, then delivers its message in the form of post-hoc consequences.

Health and safety

There are a number of health and saftey oriented tasks in the game. These are generally time sink tasks, that is, things you must do to safely operate your restaurant. Neglecting them does not directly negatively impact your profit (very much a simplification of real life), however they do affect your environment. Two consequences are apparent to the game. First, at the end of the game your restaurant is inspected by the ‘health and safety bot’ who will fine you for violations, and second the consequences of neglecting them are shown to the player at the end of the game in the form of news reels, for example stating the number of elvises who died of food poisoning due to your cavalier attitude to pest control.

Mopping the floor: Floors get dirty. It’s just a fact of life. Every so often you do have to clean them, and in Corrupt Kitchen VR this is as true as anywhere else, it’s just a somewhat accelerated process.

The dirty floor is created using a series of transparent “grunge” textures. These are laid out on the floor in a grid. The textures then have their alpha value tied to how dirty the game thinks that grid tile should be. The dirtiness of the floor is just a timer: the longer it has been since the mop-head touched each grid-tile of the floor, the dirtier that part of the floor will appear. If the mop head is currently touching that tile, the process is reversed at a much faster rate, so while it takes four minutes for each tile of the floor to get to its dirtiest, it only takes four seconds to clean it. Mechanically, the floor and mop have colliders on them, and the mop is an interactable object (i.e. you can pick it up). We need only check each frame the colliders are intersecting to see if the player is cleaning the floor – if not, simply make it dirtier.

Pest control: If the floors get dirty that might also attract pests. In corrupt kitchen VR, if the floors reach 50% of their maximum dirtiness, some AI mice are spawned, which will run about and generally get in the way. They are harmless, but distracting. To remove them the player needs to get one of the mousetraps, and put it on the floor. This causes the mice to leave the building (this is, after all, a family friendly experience). Mechanically, this simply involves checking if the position of the traps is below a certain Y-threshold. If so, we assume they are on the floor and let the mouse AI script know to set its movement target outside the building – otherwise the AI just picks random positions around the room.

Washing your hands. If you handle raw meat in real life, it’s probably a good idea to wash your hands. Here it’s completely optional, and the sink is deliberately placed far enough away from the fridge that you have to walk over to do it. The game records your hands as “dirty” every time you handle raw meat. Each time you then touch another object it records this, for purposes of working out how much food poisoning you might have caused. If the health and safety inspector catches you with dirty hands, that’s a hefty fine too. To clean your hands, all you need to do is turn on the tap in the sink and “wash” your controller in the water stream. Like the mop, this is done using collider intersection.

Keeping meat fresh: If you leave meat out that’s probably not great. The paradise kitchen is a pretty hot place, and it seems meat here spoils quite a bit faster than in the real world. Leaving the meat in the grinder for more than a minute fill causes flies to start appearing round it. Fortunately the fridge instantly kills such infestations, but the game keeps track of how many fly-ridden burgers you have served to the hungry, but not overly discerning elvises. This is simply a timer. If the meat is in its original position (the fridge) the timer is reset to zero each frame. If its elsewhere, it increments. Once it reaches a certain time (60s) the ‘flies’ particle effect is enabled.

Keeping the fire door clear: This one doesn’t have an immediate consequence. The game doesn’t burn down the kitchen, but the fire door does start out blocked. If you don’t take the time to tidy it up, you’ll be due a healthy fine from the inspector. The game also offers a news reel with a more serious consequence to this (lack of) action. To make this work, we simply check the distance of the two interactable objects from the door. If they are more than half a meter away we assume that the fired door is clear. If not, it’s blocked.

Corruption

Now let’s look at some of the more obviously morally grey aspects of the game. These are things you can do which might increase how much money you make, but have little effect on your time in the game.

Not paying your taxes: Quite easy this one. The till can be set to either accept cards, or cash only. This is a stand in for the idea of not paying sales tax on each burger. If you set till to cash only (done by using it with the controller) you receive 20% more payment per burger then if you set it to receive cards.

Hiring illegal workers: If you want to make more burgers it would help to have more help. Half way through the game a second worker (blue robot) arrives. He doesn’t have any identification or qualifications and he doesn’t need to be paid. If you hire him, you can make burgers faster as more plates and buns will be prepared for you to pop the burgers into. To hire him, just pass him a chef’s hat. If not, he’ll just leave of his own accord. If the inspector catches you with an illegal worker though – that’s a serious fine. It’s up to you to decide if it’s worth it.

The Inspector

The game has kept track of all the things you were supposed to do, even if you haven’t. The last thing that happens is that you will be visited by an inspector (red robot).

When the inspector calls, she’ll have a look around then list out your various violations. This is done using microsoft’s speech API, so that she can have different scripts for different violations and experiments with minimal change. Also it makes her sound quite robot-y. The last major decision you’ll have to make as a player is whether to try to bribe the inspector. She’ll issue you with a fine (you’re bound to have forgotten something), after which she’ll suggest that the problem could be made to go away. If you choose to take some money from your till and pay her that’s just fine. I mean, you can live with yourself after doing that can’t you?

In the next developer diary, we’ll have a look at how the consequences of the game are realised, and show you a video of the game in action.

Previous blog in series: When Law and Computer Science Collide: How an interdisciplinary project is letting me do more than I could on my own

Posted in Data VisualisationDigital Initiatives