Select Page

Knåddskogen

Role: Programming & Design

Project Description

Knåddskogen is a single player adventure game where you play as a kindergarten teacher who has lost her toddlers while on a field trip in a swedish forest. But finding the kids is not that simple. You must find the kids and use them as projectiles to find all of the kids in a wacky field trip adventure. Rock Paper Shotgun article.

During the project I acted as a Programmer and Designer. 

My responsibilities was implementing the teacher customization, the children skin randomization as well as the menus and intro cutscene.

Genre:

Platform:

Engine:

Language:

Development Time:

Team Size:

Itch.io:

Adventure

PC

Unity

C#

7 Weeks

10 People

Knåddskogen at Itch.io

Customization for the Teacher

Customization Menu

When making the customization the team’s goal was for it to feel meaningful for the player. That’s why when setting up the scene I decided to have the camera up close to the character so the player could see their choices in a clear way.

The background scene is a stripped down version of the main level. This creates faster loading time while still keeping the same atmosphere. The frame was set up in such a way that the player will remember the red bus and brown fence which mirrors the area the player later starts in.

Modular Customization System

The goal when designing the customization system was to make it modular and usable long term. To achieve that I wrote the script with a target material and a list of textures, making it reusable for every seperate part of the customization.

The script controls a set of arrow buttons which includes a selected and deselected sprite. Unity’s standard Eventsystem Button assumes you only have one sprite which can change on selected. But in our customization menu we have two sprites which is controlled not by a button press but with horizontal axis movement. By using the Eventsystem interface I enabled our buttons to interact with the other elements in the Unity Eventsystem. This allowed us to have our own customized buttons while still being able to use the regular Eventsystem tools.

CS_PartCustomization

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;

public class CS_PartCustomization : MonoBehaviour, ISelectHandler, IDeselectHandler
{
    #region Variables
    [SerializeField]
    private int startingIndex;
    [SerializeField]
    private Sprite selectedSprite;
    [SerializeField]
    private Sprite deselectedSprite;
    [SerializeField]
    private List textureList;
    [SerializeField]
    private Material partMaterial;

    private List buttons = new List();
    private int textureIndex = 0;
    #endregion

    private void Awake()
    {
        if (buttons.Count <= 0)
            buttons.AddRange(GetComponentsInChildren());

        SetTextureByIndex(startingIndex);
    }

    //Called by the CustomizationManager when the player performs a Horizontal Axis Input
    public void ButtonPress(int indexIncremention)
    {
        textureIndex = (int)Mathf.Repeat(textureIndex + indexIncremention, textureList.Count);
        SetTextureByIndex(textureIndex);
    }

    public void SetTextureByIndex(int index)
    {
        textureIndex = Mathf.Clamp(index, 0, textureList.Count - 1);
        partMaterial.SetTexture("_DiffuseTexture", textureList[textureIndex]);
    }
    public void SetRandomTexture()
    {
        int randomNumber = Random.Range(0, textureList.Count);
        SetTextureByIndex(randomNumber);
    }

    //Using Eventsystem interface functions to show which element is selected
    public void OnSelect(BaseEventData eventData)
    {
        buttons.ForEach(x => x.sprite = selectedSprite);
    }
    public void OnDeselect(BaseEventData eventData)
    {
        buttons.ForEach(x => x.sprite = deselectedSprite);
    }
}

Randomizing Child Textures

Evenly Randomized Textures

One of our goals included the kids feeling diverse and unique. When collecting several of these toddlers in a line they should all blend together into a colorful mess.

In order to achieve this I made a script which evenly randomized out the textures for every kid in the level.

Everytime the game starts the kids will be assigned textures from a llist one at the time. Each time a texture is applied to a kid it will be removed from the list. When the list is empty it will be refilled will all textures. This ensures an even distribution of all availible textures and allows it to scale to different amount of kids in each level.

CS_KidDiversifier

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CS_KidsDiversifier : MonoBehaviour {

    public List kidMaterials;

    private void Awake()
    {
        DiversifyKids();
    }

    private void DiversifyKids()
    {
        List kidList = new List(FindObjectsOfType());

        //If we have no kids or materials then skip the process.
        if (kidList.Count <= 0 || kidMaterials.Count <= 0)
            return;

        List tempMaterials = new List(kidMaterials);
        for (int i = 0; i < kidList.Count; i++)
        {
            //Get a random material from our material list.
            int randomNumber = Random.Range(0, tempMaterials.Count);
            Material mat = tempMaterials[randomNumber];
            kidList[i].GetComponentInChildren().material = mat;

            //Remove the material so it cannot be randomly selected again.
            tempMaterials.Remove(mat);

            //If we are out of materials, refill the list.
            if (tempMaterials.Count <= 0)
            {
                tempMaterials.AddRange(kidMaterials);
            }
        }
    }
}