Placeholder Image

Subtitles section Play video

  • All right, Welcome to lecture nine of G D 50.

  • Today's topic is dread halls.

  • So last week we ventured into Unity, our first foray into three D and not only three D, but also just getting our hands around, um, our heads and hands around the Unity Game engine, which is among unreal and others sort of the most popular game engines and use for to D and three d games.

  • Um, and last week we did sort of, ah, 2.5 d style helicopter game whereby everything wasn't three D, but we were still aligning things based on just two axes.

  • The X and A y, I believe possible dizzy and why I don't remember.

  • But two axes versus three axes today will actually be diving into using all three axes available, twisting 93 d in the context of a game called dread halls.

  • And so a dread halls is is a V.

  • It was a PR game, actually, the first of the our game that I ever played on the Oculus.

  • The Gear v.

  • R.

  • Simpson giv e r.

  • And it puts you in sort of this dark and eerie three D maze where you don't really know what's going on, and you can go around and get collectibles and encounter creatures and stuff as you can see in the bottom.

  • Right?

  • Screenshot there.

  • Um, today's examples gonna be a little simpler, but it allows us to explore things like procedural maze generation and, um, first person camera controls.

  • So last week, recall we were using sort of a 3 1/3 person camera whereby we were sort of far back on the scene today will actually be using a first person camera where the camera is effectively our eyes as if you were walking around in the maze ourselves.

  • Unfortunately, we won't be using a V R demonstration this week, but next week I hope to put together sort of a V R sampling.

  • Using this projects, we can see how this works in V R.

  • And how Unity's Toolkit works in V.

  • R.

  • So some of the topics will be covering today.

  • We'll be talking about texture ring.

  • So recall last week the helicopter and all of the items in our game where just sort of flat colors they didn't really have any texture associated with them.

  • We'll talk about how to assign textures to materials and how to apply those materials to objects.

  • In our scene, we'll talk about materials and lighting.

  • So not only materials, but also the different kinds of lights that unity supports and a few details about those we'll talk about again three d mais generations So we'll have a simple but effective algorithm for creating.

  • Um, a three D data structure trip is in our level, as opposed to previously where we had just a, you know, a tile map that we could generate to give us the appearance of walking around in some sort of two d world.

  • Now well, actually perform a similar operation on data to de Array.

  • But we'll take that arraign well, actually create three D blocks and create a maze that we can walk through in three D space.

  • Um, which is kind of fun and interesting.

  • Last week we only had one scene in our game.

  • So which was just a place seen.

  • And even though we had sort of like a game over state within that scene, we didn't transition between scenes.

  • We just sort of reloaded the same scene.

  • Today we'll have a title screen and a place scene.

  • Which sort of, um, is an evolution of the idea that we had in love to D, where we had a state machine that was governing our entire game in terms of the different states that we could be in, whether it was the title of the game over the place, state and so forth.

  • Unity does the same thing with seen objects, which are effectively a snapshot of ah Siri's of game objects aligned in a particular way.

  • In the editor, we'll talk about fog and also global lighting and certain other things that allow us to create a atmosphere conducive to the sort of feel that we want to get in our game today, which is sort of creepy and eerie.

  • And lastly, when we talk about how to create you y elements in the game, we'll talk about unity to D.

  • It's canvas object and text labels and some other things and how those are operating Um, which is sort of two sides of the same coin.

  • Unity three D also comes bundled with unity to D, a set of tools used to make not only to two games, but also to d interfaces that you can apply to your three D games.

  • So first a demo.

  • Now, I've been sick for the last week, so I'm not going to, uh, ask for anybody to come up in demo just because I don't want anybody else sick.

  • So I'm going to just go ahead and show, um, just this lecture, the game that I put together for you.

  • So here I have two scenes noticed here.

  • I have a title scene and a place seen him in the unity editor.

  • Right now, I'm gonna load up the title scene here, which I've done, and then notice that it has sort of a game to you in a scene view.

  • I'm gonna hit play, gonna make sure that it's set to maximize which it is.

  • And so we have sound here.

  • So we should hear audio and hit play and notice that we have sort of like this and being creepy music track playing.

  • Um, we have a very we could have easily done this in love to D.

  • This is just a black screen with two, uh, text labels on it.

  • And this is done with Unity's two d.

  • U.

  • I.

  • Tool kit.

  • And so it says it tells us to press, enter.

  • So if I press enter, we instantly get teleported into kind of like this maze, this creepy looking maize, and so I can walk around in this maze and there are a few things going on.

  • So, anybody can anybody tell me some of the things they notice about the scene, But what jumps out of them, what are some of the elements?

  • If you were to put this together yourself, where would you start?

  • What are the pieces that we can put together here?

  • Yes.

  • Yep.

  • There has to be a ground that you can stand on.

  • And there is So we're generating, uh, not only walls in our scene, of course, but we need a ground to sit in an office.

  • And also, if you look up top, it's kind of difficult to tell, but we also have a ceiling so ground in the ceiling and walls.

  • Some kind of lighting.

  • Yes.

  • Um, And so in this case, we're actually using ambient world lighting as opposed to having a light source.

  • So we'll take a look at that.

  • Last in last week's lecture we used for two weeks Prior is lecture we used a directional light object, but in this case we have no lights in the scene.

  • We're actually using Unity's World lighting, which will take a look at soon.

  • Um, when we walk around knows that I can move my where my camera's looking with my mouse.

  • So we're actually controlling the camera with a first person controller in F PS controller, which is actually a component that unity provides to you and then notice eventually.

  • If we keep exploring the maze, we come across this little thing here, which is a sort of a pickup, and when we pick this up, we get sort of like this piano weird, creepy piano sound and in the scene reloads, um, anybody noticed anything about what we see in the distance, like how that's how that's effective.

  • I think if I'm looking at this wall right here, for example, it's kind of hard to tell.

  • But as opposed to like down this hallway, what's what's the difference there?

  • The light sources for the ladies.

  • The light source is further away, kind of.

  • So we're we're experiencing here we're seeing is a It's a a graphics sort of concept called fog and So what fog lets you do is effectively adds color to the scene based upon how far away the objects are in the scene and multiplies color onto them.

  • And it gives you the illusion of looking in to look as if think you're surrounded by fog.

  • Basically, and it's been around for a very long time, back even as far as the N 64 days, and we'll talk about that later today.

  • It's actually incredibly easy to add that into a game with unity and its world lighting system.

  • Any idea as to how fog not only in terms of aesthetics, but how you could maybe help with performance?

  • Yeah, that's much you need as much pixel clarity kind of the the big thing about fog and the way that it was used a long time ago.

  • Is that because eventually things are completely opaque beyond a certain point, you don't need far draw distance in your game so you can actually like dynamically you can you can omit rendering things that are a certain distance away because you wouldn't be able to see them anyway, as this was an optimization technique.

  • Used a lot back when draw distance was a huge bottleneck on computers and gave video game consoles back in the nineties.

  • For example, like Silent Hill, the game for PS one was almost exclusively fog, and you could see very little in front of you, and we'll see a screen show that later.

  • Um, and they use that for to boost their performance and also to provide a certain aesthetic.

  • And then one other thing you might be being attention to is there's a sound on loop, just sort of this creepy sort of whispering sound.

  • And that's to, um, just at atmosphere, right?

  • Just because without it, we would.

  • You know, it's little things like that, especially in horror games like this.

  • The atmosphere can be everything.

  • So with very simple ideas, fog, some whispers, first person controller, sort of tight hallways.

  • Um, you been producing?

  • That's pretty scary.

  • Now there are a few things missing from this.

  • Namely, there's nothing that's going to come at you and attack you.

  • Um, but it would be not terribly difficult to add, but because we're using procedural generation, you would need what's called a knave mesh, and you would need to generate that procedure, least, that things could follow you in three D space.

  • Um, might have some time to talk about how to do that a little bit later today.

  • Um, but that's not implemented in this particular lecture, but it would be not to infeasible to accomplish, but those are some of the pieces that will take a look at today.

  • Um, so that was this is the title seen.

  • Notice that there's not a whole lot here, actually.

  • So raise him back out.

  • We can see, you know, canvases are huge and unity just because it's more optimized for the engine to render them that way.

  • But we can see even though it's a two d sort of, um, you I it's very visible in three D space.

  • And if you click this button here, we end up getting uh oh, no, that's just brings us into Sorry.

  • Click this button here.

  • That brings us into sort of the two D unity to demotes an hour interacting with things in two D, and I can actually click on this label and move it around in two D, as if we were using a to D game engine, as opposed to a three d game mentioned, so we'll look at that a little bit later.

  • This is the just the title scene.

  • So the placing itself, I'm not going to save that.

  • The play scene itself gonna go from two D back to 32 here is pretty much empty.

  • So we have a first person controller here.

  • This is the F PS controller.

  • Object, Same buddy.

  • Anybody tell what basically constitutes an FBS controller just by looking at the scene here?

  • What are some of the pieces that jump out at you?

  • I just put the camera right where the player is exactly.

  • But the camera right where the player is effectively where their head should be relative to where their body is and their body What's constituting their body here, Can you tell you could just be a cute looks like a Cuban.

  • It's this.

  • It's actually this capsule right here if you can see it.

  • Uh, there's this capsule here, this green capsule.

  • It's a little bit more organic feeling than a cube, necessarily.

  • But you could use a Cubas Well, um, but a capsule is how, uh, character controllers and unity are represented and character controllers sort of come for free in unity, which is really nice.

  • They're part of the standard assets.

  • So if you go to import package immunity, if you're going to assets import package, there's a lot of packages that come for free.

  • The sort of bootstrap you, um, noticed.

  • There's activity packages, cameras, characters.

  • The characters package has three D characters are third person characters, first person characters, some that are physics based on that are not physics based.

  • This particular controller is not physics based, meaning that we don't apply forces to it.

  • We move it around.

  • It's Kinnah Matic.

  • Um, it can't It is affected by gravity.

  • So, in a sense, that kind of his physics based.

  • But it's not strictly physics based like a rigid body and a rigid body would.

  • And the collisions that occur between this and other rigid body aren't the same as they would be if we were to make this a purely rigid, body based character controller.

  • There is a purely rigid, body based character controller that you can import having experimented with it a lot, but you could probably figure out a good use for that in terms of the game remade, you want toe move precisely on surfaces that have different materials, like icy surfaces or what not and have it apply it in a very physically realistic way.

  • Um, I have a few things that we have here in our place.

  • Seen.

  • We have a dungeon generator object.

  • So this dungeon generator object is just empty.

  • Object with a level generator script here.

  • And then we have a few other objects a floor parent, a walls parent and a whisper source.

  • So we'll get into the details of what all of those mean our goal today.

  • We'll be talking about a few things, so we'll be talking about.

  • Here's a picture of the storm maze.

  • So we talked about some of those things at a high level, will actually explore how to implement them immunity today.

  • So making a maze, making the fog effect, walking through it with our character controller.

  • We want to be able to have some kind of game play here.

  • So we have collectibles in the form of this red coin is actually part of another standard assets pack a prototype assets packed.

  • It comes with a prototype little coin object that you can throw in.

  • Um, anybody noticed anything about this coin beyond the fact that it's, you know, just a sort of red coin.