ribbybibby / Grimm-Journey

A local co-op multiplayer platformer based in a fairytale world.
0 stars 0 forks source link

[Audio] Add Basic narration #32

Open ChildOfTheCron opened 9 years ago

ChildOfTheCron commented 9 years ago

Rob1 and I thought of a neat idea. We think that as the players are playing through a fairy tale it would be good to have a basic one line narration at the start of each level.

It won't be super long or detailed but would kind of roughly guide the player through the journey they take. For example:

"She made her way through the forest..." "A beanstalk emerged from the castle..."

LMitch83 commented 9 years ago

I like this idea. I'm writing some narration for game progress and tutorial hints (e.g. if BBW hasn't jumped for the first time after a minute or so of gameplay, play the hint); currently, I'm doing them in rhyme to match the main page. What do you think? If you guys like the idea, I'll type up the narration for you to see and record it all (I can add the lines into the sound folder).

LMitch83 commented 9 years ago

OK -here's the narrative we could play and when we would play it. Tomorrow (hopefully!) I'll record these and put them in the Assets/Sounds and Music folder:

Narrative

Forest Start: “We join our heroes in their desperate plight, To escape the forest and the deadly night.”

Castle Start: “The forest is behind them, but to their dismay, An old castle fortress blocks their way.”

Beanstalk Start: “Escaping the castle, the dark claws at their calves, But our heroes find a beanstalk reaching up to the stars.”

If BBW doesn’t successfully jump after 2 mins/BBW tries to jump without LRRH: “The Wolf may seem stuck, but he can leap to the sky, If Little Red Riding Hood is standing close by.”

If one character’s health only has a few hits left: “Bound by magic, both lives they must cherish, For if one should die, so the other shall perish.”

First time BBW is attacked without attacking back/BBW is hit five times in succession: “Bestowed upon the wolf is the power of three, Breath, claw and bite shall vanquish the enemy.”

First time LRRH is hit/LRRH is hit five times in succession: “Though for combat, Little Red Riding Hood is far too meek, She can leap to the skies and find the exit you seek.”

If one character reaches the exit, but not both: “Why they are bound, no-one can say, But escaping together is the only way.”

First encountering a Transforming Light: “The strange glowing lights have a transforming power, When one character touches it, they turn into the other.”

ChildOfTheCron commented 9 years ago

Thanks for these Laura, they are wicked good :)

Added level 1_1 intro narrative as a test in afdeb2d81d5451b0b17e3a01513694576b12a162. Started restructuring the Sound Manager a little bit. We drop all audio sources volume to 0.2F while the narrative is playing. Once finished we boost up the audio to all audio sources in the level to 1.0F. This works pretty neat currently :D The narration plays with quiet audio in the background and once its done the audio is restored to its full glory!

I am still thinking whether or not this is the best way to go as atm we are constantly updating each audio sources volume per frame. But I can't think of a better way right now. I'm gonna keep running this through my head, but the good thing about updating per frame is that the audio seems really responsive. And we don't have -that- much audio really so it shouldn't impact performance I think.

ChildOfTheCron commented 9 years ago

After refactoring the sound manager into three seperate managers (Audio/Music/Sound) I am having a little problem with setting the game audio back up to 1F after setting it down to 0.2F. Some logic problem, I'll fix it asap tomorrow. After that I need to:

ChildOfTheCron commented 9 years ago

I made a main camera prefab that includes all the seperate managers. So what this means is we can just plonk it in any other levels we decide to make and the audio should 'just work'. Once I fixed the above issues that is. Im still working on this, sorry it's taking a while x.x

ChildOfTheCron commented 9 years ago

Rob came up with the solution to loop through AudioSources[]. This'll fix the bug. From my past shinanigans I know its not that good to use a loop in update. As this could crash the engine/game. but looping could be done via IEnumerator or InvoteRepeating. We do:

Invoke Repeating(GetTalkingState, 0, 0.2F)

void GetTalkingState(){ For i = 0 i < AudioSources[], i++ If AudioSources[i].IsPlaying){ talking = true; break; }else{ talking = false; } }

This will fix the audio fade bug :)

Then for Music Manager implement talking and getTalking method as done in Sound Manager.

Will implement this tonight when I get home.

ChildOfTheCron commented 9 years ago

Added the above psuedo-code and it works! The fade bug is now fixed. I finish off the remaining audio and finished the music manager. Just need some comments and one final commit to:

Add game specific narration queues. This should now be easy as the narration manager can be called by any object in the game.

if no other narration is playing, then the required narration clip will play. I'll add this in tomorrow and close this bad boy off finally.