00:00:00
let's see narrative design and action as
00:00:02
we approach a non-player character in
00:00:04
this
00:00:05
demo hello it's your first day in the
00:00:08
office today right are you ready for an
00:00:10
ongr tour of the facility here narrative
00:00:12
design sets up an initial exchange with
00:00:14
a location based trigger that activates
00:00:16
when we approach the tour guide
00:00:18
MPC yes I'm
00:00:23
ready okay then follow me narrative
00:00:26
design triggers actions as well as
00:00:28
conversations here a walk to action was
00:00:35
invoked the conveyor belt is a crucial
00:00:38
part of our operations here it helps in
00:00:40
the smooth transfer of goods from one
00:00:42
point to another do you have any
00:00:44
questions about it at this instance the
00:00:47
next objective was triggered here we can
00:00:49
decide whether we want to ask the tour
00:00:51
guide a question yeah what does it
00:00:56
transfer the conveyor belt transfers raw
00:00:58
materials and finish products between
00:01:01
different sections of the factory or
00:01:03
move on to the next location no let's
00:01:06
continue the
00:01:11
Tour all right let's check out the
00:01:13
assembly line
00:01:15
robots the character seamlessly responds
00:01:17
to users decisions generating relevant
00:01:20
conversation or actions try this project
00:01:24
out following the link in the
00:01:26
description game creators and virtual
00:01:28
developers love having more control over
00:01:30
the characters they design this includes
00:01:32
supporting various narratives and
00:01:34
ensuring that the character acts and
00:01:35
responds appropriately in every Dynamic
00:01:38
scenario with convey narrative design
00:01:40
feature developers can create characters
00:01:42
that have agency and purpose giving them
00:01:45
the autonomy to generate both scripted
00:01:47
and generative responses and actions all
00:01:50
based on the decisions players make
00:01:52
we'll start this tutorial by setting up
00:01:54
your character in scene then we'll do a
00:01:56
quick overview of narrative design on
00:01:58
the convey playground enable conveys
00:02:01
essential components including lip sync
00:02:03
head tracking and more and then
00:02:05
configure narrative design manager
00:02:07
inside Unity we'll also show you how to
00:02:09
create a script for a tour guide
00:02:10
controller and then finally test it all
00:02:12
out let's get started to begin with
00:02:15
we'll download the project files which
00:02:17
consist of all the prerequisites for the
00:02:19
tour guide demo Linked In the
00:02:20
description then we'll start building on
00:02:22
top of it once the files are extracted
00:02:25
we'll head over to the unity Hub and add
00:02:27
our project files like so
00:02:31
while we wait for the project to load
00:02:33
head over to the unity asset store and
00:02:35
just search for convey click on it and
00:02:37
add it to your
00:02:40
assets now let's head over to the convey
00:02:43
playground our demo aims to create a
00:02:45
tour guide which will give new players a
00:02:47
tour of the warehouse so we've created a
00:02:50
story that would support our character's
00:02:54
narrative let's head to the narrative
00:02:56
design option where we can create a
00:02:57
narrative flow for our character to
00:03:00
learn more about how to customize the
00:03:02
narrative design for your character
00:03:04
watch our detailed walk through
00:03:05
following the link in the
00:03:07
description okay let's take a look at
00:03:09
how this narrative flow Works our
00:03:11
initial location is based on a trigger
00:03:13
that gets invoked once a player
00:03:14
approaches the tour guide here we'll use
00:03:18
narrative design to relay a message to
00:03:19
the player and based on the player's
00:03:22
Decision Guide them to the next
00:03:23
objective in the guided tour for example
00:03:27
once the player agrees to take the tour
00:03:29
the tour guide takes the user to the
00:03:30
conveyor belt and based on that trigger
00:03:33
the conveyor belt section gets
00:03:35
activated here the tour guide talks
00:03:37
about the conveyor build and generates
00:03:39
responses to any questions the user has
00:03:41
while also nudging the user to move to
00:03:43
the next part of the tour which is the
00:03:45
assembly line
00:03:46
robots so that was a very quick overview
00:03:49
of how narrative design
00:03:50
works now let's head back to our project
00:03:53
we'll start by enabling text mesh Pro
00:03:56
head over to window text mesh Pro and
00:03:59
import TMP
00:04:06
Essentials once that's done in the
00:04:08
package manager inside my assets we'll
00:04:10
search for NPC and import the convey
00:04:20
package hit install and then import
00:04:27
it once the convey SDK is imported click
00:04:30
on let's start if you see this pink
00:04:32
texture don't worry about it this is
00:04:34
just because the project is an hdrp
00:04:37
project under assets go to tutorial
00:04:40
starter content then Unity Factory scene
00:04:43
hdrp then scene Factory and finally load
00:04:47
the
00:04:48
scene once that's done we'll head over
00:04:50
to convey under assets then prefabs Bas
00:04:53
scene Essentials and drag and drop it
00:04:56
like so
00:05:05
as you can see the scene's now
00:05:11
loaded we don't need workers for this
00:05:13
tutorial so we'll disable it like so
00:05:16
next click on convey Essentials and drag
00:05:18
the player controller to the
00:05:22
scene if you try to test the scene
00:05:24
you'll see this pop up ensure that your
00:05:26
convey API key has been added here
00:05:30
so head over to the convey playground
00:05:32
copy your API key and paste it in hit
00:05:36
save and then once that's done let's
00:05:38
test out our
00:05:43
scene as you can see it's possible to
00:05:45
move around the scene since we won't be
00:05:47
using long-term memory for this project
00:05:49
we'll disable it by deleting convey
00:05:51
player datao and opting out of creating
00:05:54
a speaker
00:05:58
ID so that's that's it for the basic
00:06:02
setup now let's head over to the
00:06:04
tutorial start content Christina Smith
00:06:07
who's our tour guide and we'll drop her
00:06:09
prefab from the prefabs folder into the
00:06:15
scene for our narrative flow we want the
00:06:18
start section to trigger once the player
00:06:19
approaches the character and then the
00:06:21
conveyor belt section to trigger when
00:06:23
the character reaches here and finally
00:06:25
the assembly line section to trigger
00:06:27
when the character reaches here
00:06:30
so let's do that go to the Christina
00:06:33
Smith prefab and add the convey NPC
00:06:38
component copy and paste the character
00:06:40
name from your convey account and also
00:06:42
the character
00:06:44
id you can easily copy these from the
00:06:47
description next we'll add the animator
00:06:49
controller like
00:06:54
this and then enable convey components
00:06:57
NPC actions lip sync head and eye
00:07:00
tracking eye blinking and most
00:07:03
importantly The Narrative design
00:07:05
manager click on yes when prompted and
00:07:07
all of the components should be
00:07:10
added Under The Narrative design manager
00:07:13
we can see all the sections we created
00:07:14
in the narrative flow on the convey
00:07:16
playground already present here every
00:07:19
time a section starts or ends an event
00:07:21
is invoked and on the basis of that you
00:07:24
can customize how your character
00:07:25
interacts with the environment depending
00:07:27
on the user's decision
00:07:30
before we dive into narrative design
00:07:32
let's quickly set up facial expressions
00:07:35
inside convey lip sync click here and
00:07:37
add the reill usion preset for the
00:07:40
character Under head renderer drag and
00:07:43
drop the CC base body and then finally
00:07:45
drag and drop the CC based jaw bone and
00:07:48
CC based tongue so that's lipy sync done
00:07:52
for head and eye tracking the MPC will
00:07:53
always face the player camera unless a
00:07:56
Target object has been provided for this
00:07:59
tutorial will'll leave it blank for eye
00:08:01
blinking we'll again drag and drop the
00:08:03
CC Bas body for the index for the
00:08:06
eyelids you can head to CC base body and
00:08:10
under blend shapes you'll see the eye
00:08:12
blink left and eye blink right copy the
00:08:15
property path and paste it like
00:08:21
so the input is numeric so we'll keep
00:08:23
the number that's there 16 we'll assign
00:08:26
17 with the right eye and set the max
00:08:28
blend shap weight to
00:08:40
100 now let's add a capsule collider and
00:08:43
make it big enough for the
00:08:54
character we'll also add the nav mesh
00:08:57
agent in addition let's add some
00:09:00
negative offset so that the character
00:09:01
doesn't
00:09:05
float now let's give it a quick
00:09:09
test as you can see we're able to move
00:09:12
so let's try interacting with the NPC
00:09:15
hello how are
00:09:17
you hello it's your first day in the
00:09:20
office today right are you ready for an
00:09:22
ongr tour of the
00:09:25
facility so you can see that we're now
00:09:27
able to talk to the character
00:09:33
finally let's start the narrative design
00:09:35
implementation we'll start by adding a
00:09:37
3D cube and name it start section
00:09:45
trigger place it in your character's
00:09:47
vicinity and increase the width and
00:09:48
depth so that it covers this entire
00:09:52
section remove the mesh renderer and
00:09:55
make it a
00:09:56
trigger now add the narrative design
00:09:58
trigger component into it add your
00:10:01
convey MPC here and select the start
00:10:03
trigger option like
00:10:07
so we don't want the game object to be
00:10:10
active once the trigger is invoked so
00:10:12
we'll do that by dragging the start
00:10:14
section trigger here and then selecting
00:10:16
game object set
00:10:18
active we'll duplicate this process for
00:10:21
the conveyor belt and assembly line
00:10:26
triggers drag and drop the duplicate
00:10:29
cubes like
00:10:35
so now let's head back to our character
00:10:37
and go to the narrative design
00:10:40
manager here we'll leverage the start
00:10:42
and end section triggers we want the
00:10:45
conveyor belt trigger to be active when
00:10:47
the start section ends so we'll
00:10:49
configure that like so and then repeat
00:10:51
it for the assembly line robots
00:11:01
Now by default the conveyor belt and
00:11:03
assembly line section should get
00:11:04
deactivated and they'll be made active
00:11:07
only once their respective prior section
00:11:09
ends now let's head back to the tutorial
00:11:12
starter content and create a script for
00:11:14
the tour guide controller we'll attach
00:11:17
this to our
00:11:27
character once that that's done open the
00:11:30
script in your preferred IDE wait for
00:11:32
the project to get fully
00:11:40
indexed okay we can now create a private
00:11:43
variable of type convey action Handler
00:11:46
and name it convey action Handler then
00:11:49
in the awake method we'll need to get a
00:11:51
reference of the action Handler we'll
00:11:53
use the get component and then call the
00:11:55
convey action
00:11:56
Handler next we'll create a public
00:11:58
function and call it public void move to
00:12:01
and it will take a game
00:12:06
object head now inside the convey action
00:12:09
Handler and look for the move to
00:12:13
function we'll make it a public function
00:12:16
and before the animation initializes
00:12:18
we'll enable the nav mesh
00:12:21
agent once the character reaches the
00:12:23
desired Position will disable the nav
00:12:25
mesh agent like
00:12:28
so now inside the setup animation
00:12:31
navigation we'll comment out these lines
00:12:33
and do the same with the Finish
00:12:40
movement head back to the tour guide
00:12:42
controller script and give obj as the
00:12:46
target for convey action Handler move to
00:12:49
we'll call this inside a start co-
00:12:51
routin
00:12:52
function Now by default the nav mesh
00:12:55
agent should be turned off so let's save
00:12:57
the scene so when the conveyor belt
00:13:00
entry section starts the tour guide will
00:13:02
go to the conveyor belt trigger for that
00:13:05
we'll use the move to function and add
00:13:07
the conveyor belt
00:13:15
trigger repeat the same process for the
00:13:17
assembly line section
00:13:22
trigger we've noticed that 3.5 is too
00:13:25
high of speed for our character so we'll
00:13:27
set the value between 1.8 and two let's
00:13:31
quickly verify if we have selected the
00:13:33
right triggers so inside the conveyor
00:13:35
belt section trigger we'll select the
00:13:37
conveyor belt trigger and select the
00:13:40
assembly line trigger for the assembly
00:13:42
line section save the scene and head to
00:13:45
the game window to test it out
00:13:58
[Music]
00:14:04
hello it's your first day in the office
00:14:06
today right are you ready for an ongr
00:14:09
tour of the
00:14:11
facility yes I'm
00:14:14
ready okay then follow me as we can see
00:14:18
the tour guide is taking us from one
00:14:20
place to another and we can start
00:14:22
talking about the conveyor
00:14:25
belt the conveyor belt is a crucial part
00:14:27
of our operations here it helps in the
00:14:30
smooth transfer of goods from one point
00:14:32
to another do you have any questions
00:14:34
about
00:14:37
it yeah what does it
00:14:45
transfer the conveyor belt transfers raw
00:14:47
materials and finished products between
00:14:49
different sections of the factory it
00:14:51
ensures that everything is in the right
00:14:53
place at the right time do you have any
00:14:58
questions no let's continue with the
00:15:02
tour all right let's check out the
00:15:05
assembly line
00:15:13
robots yeah let's
00:15:19
go the assembly line robots are the
00:15:22
backbone of our production process they
00:15:24
are responsible for assembling the as
00:15:27
you can see our character isn't moving
00:15:28
to the assembly line area let's revisit
00:15:31
the conveyor belt
00:15:32
[Music]
00:15:35
trigger as you can see here we forgot to
00:15:38
enable the trigger so let's fix that
00:15:40
save the scene and try
00:15:56
again no it's very cool let's continue
00:15:59
with the
00:16:03
tour all right let's check out the
00:16:05
assembly line
00:16:07
robots as you can see the tour guide is
00:16:09
moving to the assembly line area now and
00:16:11
will tell us more about the robots and
00:16:13
entertain any of our questions or
00:16:15
converse with
00:16:18
us so this was all about creating a tour
00:16:21
guide inside conveyance narrative design
00:16:23
feature inside Unity hopefully you found
00:16:25
this tutorial helpful and we'd love to
00:16:27
see the Innovative Creations you build
00:16:29
using this and don't forget to like
00:16:31
share and subscribe for more Unity
00:16:32
content as always come by our Discord
00:16:35
for any questions or write to us at
00:16:37
support convey. comom for collabs and
00:16:39
business related queries happy
00:16:41
development and see you all again very
00:16:43
soon