How I flipped and chopped “Flip N Chop”

Words and images documenting the little game I made for the 2016 SubZero street art festival in San Jose California-

The game was designed for the festival- so I needed a game that was local multiplayer- it needed to be pretty simple gameplay and be something you could “beat” in 2–5 minutes-

So it needed to be a local multiplayer, couch or party games I think they’re called? I’m new to game dev so I don’t know all the lingo yet ^_^

I used Unity, Playmaker, Behavior Designer, Final Ik and a few C# scripts to make the game-

I started working on a prototype with an idea of players locked in a prison cell with zombies trying to break their way in-

At this stage it sorta worked the way I imagined but it wasn’t fun- I knew the game was going to be played with usb NES gamepad’s so it would only have 2 buttons-

I did like the B button = Hammer. A button = Axe thing I did in this prototype but it wasn’t fun-

Adding a funny face to the dude didn’t make it fun either-

At that point I was like “what if the players are Chef’s?”

I flipped through some Unity assets I bought that was full of props and items- there was enough stuff to do a cooking game so I decided to make the game about cooking-

I got most all the art assets for the game from these great asset packs by Synty

Some of the items were from my older games or from unfinished projects-

Here’s a vid of the finished games gameplay-

I went with a top down iso perspective because I couldn’t think of another way to do local 4 player on one screen haha-

I only had about 2 weeks to make the game so I couldn’t get too crazy with the complexity- I replaced the hammer from the other prototype with a spatula to FLIP stuff and I replaced the axe with a meat cleaver to CHOP- all the models were from asset packs-

I actually just put the new items in the old ones and turned off the mesh renderers from the old ones so I could use the same animation-

BUT if I had animated objects how did I make it look like the players hands were moving the objects?

It was through the magic of the Unity asset Final IK- I used Final Ik’s “Limb IK” script to make the hands/arms follow the movement of the animated objects- but using that also made things more complicated for me-

I wanted to make it so a random character would spawn each time you chose a player- So I had a list of the prefabs for the characters-

Choosing and spawning a random prefab was easy to do with standard Playmaker actions BUT I needed to attach two limb ik scripts to the spawned character and feed its bones to the limb ik script as well as an target for the script-

To do that I made a Add Limb Ik playmaker action that adds a limb ik script to an object and saves the script as a component variable-

So when the game starts the playable characters hierarchy looks like this-

There’s no character prefab in there- a random one is spawned using PoolManager and parented to the P1_root object for Player one- so then it looks like this-

I also attached a Playmaker Fsm template at runtime so the players animation events have something to do using this action-

So the SimplePeople_… prefab is in there now-

But there is no Limb Ik components yet (No Playmaker Fsm yet in that image either) So the Add Limb Ik action runs and adds the Limb Ik scripts- then the bones are found by name and set in the scripts as is the target-

Here’s a screencap of the Fsm that creates the Players-

I got paranoid at one point and thought that having all the players share an animator controller was a bad thing so I make an action to set one during runtime so each player had their own- you can find all my custom actions on Playmakers Ecosystem or here btw

The character creation happens when a player presses start on a joystick as you can see in this vid-

To create the names I used this Playmaker action with some random names/words lists I found-

Here’s an example character that gets spit out-

In the game you want to feed and fill your Patron as fast as possible and the first one to make him burst from being full then being fed a mint wins (Like the Monty Python skit-that was my wife’s idea)

I started out with the idea that the user would have to add specific things to make a recipe and set that up-

I quickly realized this was too tedious and not fun so I got rid of the specific ingredient requirements and instead each random recipe would just require a certain number of ingredients- so the player doesn’t have to know or care about what they are adding as long as its not zombie bodyparts-

I made a simple dismemberment system to cut off zombie arms, legs and heads- you can add the bod parts to your recipe but upon eating your patron will puke and lose some fullness-

A dude is puking somewhere in there

When the player kills zombies with their cleaver- the cleaver damages them and the spatula makes them run away when you smack them with it- I added a sound to that made me think of Benny Hill slapping that little guy on the head to make it fun-

The Zombies are navmesh agents using Behavior Designer to control them- here is the navmesh area-

The zombies are contained to the Navmesh and I used box colliders on empty game objects to keep the players in the playable area on screen- the zombies can walk through the colliders- I just set them to ignore in Unity’s physics panel in the preferences-Edit →Projects Settings →Physics

