Knåddskogen has you play as a kindergarten teacher who has lost your entire class in the forest, so now you must go out there and bring them all (well, enough of them) back to the bus!
In this bizarre exploration game, you will have to employ the questionable tactic of throwing children at your problems to progress.
Kids and the Line
To win the game you must bring enough kids back to the buss.
This is done by walking up to a lost kid and they will start following you in a neat and orderly line, in most cases at least.
Kids were added to a list in the “LineScript” to be able to make them walk in a line.
I chose to use the NavMeshAgent for the kids’ pathfinding, this let me set the kid’s follow target to the kid with the next lower index, giving the desired visual of the kids walking in a line.
The line list takes GameObjects instead of Kid objects because adding the teacher to the list makes it easy to have kids follow the teacher.
Kid script's PlaceInLine function:
Using the NavMeshAgent allowed me to use the “priority” attribute to make sure the kids didn’t get stuck if the line was tangled.
The first kid in the line teleports to the teacher’s hand (this helped if a kid somehow got stuck on a NavMesh island somewhere). To make sure that the kid is launched from the hand at the right moment I used the animation event system to fire the function the moment the throwing animation reaches a certain frame.
Preparation and execution of throw:
In order to allow the player to aim, I implemented a visualized trajectory showing the kids predicted path through the air.
Code for moving the throw target:
Code for calculating throw trajectory:
Kids could also be “collected” by throwing kids at them. This was useful if you needed to get kids down from trees or boulders.
To add more to the light-hearted and bizarre theme of the game, this was also applied on kids already in the line, so they could fall over. And since kids that were knocked over by a thrown kid were set to the thrown state as well, this could lead to an amazing chain reaction.
OnCollision part of Kid script:
The “Tree Bridge” was created to serve as an obstacle that still needed to be dealt with using the ability to throw kids.
So, to keep to the bizarre nature of the game: The player throws kids at the tree in order to topple so it can be passed or serve as a bridge.
Animating the tree falling proved difficult so I solved it using a rigidbody and a hinge joint with variable limits that were controlled via script.
To create more varied ways of acquiring kids, I made a script where if a kid was to pass through the attached trigger volume a number of kids would spawn and join you. This was used in the basketball hoop (because why would you not try and hurl a kid through a hoop?). This script could be applied to several objects to have a myriad of different ways to acquire kids.
Landmark Areas and Kid Placement
In Knåddskogen’s development several landmark areas were created, such as: a wind shelter, a small island, a cape looking across the lake, etc. I was in charge of placing the kids in the game world, and instead of just placing all the kids in their idle animation all over the place I and the animator decided on a few animations that could be used in combination with the aforementioned landmark areas.
So, when placing a kid in an area I though about how to make the scene either funny, cute or just bizarre.
Autonomous fishing village
Too many shrooms.
What a lovely time!
I hope he catches something.
Now where could they be hiding?
Something as simple as putting a marshmallow on a stick in a kid’s hand made the kid memorable for the players, giving them fond memories of when and where they found that kid.
Since the only action the player character could perform was throwing kids, the animator was kept fairly tidy. The animator and I talked about what animations would be needed and we decided that much of the animation could be solved via avatar masks in Unity to make sure the player could walk and throw at the same time.
The base layer of the animator only required a blend tree to blend between the Idle and the (wonderful) Walking animation based on the players speed.
Throwing was made its own layer and was split up in a top and a bottom to easily mix the legs walking while the torso held a kid in the air, ready to throw. To achieve the desired effect the default state of the layers was set to an empty state, so the layers did not override the base layer.
Upper body layer:
Lower body layer:
The kids also had a blend tree for its movement on ground but had several different states they could be found in.
To prevent repetitive behaviour from the kids, a nose pick animation was implemented that would fire off at random intervals. This also used a layer mask to mask out the head and left arm.
I wanted the kids to feel more alive and not just small pillow NPCs standing around. So I implemented a system which Made the kids look at the teacher if close enough with their head IK.