Level Map Making in Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello I'm gonna share with you a very efficient way of creating a level map for your game and we are in blender 2.79 you could also do the same thing in 2.80 what we're going to do here initially is start off with the cube that is in the default scene and we are going to take that cube and we're going to move it upwards by one unit in other words we're gonna run the grab command and we are going to specify that we want to grab and move it in the z direction by one unit to perform this action we're going to press G super grab we're going to be pressing Z so we're going to press G and then Z and you can see the axis over there if constraint comes up and then we're going to press one and then enter so that's G z1 and enter and now we have our cube that we're gonna be using here is the fundament for our level map and we have it sitting on the if you want to call it the floor that visual depiction right there of the XY plane alright next thing we're gonna do is we're gonna put this cube into edit mode by tabbing pressing the tab key will deselect everything with the a key and we're gonna go down here and we're going to select the face select mode putting it in face select let's go ahead and use two fingers on the trackpad and go ahead and rotate our camera here a little bit our view of the scene and let's go ahead and right click on this face with two fingers on the trackpad what we'll do next is Warwick strewed by pressing E and then drag one fig one finger on the trackpad will drag out to right here and we'll click and then we are going to go ahead and grab this and move it up so G Z and then we can just move our finger on the trackpad up and then we're going to click once more to finish on the trackpad to rotate it around over to here pinch in on the trackpad to zoom out a little bit and we'll do e for extruding and then we will pull on the trackpad with one finger and then we will click and then we will select this side with a right click that's two fingers on the trackpad we'll press e to extrude out we'll click two fingers on the trackpad to Road it rotate around and then we'll do two fingers on the trackpad to write select right click this face and go e extrude this out and this is the basic pattern we're gonna follow here what we're gonna do now is we're gonna with this face selected we're gonna go to mesh edges subdivide and do that again mesh edges subdivide so we did that twice okay what we're gonna do now is we are going to press a to deselect everything we're gonna go into if we go to right view if you press three on the numpads right view press 1 that's front view I guess we'll go to one that's front view and we'll go into orthographic mode with five one and then five we'll press shift alternate click and drag to Center our model then we're gonna go ahead and grab these or we're gonna go select these faces with box select so the press B will box select just these faces right in here go ahead and go down to mesh cleanup limited dissolve and will dissolve those faces into one right there and then we're gonna go ahead and extrude out so we'll press E and drag out to extrude and then we're gonna go so we're going to go G Z and drag that up and then we'll zoom out a little bit more then we're going to go e to extrude out right there maybe I'll go a little further and then we are going to go into let's see if we go to one let's go to three side view let's go to the other way let's go to shift three and if we go over here too let's go to one again I want to go to I want to pretty much yeah I want to work from this side right here so this is two and five in orthographic mode right there I'm gonna go and select these with over here box select B box select these over here just got those faces I got some extra faces here I've got to deselect that and deselect this by going shift and right clicking so I only have the faces over here and then we're gonna go ahead and go mesh edges subdivide again and let's take a look at that and to do it one more time mesh edges and subdivide once more and let's deselect everything by pressing a and let's go ahead and go zoom in a little bit here shift alternate dragged over let's just box select these faces over here B box select these and now we got these make sure that's all we got and then we're gonna extrude out a hallway over to that direction we're gonna go e extrude that out maybe there's good an out a little bit and then we'll go again to extrude out and at this point let's go ahead and tilt down a little bit zoom in shift alternate drag over let's go ahead and just select these faces right in here with the box select so let's go from here to here box select that we get the top - yeah we did so we got a little bit more than what we wanted it's go it's gonna go from NZ let me unselect everything first with a we go back down here so I look at it dead-on and go box select and get just the faces one on that side so I got just what I wanted right there and I might as well at it go clean up limited dissolve and then we're gonna go ahead and pull that out there we go II extrude that out and I think that's fine I'm gonna go out of ortho mode by pressing v and take a look at the map that we've created here so it's basically two large rooms and some hallways connecting them what we're gonna do next is we're gonna clean up the geometry a little bit more I'm just gonna go ahead and just box Z to wireframe mode and B box select the entire mesh that's in edit mode now we're gonna go ahead down here and go to mesh cleanup and run the limited dissolve on it that's cleaned up the mesh considerably we're gonna go back out of wireframe mode by pressing Z back into a solid rendering mode and now that we have that done we're ready to apply a couple materials here so we can go over to the right side panel and we can go to the materials section by clicking on the material section button and we're just gonna go ahead and name this first slot over here first material flat let's just call this Shh I don't know walls this will be the walls on the underscore ceiling underscore material let's just call it that and we'll set the diffuse color for that to be maybe a kind of a grayish blue and then we're going to go ahead and add another material a slot over here and we're going to add on the material that's in that slot then we're going to call that floor FL or underscore material and there we have so a floor material we're going to set the color for that to be let's just say kind of like that maybe something a little bit different it doesn't really matter what the color is we just want to make sure that you have this idea that we can set materials for different faces so I'm just gonna set it to that maybe you like that greenish color there maybe if I change it to HSV then I can actually also look at changing that value to be more muted so maybe that will be decent yeah so I've just changed the way I'm expressing the color here as an HSV color okay so now what I'm gonna do is gonna go over on the right I'm gonna select all the floor areas so I'm gonna make sure I select everything by pressing a deselect then I'm gonna select this by right selecting the floor right over there I'm gonna go over make sure I select over here shift right select is holding the shift down just selecting all of the floor areas make sure I get the whole all the floor areas okay yeah I think I got it all think that's all the floor and then I'm gonna go over here and I'm gonna assign it I'm gonna go click on floor material and then click assign now let's look under there and now we can see if I go press a to deselect everything now we have the two different colors we have the floor color now I could even change this material on the fly I can change this - it may be a better fit color I can change the it's right now change the value of I can make it however I want it right so the idea here is that this is gonna be a different color based upon whatever right so it's obviously that I have a different color for the floor and have a different color for the walls and ceiling now you can apply this basic same technique and you can select whatever faces you want and apply materials to those faces in the future if you decide to use anything other than basic diffuse colors and you're gonna use something like let's say image textures or so forth then at the very end it would be better for you to learn how to do texture baking where you would do an unwrapping of the do a UV map and then you would do texture baking but we're not going to get to that point here we're just gonna focus on adding different materials for different faces and just using basic diffuse color so with that being done we're almost done here we're gonna go ahead and select this all and so to do that I'm gonna go ahead and put it in Z first of all wireframe mode by pressing Z I'm gonna do box select this whole thing so I select that whole thing and we're gonna go to mesh well let's say even before I do that let me scale it let me scale it by a factor of four I find that a factor of four is good for what we're doing for our game engine so let's just go ahead and go s4 enter so we want to scale it by a factor of four now that we've done that we can see it's kind of like so what we're gonna do I'm gonna say that this is gonna be my spawn point down here so I'm gonna actually move that over to where it close to where zero zero is see if I do that such as that then I can kind of in the game I can expect I need to look at this I didn't have it quite the way I wanted okay actually so I want to go and shut look at different angles make sure you kind of have it doesn't have to be exact I mean I could put the face at the origin I could actually go click on that one face and go right to the origin but so it's kind of close there right now [Music] right there that's the idea so you know we can make it better but for right now let's just kind of say that think where your spawn points gonna be for your player to spawn in kind of put that down where that origin point is and after you've rescaled it right so we're gonna do after you've rescaled it is go ahead and go mesh normals flip the normals this is very important to flip the normals go ahead and press Z again with the normals flipped it's very important to understand we do this I'm gonna get out of orthographic mode by pressing well I was I was out of it with the normals flipped now this is gonna render the inside of these paper-thin this is like paper-thin modeling here so this is a really quick way to model it's presuming that we don't want to have all kind of detail outside we're just basically gonna be on the inside of this model so we need to flip them normals now I'm gonna go ahead and deselect everything with a so you've still got our different colors there for the floor I'm gonna go ahead and I can save this for later so go file save as and I'm just gonna call this level example level under this code sample and I'll save that in my models folder is a blender file excuse me next thing is what I will do is I will export that as a gob file and I'll set a level example gob and I'll put that on my desktop I guess export that to my desktop so now I have that gob file on my desk stop the next thing to do is to go ahead and put that into a remix so I'm gonna go ahead and put that into a game remix now to show you how to take it to that next step alright so here we go I'm gonna go ahead into the browser go over here and just go ahead and do fitly for its last CS one - remix bittley's CS one - remix and here we are going to remix our game engine kind of starter project and what we're gonna do here is go into the assets and we will add that go ahead and add asset we'll upload that model that level example so we're gonna upload that level example right in there and we still didn't add an admin key or anything we're just gonna use this temporarily to get our new map so a level example gonna go copy the URL now I'm gonna go in another tab and go that bitly navmesh 207 and we'll make a navmesh for this thing so there we go I'm gonna paste the navmesh into here hit enter or paste excuse me paste the URL to the seam in there to our level and here we are boom look at that see how it renders a little bit weird cuz we've flipped the normals but that's what exactly what we want I'm going to zoom out a little bit so we can kind of get a picture of it looks a little awkward because of the fact that it's kind of inside-out rendering you know the inside is getting the floors and the inside is getting rendered but that's exactly what we want now we're gonna build a nav mesh I'm gonna set the agent radius I forget what I had it set to for the dragon model so I'm gonna actually go back and look over here what I set it to i 2.2 2.2 was the agent radius I wrote that down as part of this last model so I'm gonna go set that agent radius to 2.2 you can set it this is only so big this is only 2.2 because specifically I have a dragon model there with big wings and a big wingspan so I don't want it to I don't want the wings to get clipped into the wall so I'm gonna go ahead and run a build on that and look at that it makes the navmesh doesn't quite do everything yet because if you look over there if I I'll go over here on the left and I'll make the level disappear so it doesn't have the complete level the navmesh looks pretty good except I'm missing right right I'm missing some this one section over here on this end that's because it's a little steeper than 30 degrees for the max slope so I'm gonna bring that up to maybe 35 and see if that will grab it 35 just about there's a little nobody seen yeah that actually works 35 works there actually so 35 got us that what we needed there for that navmesh now our nav mesh looks good let's export the nav mesh there is a nav mesh getting exported I'm gonna rename this according to what this says level example nav mesh so I'm gonna say name it the same way so I'm gonna go and show this in my finder I'm gonna change this over here from now flashed 22 to level underscore example underscore nav mesh and then I'll just go ahead and put it into my assets now that I have that what to check the spawn points and so forth so I'm gonna go ahead and just close that out and go into my assets and drag that nav mesh in here I could also edit the nav mesh I could export it as a GL B as well rather than just the GL Tia what the nav mesh is not gonna make too much of a difference in terms of the size it's only nine kilobytes go ahead and copy that for the nav mesh go into the index.html let's take a look over here in the index.html we clean out a lot of things in this default project so the scene model I actually have the nav mesh so I'm gonna replace the nav mesh URL here the next thing I will do is I will replace the scene model URL go to the assets and I will get the level example copy that go back to the index.html and I will use that URL in here for the scene model we will have to do some cleanup here for sure I am going to get rid of all this other stuff right now so I just have the empty so I'm gonna go everything from that plane the whole way down here to what everything down to stop right above the player I'm just gonna get rid of all that this I might already just clean that everything out at the beginning for you so you don't even have to get rid of those collectables and stuff so that's pretty much what we want and we'll have to do some adjustment once we um test this out so we got the scene model in there we got the navmesh got that dragon avatar so let's go see how it works well I actually have to put in a key I'm just gonna make a generic key here for the admin key do not use lame admin keys like that all right but for right now I'm just gonna use that as admin key and over here I'm gonna go and show live and let's go see what happens see where it spawns out it's not gonna be in the right place obviously I'm just gonna go admin login with admin key alright I'm gonna see if this is more interesting than the question of whether a submarine can swim alright so once I get in here see if the navmesh actually starts to take hold and it looks like it does let's see it looks like the navmesh is now working but I'm just spawned in the not the right spot but we can see here also the lighting makes it kind of hard to tell what is what so I'm going around these hallways here into that upper room if you will here's that upper room opening up no so we have this is working very nicely except right now we don't have any kind of point lights that would make this render when you just have these basic colors such as the floor color and the ceiling and walls it's gonna have that every single right every single face is gonna have just that one single color on it unless we start to go down right here that's where we came from so it works five we just not spawned at the right spot and we need some different lighting so let's go ahead and address that as well all right so let's go ahead and open up the inspector with control option I this is in Chrome on a Mac as well so I'm going to go ahead and kind of zoom out here a little bit in the inspector kind of get a feel for I think I have the player in the right spot right now but let me go ahead add so I'm actually down below cuz I set that down for so maybe that didn't so I could probably just go back and maybe if I set that at zero that would be better since I already kind of had it in the right spot so if I go back over here kind of didn't talk and allowed here just doing it see I'll have this minus 4 and minus 5 if I put this scene model at zero and I put the mash at minus one let's see how that works right so I have the navmesh actually a little bit lower than the scene model and we can kind of adjust those that will give you a different you know kind of change your perspective of how you're looking at things above the ground so you want to play with those positioning a little bit the Y positioning sometimes and then also in the player down here you can also change this value for the Y value of the camera to kind of lift it up above the ground more as well so those are things that you would consider when you're first setting up your scene on your level to kind of put the camera at the right height above the floor and maybe offset a little bit vertically the the navmesh from the model now that you you just play with those and find what works for you let me go back in and refresh this and let's see what happens let's go back into this all right let me go ahead in here all right that level looks better if it grabs right here to beginning that looks good thanks grabbing quickly going into that like I said we still haven't dealt with this obvious rendering issue with the inside of the the actual level map it looks really it's hard to tell where you're going and what's what but once we get some other lights in here some get a few different lights in this world it will render the shadows and the lights will make it easier to tell what's going on in this world we could also of course do this in blender and we can put whites and blender and bake shadows to help make it easier to tell what's going on well that's the scent we can see our map working so far let's go ahead and add a few I've had a few point lights in here so we're down to the beginning of spawning point so let's find out where this is out exactly so I have the player right here this is where I'd like to player to spawn so let me just go ahead and put the player right there this is where I want the players spawns I'm gonna go control option I open up the inspector once the inspector opens up here we're gonna go ahead and close that we're gonna go ahead and zoom out so you can kind of see what's going on a little bit better and I'm gonna drag this to get a different perspective let me click on the my player entity and we can see that's right where we want the player to spawn matter of fact we can have it spawn a little bit back from there so let's go ahead and just drag the player back a little bit from there so right there would be probably a good place to spawn and then we can literally just look at that position that position is up here negative one point four one zero point one two so negative one point four four one zero point one two so it can go back in here and go and change that on the player so on the player so we can go change the position right over here where it has the position values we can just look at that again it's negative one point four four so negative one points or four then then the second number was one just straight up one and then the third coordinate the Z coordinate is 0.12 0.12 and now we've repositioned the player responding to appropriate place now we can start adding a light so let's go over here in the inspector and let's go click on the scene up at the top click on the scene and we're going to click we're gonna add go click add a new entity and in that entity that we add we're gonna add a fleet drag down here further we can find where we get a light then add a light and now we can go ahead and move that around and change the type of light so if we go down to the type it's set as directional initially and then the direction set by the rotation of it over here we have we basically can change that the way it's pointed based on the rotation up here so let's just go over here first of all and identify this is the entity that was just spawned in let's lift that up so we can see the light already starting to work start to see the effect of that light let's rotated a little bit on the y-axis and let's run that dial you see if that's changing much let's go ahead and change this to like 30 whoops is that affecting our illumination at all so that rotation on the actual entity is not really affecting much in terms of what we're seeing so let's just keep that at zero let's lift this up a little bit more is the directional light and let's just jump into the world let's just see what adding a directional light like that does directional light is a lot lower cost than let's say a write say something like a point light point lights gonna give us more detail in the this could provide in the elimination so let's go ahead and jump into that next and got to stop this recording have somebody coming over here
Info
Channel: Eric Eisaman
Views: 6,786
Rating: undefined out of 5
Keywords: CS1, CS1 Game Engine, Eric Eisaman, Mr. Eisaman, Computer Science, JavaScript, Blender
Id: IKkOLeAuEHI
Channel Id: undefined
Length: 30min 27sec (1827 seconds)
Published: Tue Mar 19 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.