This week, our team accomplished some incredible milestones! We managed to create a code that enables the game to recognize and interpret players' speech, adding a whole new level of interactivity. Now, players can use their own voices to control the opening of a door which will eventually be the end state of our game (rollll credits!). This is in a separate scene from our main game, but we’ll be implementing this into our main game in the coming week.

Untitled (8).mp4

public class SpeechRecognizerDoor : MonoBehaviour
{
    public float doorSpeed = 1.0f; 

    private AudioSource audioSource;
    private KeywordRecognizer keywordRecognizer;
    private Dictionary<string, System.Action> keywords = new Dictionary<string, System.Action>();
    private bool doorOpen = false;
    private Quaternion openRotation = Quaternion.Euler(0, 90, 0);
    private Quaternion closedRotation = Quaternion.Euler(0, 0, 0);

    void Start()
    {
        audioSource = GetComponent<AudioSource>();
        audioSource.clip = Microphone.Start(null, true, 1, AudioSettings.outputSampleRate);
        audioSource.loop = true;
        while (!(Microphone.GetPosition(null) > 0)) { }
        audioSource.Play();

        keywords.Add("Open", OpenDoor);
       
        keywordRecognizer = new KeywordRecognizer(keywords.Keys.ToArray());
        keywordRecognizer.OnPhraseRecognized += OnPhraseRecognized;
        keywordRecognizer.Start();
    }

    void OnPhraseRecognized(PhraseRecognizedEventArgs args)
    {
        System.Action keywordAction;
        if (keywords.TryGetValue(args.text, out keywordAction))
        {
            keywordAction.Invoke();
        }
    }

    void OpenDoor()
    {
        if (!doorOpen)
            StartCoroutine(OpenDoorCoroutine());
            doorOpen = true;
        }
    }

    IEnumerator OpenDoorCoroutine()
    {
        while (transform.rotation != openRotation)
        {
            transform.RotateAround(new Vector3(0, 0, -1), Vector3.up, 20 * Time.deltaTime);
            yield return null;
        }
    }
}

We also dedicated our efforts this week to incorporating physical books into the ‘game world’. These books won’t be found in the gamespace itself, however, they will sit alongside gameplay at our showcase events. I created a book that one might expect to see in our game (perhaps in the Tower?), whilst Ali created a book to show off our aesthetic design choices. We carefully designed each book. I used found items, or items bought in secondhand stores, including old newspaper clippings, photos, and advertisements from the time period I based the TV models on, as well as making my own paper my blending and molding old, ripped up books, to hone in the vintage look. My book holds secrets that actually provide hidden clues, hints, and a captivating backstories that can contribute to the overall game experience - if players choose to read it! And if players clock on, they can in theory read the passages aloud from the physical books, triggering the in-game event and essentially completing the game in SECONDS.

By integrating these physical books into the game experience, I feel as though we have created a tangible connection between the players and the virtual world.

Untitled (12).mp4

“a complex of divergent texts dwell among the Gods.”

As we don’t have a ‘How to play menu’ implemented yet, we also added pictorial clues using simple icons found on all Microsoft applications to our demo for Soton Science and Engineering Fair (SOTSEF) so players can work out what they’re doing without the use of actual words to explain our game.

poster clues.pdf


WEEK 7_ 13/03-19/03