The zombies were also randomly generated- this is the Fsm that generates the Zombie and manages their dismemberment and death-

The dismemberment system grabbed all the players bones then fired spherecasts at child bones to figure out what limb is hit- then it spawns the severed limb for that body part-

There’s some zombie severed limbs in dis image

The whole setup is similar to how I did the player except I had to set the specific materials for each severed limb that would be spawned- I was pulling the zombies from these prefabs

The zombies all used the same mesh so to create the severed parts I could use the same ones for all the zombies BUT the zombies all had different materials so after spawning the zombie and its severed parts I had to add its unique material as well-

I kept the severed parts and materials in dictionaries on the master prefab that was used for every zombies “master” game object-

All I had to do was get the name of the prefab that was spawned- look that up in the ZombieMat dictionary and apply the material for that name-

Here’s a screencap of the Zombie Behavior tree made in Behavior Designer-

The zombie wanders while through conditional aborts it looks for items the player is trying to cook with- if it sees them it seeks them and tries to eat them- if the wait timer succeeds while they are “eating” the zombie will despawn the item- eating it and taking it away from the player-

The zombies see their own severed parts as items to eat as well- they don’t do much else except spawn dialog bubbles now and then and flee if you smack them with the spatula-

The zombies are just coin banks- you kill them to get coins to use in the vending machines to buy items to cook with- the circle of life my friends 0_0

I was ahead of schedule after getting the cooking, zombies, and 4 players working so I made a killer toilet for some reason 0_O

I took one of the premade assets of the toilet- then modeled, rigged and animated the tongue in Cinema 4d- and added an eyeball model I had lying around-

It uses a trigger system to that when you hit it- it will randomly awaken and smash whatever is in front on it- players and enemies-

For the items in the game- they all came from one prefab called Ingredient- this is the fsm that was on it-

All the real work is done by the template that runs at the end- first this fsm deactivates any children that may be active- then it gets a random item from the ingredients (all the ingredients meshes are children of this object) then it activates it and spawns some particles- then it runs the template-

So the item uses a trigger event to get the object that flipped or chopped it- on those objects there a string variable for Player Name- so this fsm in the state “get player name” gets that player name string and in the following switch and states moves it to the table of the player that hit it- I used this a lot in the game to decide where items should go/what they should do when interacting with a player-

I had all that stuff working and was still ahead of schedule so I decided to add a little boss fight- I had a character I modded from an asset I bought and I did a bunch of combat animations for him but never finished that game- so I decided to use that guy-

Here’s what the boss does in the game

I used Behavior Designer to do his behavior tree as well-

He seeks the donut in the middle of the screen- he starts out tiny so once he reaches the donut- he starts working out by using Set Mecanim trigger to play those animations and dotween to scale him up- Behavior Designer triggers all that stuff using its built it tasks- though Dotween tasks are a free add on to Behavior Designer-

Then he yells- I used the Playmaker integration here as well

Behavior Designer sends the atk events to Playmaker which triggers those animations at random- Playmaker also chooses the target player for the boss to seek- it finds the Player with the highest fullness meter on their patron and goes after then through Playmaker sending that game object variable to behavior designer-

The rest of the time the boss is patrolling the area just outside the visible area- you can see him cruising in the distance in this gif

Here’s the Fsm that controls the PatroN- he’s mainly sent events from objects which he reacts too-

For his dialogue bubbles that switch on and off I just added them to his hierarchy as a world space UI-

And activate/deactivate them as needed- his Fat_Bar is using Energy Bar Toolkit- a really fast, easy and elegant UI bar asset-

My friends Sheldon and Landon Callahan did the music for the final game which is perfect for it- and I did all the sound design using BFXR-

Unity’s mixer is really intuitive to use if you have DAW experience- the snapshot system is awesome- I created a few different snapshots for the games phases- intro menu- gameplay- boss fight- win screen- and used a Playmaker action to transition between them-

I treated this like my own little game jam and just tried to kick out something fast, simple and fun quickly- for about a 2 week time span I’m really happy with how it came out and more importantly its sorta fun!

The game will debut on the street for the SubZero street art festival- I have a projector and a screen and 4 usb NES controllers so that’s how it will be displayed-

If you would like to play the game yourself- get it here on my page

If you want to learn to make games using the tools I’m using check out my video tutorials at The Strange School

Thanks and a flip and a chop to you too!