Procedural City Generation in MASH

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so this is week three dealing with procedural City generation in my using mash so here we have ten different meshes and let me just kind of go through this real quick they're all the same size we're basically gonna be kit bashing these kind of like a Lego set so you have a bunch of different pieces and you're gonna be putting them together and then randomizing randomizing them to kind of create different buildings so some things to keep in mind when you have kind of your pieces ready is they need to be you vide make sure that there's no history that there are centered the pivots are all centered and that throughout the origin right so we kind of have basically one shape that the reading has and this is gonna be important because they need to be taking up basically the same amount of space when you propagate them and mash okay so I'm gonna select all these make sure we're in the animation tab here up to mash create mash Network alright so a couple things make sure it's named and then you can use one of these distribution types if you want I'm just going with this one because it's more straightforward and another thing is make sure that this is instance er not mesh default is on mesh and basically when you use that it's when it duplicates everything and propagates it throughout your your 3d space its duplicating the actual geometry so it really is taxing your computer a lot more than if you were using an instance err which is just basically referencing the geometry and then duplicating it in your viewport so it's not actually there but it's it's and the there's no actual geometry in there it just looks like it's there so use the instance source a lot faster alright so I'm applying clothes so we have created our mash Network um just some things to keep in mind here your tabs and everything gonna be over here but if you want to see it in your outline or just type in mash and then press the X it's kind of a glitch but you had to do that in order for your mash network to show up in your outliner but it's just gonna handy way of you know pulling it back up because sometimes you'll be like where'd that go and then you know so just really quick um so we're gonna go here to this distribute points I'm gonna set it to five and then you have a bunch of different albums options here if you're feel free to explore them I'm not gonna go over it in this tutorial so distance on my increase that do we get kind of this stack going on here I'll be right although our next step we're gonna next thing we're gonna do so I'm going to go to the buildings and add a replicator node basically it's exactly what it sounds like just repeats your your network over and over zero let's do something then what I'm gonna do is I'm basically just gonna create the same thing on the z axis so that 210 on the Z I'm at seven 240 so and the next thing we're gonna do is you can see we only have basically one of the one of the ten pieces only one being referenced as it's kind of repeating throughout all this our system our network here so we want to basically randomize the the IDs is what we call want to randomize all of these different meshes so that it looks like these are a bunch of different buildings so go to your two buildings click on ID add ID note and as you can see it's already kind of doing some cool stuff here but we want it to be more random as you can see kind of is going on here there's pattern we want to make it completely random so just go over here and select from linear go to random make sure your IAD ID count is the same as the actual number of IDs it's already have and then you can do this random seed here which is just you know it's basically just uh if you want something different you can check that out too there's some more specific options like probability ramps strength and everything look into those I'm not going to go over them in this video but as you can see it's been four minutes and we basically already have a procedural city generated so not perfect but this has a lot of different uses not just for procedural City generation but for you know any kind of propagation that requires some level of randomest you canyou you could basically implement this so yeah very very very quick another thing to keep in mind too is that because this is all referencing basically ten pieces of geometry you can alter these pieces of geometry and it'll update real time right so if I give if I go over here let's find on which one is this let me find this real quick I'm gonna hide these pull these back up just kind of go through this real quick looking for this guy okay so if I take this guy and I just pull it over here I bring this back right so as you can see this this geometry is basically this one I here if I go in here this crap these hopefully my little crash thanks Trudy check this out it's propagating through the entire network so as you can see this is extreme and extremely fast and very very efficient because you can update anything at any point in the workflow so I just wanted to do a quick demo on that and the next thing I'm gonna be going over is basically how to kind of create a little bit more organic placement of your buildings because this is a little bit grid structure right now we're gonna do go over some ways to make that a little bit more organic ok so here's another approach to kind of propagating a city if you're doing more on a large scale like a skyline right so if you're using a node called the placer node which is a node and mash that basically it's a little bit more hands-on you have a little bit more control over where you want instances specifically so bring a bar or mash Network I'm going to plug in the place or node and this is more of like a painting map based node you're gonna be doing it by hand but you can as you can see get some really organic results which is a little bit more realistic depending on what you're going for but you get some options there's you can see on the right-hand side there's a lot of attributes you can change beware the the ID mode at the bottom that's pretty important you want to adjust what's specifically which ID you want to place that nudge tool was very useful too and again you can select individual instances move them rotate them scale so it's all interactive remember this is mash so that where everything is procedural at this point we can add a random node change this rotation right so yeah yeah very very useful you can add an ID node if you want to change the the types of the buildings after you've already placed them you're welcome to do that and yes so that's pretty much the place or node we're gonna try something a little bit different year we're gonna create a new mash networking and we're basically going to tell mash where we want our buildings based off of a map so I'm gonna create a ramp here and I'm gonna put on textures and just to show you what I'm doing basically we're going to use the distributor node and set it to grid it's really important make sure your grid is the same size as the map that you're the floor plane that you're using okay so we're just gonna get a bunch of instances going here when it dropped the floor playing it to the map helper that's under the strength attribute and basically what I'm doing here in the node editor is I'm just trying to find that ramp that I put on the Blin and I'm just gonna connect it to the math strength of the distributor node and mash so don't get don't be too scared by that but so we're gonna plug it into the strength and now you can see that that ramp is dictating where those buildings are being propagated which obviously has a lot of implications so now we're gonna take this one step further and we're not gonna use a ramp before we're going to use a map that we've created to tell mash where we want two buildings to be so we're an imported texture and it's one that I made actually procedurally in After Effects so you can create these procedurally as well and we're basically going to locate our nodes and do the same thing just plug them together there's a couple different resources out there for creating maps procedurally one of them is Jace placement it was a really really good one and then of course you can learn it in After Effects if you wanted to all right so we took we're gonna take our texture we're gonna load that up then we're in a plug just to show you what's going on the code and then also into the strength map so as you can see for the most part the buildings are occupying only the white spaces if we increase the density you can see it a little bit more clearly but this is just a little bit more realistic way of going about city propagation on a large scale and then of course it's procedural so you can add ID you can change the type of the buildings yep yeah so fully procedural so we're gonna move on here to a a little bit smaller scale when you're working with a set you have a lot of set pieces that you need to kind of put around your set how do you do that we're gonna use a placer node again and this time we're not gonna be using so much of the scatter feature as we are going to be using individual IDs as you can see you basically just plop down couple streetlamps change your ID to maybe a trash can just put them down it's a very very quick really really fast if you gotta just throw something down again for something like previous this is really really fast so and again you can select individual instances rotate them if you need to just put them in place and if you don't want to do that you're welcome to select the original mesh and adjust that if you need to gain fully procedural so for this week the purpose is kind of how did you have to go about creating a city procedurally we've gone though we've gone over buildings and kind of smaller set pieces like lampposts and benches but how do you go about roads well there's a technique that I've kind of stumbled across which is really good for going about this so we're gonna go to create and we're going to create C B curve they're going to an orthographic view I'm just gonna make it really simple kind of horseshoe shape really simple okay go back into perspective and I'm going to create a cube focusing on the cube or do a little bit of modeling here okay I'm just gonna scale that out we're gonna go to to create some face mode and extrude these four faces here check my shirt pull this down please pull it up okay so we kind of have this i-beam shape here and I go ahead and delete history scale it up just a little bit look at skirt let's go up top again alright freeze transforms I'm gonna select this I'm going to snap it over here to this curve focus in here just make sure that this is kind of okay so I'm gonna select the front faces of this kind of eye beam shape here like so and I'm going to shift select extrude along curve run up these divisions great so now what we have here actually you conventionally you would delete history at this point if you're working with modeling but one thing that you can do is you can keep history and adjust this curve and in turn in doing so you're gonna actually adjust the mesh because it has history on it so we're going to select this guy go to vertex control vertex you can actually adjust the mesh now based on the curve it's kind of like a deform or in a lot of ways but there's a lot of very cool applications for this because you're using a curve and because a lot of basically functions in Maya can be based around using a curve let me show you kind of an application for this that is really really cool using mash so I'm gonna go ahead and get rid of the scene I'm gonna open up another one Oprah scene I'm gonna open up this highway scene here so what I did was that basically use the curve information with what we just went over all right let's see if I can kind of get rid of these so just isolate so basically using mash you can animate along curves you can propagate along curves and so what I did was basically created a really really low res car and then using the principles that we went over you propagated along the curve and then using a mash using mashes networks animating along the curves so what we have here is a little highway and the cool thing here is that I just go into wireframe go into control vertex this entire thing is procedural right so I can go in here change highway shape it's gonna update the cars a path and the highway all at the same time okay and this has a lot of applications just keeping this one curve I have actually done a little bit of like previz and just we go back here front this little motorcycle right and I've attached the motorcycle to the curve and to the motorcycle I've attached a camera right so if I go in here camera shape one we actually have this really cool little previz shot here right now this is all procedural keep that in mind right so if I go back here to perspective view I can update this curve right going your update curve and in doing so go back over to our first camera it's going to update the animation it's pretty cool so that's a bit of an overview of kind of how to approach procedural City generation using Maya and mash it's been a good week I've learned a lot and really excited to get more to mash I think it's really really pretty powerful tool in Maya so yep until next week
Info
Channel: T J Cousler
Views: 8,793
Rating: undefined out of 5
Keywords:
Id: hHm77sWt9zk
Channel Id: undefined
Length: 15min 42sec (942 seconds)
Published: Fri Feb 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.