Create Entire Cities Automatically With PCG Splines! Procedural Content Generation in Unreal Engine

Aziel Arts
16 Oct 202316:56

Summary

TLDRこのビデオでは、Unreal Engineのプロシージャルコンテンツ生成フレームワークを使って中世の町を数分で作り上げる方法を紹介します。スプラインを使用して町の形を定義し、スプラインロードで町を通過させ、スプラインに沿って道路ジオメトリーを生成して効果を豊かにします。PCG初心者向けガイドもリンクしています。プロシージャルな森の周りに町を生成し、スプラインを用いた建物の配置と道路のカットアウトを学ぶことができます。

Takeaways

  • 🏰 スクリプトはUnreal Engine内でプロシージャルコンテンツ生成フレームワークを使用して中世の町を短時間で作成する方法を紹介しています。
  • 🛠 スプラインを使用して町の形状を定義し、スプラインロードを通して町を切り抜き、スプラインに沿って道路ジオメトリを生成する方法を学びます。
  • 🔍 PCGの初心者向けガイドは、ビデオの下にリンクされているため、必要な場合は参照できます。
  • 📐 まず、既存のPCGボリュームを切り抜くためのスプライン形状を作成する必要があります。
  • 🔌 「modeling tools editor mode」というプラグインを有効にする必要があり、編集とプラグインのセクションで「modeling」を入力して確認します。
  • 🎨 「Modeling」ツールを使用してスプラインを作成し、地面上に円を描画し、ループをチェックして閉じる方法が紹介されています。
  • 📂 スプラインにタグを追加し、PCGボリュームで使用するスプラインと他のスプラインを区別します。
  • 🌳 フォレストのPCGボリュームを設定し、スプラインを使用して木々が生える地域を定義します。
  • 🏠 新しいPCGグラフを作成し、町に建物を自動生成するための設定を行います。
  • 🛤️ 町を通過するロードを作成し、スプラインを使用して建物との重なりをカットアウトします。
  • 🌲 ロードに沿って繰り返し生成される地面メッシュを追加して、自然な道のりを実現します。

Q & A

  • ビデオで紹介されている Unreal Engine のプロシージャルコンテンツ生成フレームワークとは何ですか?

    -ビデオでは、Unreal Engineのプロシージャルコンテンツ生成フレームワーク(PCG)を使用して中世の街を短時間で作成する方法が紹介されています。これは、ランダム性やルールに基づいた方法でコンテンツを自動生成する機能です。

  • ビデオで使用されているスプラインとは何で、どのような役割を果たしますか?

    -スプラインは、Unreal Engineのモデリングツールの一つで、曲線や形状を定義するために使用されます。ビデオではスプラインを使用して街の形状を定義し、道を通過させるためのスプラインも作成されています。

  • ビデオのチュートリアルでは、どのようにして森に囲まれた中世の街を作成する予定ですか?

    -ビデオでは、まずPCGボリュームを作成し、森を生成した後、スプラインを使用して街の形状を定義し、その中に街を生成するプロセスが説明されています。

  • スプラインを使用する前に、Unreal Engineに必要なプラグインを有効にする必要がありますか?

    -はい、ビデオでは「modeling tools editor mode」プラグインを有効にする必要があると説明されています。これにより、スプラインなどのモデリングツールを使用できるようになります。

  • スプラインを描画する際に「World」オプションをオフにすることによって何が得られますか?

    -「World」オプションをオフにすることで、スプラインを地面平面上に限定して描画することができます。これにより、スプラインが周囲の木々などに描画されることを防ぎます。

  • ビデオで紹介されている街の形状を定義するスプラインにタグを追加する目的は何ですか?

    -タグを追加することで、PCGボリュームが特定のスプラインを認識し、その形状に基づいてコンテンツを生成するように指定することができます。

  • PCGグラフ内で「Difference」ノードを使用する目的は何ですか?

    -「Difference」ノードは、スプラインから得られるポイントと、他のポイント(例えば森の木々のポイント)を比較し、重複するポイントを削除する役割を果たします。これにより、街のクリアリングが作成されます。

  • ビデオで使用されている「Spline Sampler」ノードの「Interior」オプションとは何を意味しますか?

    -「Interior」オプションは、スプラインの内部にあるポイントのみをサンプリングするように指示します。これにより、街の形状の内部にポイントが生成されるため、建物が適切に配置されるようになります。

  • 建物をランダムに配置する際に「Attribute Noise」ノードを追加する理由は何ですか?

    -「Attribute Noise」ノードは、メッシュスポーンのランダム性を調整し、建物の配置をより自然に見せるために使用されます。ノイズの値を調整することで、建物の配置のランダム性をコントロールできます。

  • ビデオで作成される道のスプラインにはどのようなタグが付けられますか?

    -道のスプラインには「Road shape」というタグが付けられます。これにより、PCGグラフが道を特定し、それに沿ってポイントを生成するように指示されます。

  • ビデオの最後に、道に沿って繰り返される地面メッシュを追加する目的は何ですか?

    -地面メッシュを道に沿って繰り返すことで、道に自然な土の道のような見た目を与えることができます。これにより、街の道にリアルな雰囲気が生まれます。

Outlines

00:00

🏰 制作中世纪城镇的开始

このビデオでは、Unreal Engineのプロシージャルコンテンツ生成フレームワークを使用してわずか数分で中世の町を作り上げる方法を紹介します。スプラインを使用して町の形状を定義し、スプライン・ロードで町を通過させ、ロードジオメトリをスプラインに沿って生成する方法を説明します。PCG初心者向けガイドもリンクしてあります。

05:00

🛠 スプラインを使用した町の形状の定義

Unreal Engineのモデリングツールを使用してスプラインを描き、町の輪郭を作ります。スプラインを閉じるためにループオプションをチェックし、タグを追加してPCGボリュームから他のスプラインと区別します。次に、PCGグラフ内で差分ノードを使用して、スプラインが定義する領域のポイントをカットアウトします。

10:02

🏘️ 中世の町の建物の配置

新しいPCGグラフを作成し、スプラインデータを取得して町の内側のポイントをサンプリングします。ポイントサイズを調整して建物が適切に配置されるようにし、静的メッシュスポナーを使用して様々な中世の建物を追加します。建物の配置が不自然な場合は、シードを調整するかノイズノードを追加してランダム性を増します。

15:02

🛤️ 道のスプラインと路面の生成

町を通過する道のスプラインを作成し、そのスプラインデータをPCGグラフに取り込み、ポイントを距離ベースで均等に配置します。路面として森の床面メッシュをスポーンし、サイズと回転を調整して自然な道の見た目を作り出します。最後に、道が建物を通過するように差分ノードを設定し、路面を道に沿って繰り返しスポーンさせることで完成します。

🎨 プロジェクトへの応用とさらなる学習へのリンク

このビデオを通じて学んだ技術を使ってどんなプロジェクトに応用するかコメント欄で共有を呼びかけています。ビデオが役立った場合は好評を示し、さらなる複雑な効果やアニメーション、フィルム作成に関するUnreal Engineの学習を希望者はリンクされた無料トレーニングや関連ビデオをチェックするよう促します。

Mindmap

Keywords

💡プロシージャルコンテンツ生成(PCG)

プロシージャルコンテンツ生成とは、コンピュータプログラムがランダム性やアルゴリズムを用いてコンテンツを生成する技術です。ビデオでは、Unreal Engine内のPCGフレームワークを使って中世の街を作り上げる方法が紹介されています。これは、手動での作成より効率的で柔軟性があります。

💡スプライン

スプラインは、数学やコンピュータグラフィックスにおいて、曲線を定義する一種の多項式です。ビデオでは、スプラインを使用して中世の街の形状を定義し、スプライン・サークルで街の輪郭を作り、スプライン・ロードで街を通過させる方法が説明されています。

💡Unreal Engine

Unreal Engineは、エピックゲームズが開発した3Dゲームエンジンで、ビデオ制作やVRアプリケーションにも使われています。ビデオでは、このエンジン内でPCGフレームワークを活用して街を生成する方法が紹介されています。

💡スプラインサークル

スプラインサークルは、スプラインを使用して作られる閉じた輪郭形状です。ビデオでは、スプラインサークルを使って中世の街の外形を作り、その内部に建物や道路を配置する方法が説明されています。

💡スプラインロード

スプラインロードは、スプラインを使って作られる道路を意味します。ビデオでは、スプラインロードを通して街を通り、その沿いに建物を生成するプロセスが紹介されています。

💡タグ

タグは、オブジェクトやデータに関連性を付けるラベルのようなもので、検索や識別に使われます。ビデオでは、スプラインにタグを付けてPCGボリュームに伝え、特定のスプラインだけを使用するように指示する方法が説明されています。

💡PCGボリューム

PCGボリュームは、プロシージャルコンテンツ生成フレームワーク内で使用される空間的なパラメーターです。ビデオでは、森を周囲に持ち込むPCGボリュームを設定し、その中で街を生成するプロセスが紹介されています。

💡ステンシルデータ

ステンシルデータは、スプラインなどの形状情報をコンピュータが理解する形式に変換したものです。ビデオでは、ステンシルデータをPCGグラフに取り込み、街の形状を定義するのに役立てる方法が説明されています。

💡静的メッシュスポナー

静的メッシュスポナーは、3D空間に静的な3Dモデルをランダムまたは一定のパターンで配置する機能です。ビデオでは、中世の建物を街にランダムに配置する際にこの機能を使って建物をスポーンする方法が紹介されています。

💡属性ノイズ

属性ノイズとは、ランダム性を加えることで生成物のバラつきを増やす技術です。ビデオでは、建物の配置が均一でないように見えるために属性ノイズを使ってランダム性を加える方法が説明されています。

Highlights

展示如何在几分钟内使用Unreal Engine中的程序化内容生成框架制作中世纪城镇。

使用样条曲线圆定义城镇的形状。

使用样条道路切割城镇并生成沿样条的道路几何体。

为初学者提供程序化内容生成(PCG)的入门指南链接。

介绍如何设置PCG体积以生成围绕中世纪城镇的森林。

启用建模工具编辑模式插件以创建样条。

使用建模工具直接创建样条比使用蓝图更简单快捷。

通过绘制样条工具在地面上绘制城镇的圆形样条。

使用标签区分不同的样条,以便PCG体积正确识别。

通过差分节点和样条数据创建一个清除点,以生成空地。

创建新的PCG图来生成城镇本身的结构。

调整样条采样器的参数以控制建筑物的分布。

使用静态网格生成器添加不同的中世纪建筑。

通过调整种子和属性噪声增加建筑物分布的随机性。

添加变换点节点以调整建筑物的方向。

创建道路样条并使用它来切割城镇的点。

使用变换点和静态网格生成器沿道路生成地面网格。

鼓励观众分享他们如何将此效果应用于不同项目。

提供链接到更多关于Unreal Engine动画和电影制作的免费培训。

Transcripts

play00:00

hello in this video I'm going to be

play00:01

showing you how I made this medieval

play00:03

town in just a few minutes using splines

play00:06

with the procedural content generation

play00:08

framework inside of Unreal Engine I'm

play00:10

going to be showing you how to use a

play00:11

spline Circle to define the shape of

play00:14

your town how to use a spline road to

play00:17

cut through that town and then how to

play00:19

spawn a road geometry along that spline

play00:21

in order to fill out the effect and if

play00:24

you're new to PCG and you want more of a

play00:25

beginner's guide I will link that video

play00:27

below this so let's get into it so

play00:28

here's the town we're going to be

play00:29

building I'm just going to come over

play00:30

here to the spline actors and the PCG

play00:34

actors and go ahead and delete them and

play00:36

you'll notice I have already set up a

play00:38

PCG volume inside of this level to spawn

play00:42

the forest that's going to be around

play00:44

this medieval town but if you'd like

play00:45

tutorials on how to do that I will link

play00:47

that as well below this video so what we

play00:49

need to do to make a Town spawned inside

play00:52

of this Forest is first to create a

play00:53

spline shape that will cut out the

play00:56

existing PCG volume that I've already

play00:58

set up here so we need to make sure sure

play01:00

there's one plugin enabled here and that

play01:01

is under edit and plugins we're going to

play01:04

type in modeling and you want to make

play01:05

sure you have modeling tools editor mode

play01:08

checked on and if it prompts you to

play01:10

restart the engine go ahead and do that

play01:12

now I'm going to come up here to the

play01:13

drop down in the top left corner and I'm

play01:15

going to choose modeling here this is

play01:18

going to open some modeling tools for me

play01:19

on the left side here and this is a much

play01:21

easier way to make a spline then to make

play01:24

a blueprint with a spline inside of it

play01:26

which some of you may be familiar with

play01:27

if you've made splines before this is a

play01:29

much easier way and gets us the result

play01:32

we want much quicker so I'm going to go

play01:33

ahead and come to the draw spline tool

play01:36

here and you can find that if you're not

play01:37

in it in the create button on the top

play01:40

left corner here so click on that click

play01:41

on draw spline and one thing I want to

play01:44

check here is that I uncheck world I

play01:46

really just want to Draw It On The

play01:48

Ground plane I don't want the spline to

play01:50

like draw onto trees up and down so I'm

play01:53

going to uncheck world but if you need a

play01:55

draw spline on other objects make sure

play01:57

that's checked on so then I'm just going

play01:59

to go ahead and click around in a circle

play02:02

however big I want my town to be here

play02:05

and in the top left corner here where it

play02:06

says Loop I'm going to go and check that

play02:08

so it closes the loop for me and I'm

play02:10

going go ahead and hit accept right here

play02:12

so now I have a spline for the shape of

play02:15

my town this can always be changed later

play02:17

as well if you want to edit it I just

play02:18

come out of the modeling mode and I can

play02:21

choose one of these points and move them

play02:23

around so the way that we're going to

play02:24

tell the PCT volume to use this spline

play02:28

and not other splines we're making in

play02:29

our level like the one we're going to

play02:31

make for the road is to add a tag to it

play02:33

with that spline actor selected I'm

play02:35

going to come over here and on the right

play02:37

side here I'm just going to go ahead and

play02:38

search tag to save us some time in the

play02:41

search bar here and under the actor tag

play02:43

section here I'm going to hit the plus

play02:44

button to add a new tag to this object

play02:47

and we're just going to call it town and

play02:49

then outside and pay attention to what

play02:51

you name it here cuz you'll need to

play02:52

remember it and type it into the PCG

play02:54

volume later so I'm going to go ahead

play02:55

and hit enter I come over here to my PCG

play02:57

volume here for the forest uh I click

play02:59

clear the tag section here that I added

play03:01

and I scroll down to the PGG component

play03:04

open the PCG and graph instances and

play03:06

then instance this is a PCD graph that's

play03:08

connected to the volume here so I'll

play03:10

double click on that to open it okay so

play03:12

this is what I have set up for the

play03:13

forest I have just a landscape surface

play03:15

sampler coming into a transform points

play03:18

to give the trees some random rotation

play03:20

and then I have some density filters to

play03:23

adjust how many points are on the

play03:25

surface and then I have a static mesh

play03:28

spawner for trees rocks and things like

play03:30

that okay super simple so what I need to

play03:32

do is cut out these points in this area

play03:35

here right before they're used to spawn

play03:37

so once I've done all the adjustments to

play03:38

those points that I want we're going to

play03:40

be creating a difference node so I'm

play03:42

going to draw off here and type in

play03:44

difference and I'll hold alt and click

play03:46

on this input here to disconnect it and

play03:48

reconnect it to the output and you want

play03:49

to make sure that the source here which

play03:51

is the point spawning those trees is

play03:53

plugged into source and then the

play03:55

differences section here that's where

play03:57

we'll plug in the data from our spline

play03:59

so in the difference node I need to

play04:01

change the density function here to

play04:03

Binary what this is doing is it's

play04:05

basically telling this node that when we

play04:07

give it the points that the spline has

play04:11

created inside of it which we're going

play04:12

to set up in a second to either choose

play04:14

one or the other so basically to

play04:16

completely remove all the points that

play04:18

overlap with the points from the spline

play04:20

so now we're going to right click in the

play04:22

empty space down here and I'm going to

play04:24

type in spline I'm going to choose get

play04:26

spline data first because we need to get

play04:28

this spline into the PCG graph and with

play04:31

that node selected I'm going to come

play04:32

over to the actor filter drop it down

play04:35

and choose all World actors so it's

play04:37

going to sample all the splines I have

play04:39

in my scene but I'm going to choose by

play04:41

tag here so it's going to choose the

play04:43

spline with the correct tag which if

play04:45

you'll remember we made as town outside

play04:49

and if that tag exists in the world

play04:52

you'll see the error on that spline data

play04:54

go away so it's got that's a good thing

play04:56

that means it's gotten the data from our

play04:58

spline now I'm going going to drag off

play05:00

of the get spline data here and we need

play05:02

to make a sampler just the same way we

play05:04

would sample a landscape so I'm going to

play05:07

type in spline again to get spline

play05:09

related stuff and we're going to choose

play05:11

a spline sampler here in the spline

play05:13

sampler there's a few different ways we

play05:15

could sample this spline and later on

play05:17

we'll use a different one but for this

play05:19

we want the inside of the spline so if I

play05:22

come up to the dimensions and instead of

play05:24

on spline I switch it to Interior it's

play05:26

going to get all the points inside that

play05:28

shape that closed shape that we made so

play05:30

let's actually take a look and make sure

play05:32

this is working so I'm going to come

play05:33

over and disconnect my mesh spawning so

play05:36

that we can actually see what the graph

play05:38

is doing then I'll contract this down so

play05:41

this is the shape of our town here and

play05:42

in the spline sampler I'm going to go

play05:44

ahead and press D to debug and we have

play05:47

one problem which is that this is only

play05:50

being sampled inside the bounds of our

play05:53

PCG volume which I actually turned off

play05:56

for the trees so it would fold the

play05:57

entire landscape so we actually have to

play05:59

to turn that off for the spine sampler

play06:01

as well and it's not actually super

play06:03

important to have only things spawn

play06:06

inside that volume because we're

play06:07

actually using the spline itself to tell

play06:09

us where the points are so we don't

play06:11

actually need that bounding shape of the

play06:13

volume so I'm going to come over to the

play06:14

spline sampler and choose Unbound here

play06:17

once we do that it's going to show you

play06:19

that it's spawned all these points all

play06:21

over the place so now we can come over

play06:23

to the differences node and let's take a

play06:26

look at what the points that we're using

play06:27

to spawn the trees look like so UND

play06:30

debug the spine sniper and debug the

play06:32

transform point and these are all the

play06:34

points I'm using for the trees and rocks

play06:36

so if we plug the spine sampler into the

play06:38

differences node here and we debug that

play06:41

you can see that the spline sampler is

play06:43

using the points from the spline data

play06:44

node to cut out those tree points so now

play06:48

if we plug it back into our mesh spawner

play06:50

section we can see we have successfully

play06:53

created an empty

play06:55

clearing all right so let's make a new

play06:57

pcga volume for or the town itself I'm

play07:00

going to close this for now right click

play07:02

in my content browser and come to PCG

play07:05

and choose PCG graph as I mentioned in

play07:07

other tutorials if you don't have the

play07:09

PCG option in your content browser it

play07:12

means you need to enable the plugin

play07:14

procedural content generation framework

play07:16

plug-in so I'm going to call this new

play07:17

PCG graph

play07:19

PCG town and I will drag it in to the

play07:23

environments I'll hit generate on the

play07:24

right side here and then I'll double

play07:26

click on it to open okay so we're going

play07:27

to come into the empty space here right

play07:29

click and type in and get the get spline

play07:32

data node here like we used before and

play07:34

we'll come over here to the action

play07:36

filter on the right side and choose all

play07:38

World actors and again under the buy Tag

play07:41

section we will type in town outside

play07:44

there we go so we're going to drag off

play07:45

of the out again here type in spline and

play07:48

get the spline sampler same as before

play07:50

this time let's go ahead and hit D to

play07:52

debug this particular node so we can see

play07:54

what we're working with and same as

play07:56

before we need to come over to this

play07:57

blind sampler and choose under Dimension

play08:00

where it says on spline you want to

play08:02

switch it over to on interior and scroll

play08:04

down again and choose Unbound or you

play08:07

could scale the PCG volume up far enough

play08:09

so that it would cover the whole spline

play08:11

shape it's up to you okay so it's pure

play08:14

white here and that's because all of the

play08:16

individual points are too big so I need

play08:19

to actually mess with those Point sizes

play08:21

so that it doesn't spawn too many

play08:23

buildings when I actually connect up the

play08:25

geometry spawner to it so we can start

play08:27

modifying these options here right now

play08:30

the interior sample spacing is 100 that

play08:33

means there's 100 units in between each

play08:36

sample if I increase that number to say

play08:38

something like 500 we can see it makes

play08:40

the dots smaller because it's giving a

play08:43

500 space in between them I'm going to

play08:45

go ahead and actually increase this to

play08:47

2,000 and you'll notice by default these

play08:50

points are getting spawned in a grid

play08:52

which is what we want for a town if you

play08:54

were to sample the landscape not using

play08:56

this method you would get points in a

play08:58

more random layout or random format and

play09:00

in this case we're getting a grid by

play09:02

default which is good one thing I do

play09:03

want to modify here is the bounds of

play09:05

each point since they're kind of small

play09:07

if I were to run a road through it which

play09:10

we're going to do in a in a second they

play09:11

would not actually probably overlap any

play09:13

of the points and therefore not cut them

play09:15

out they need to be roughly the size and

play09:17

shape of the buildings that we're about

play09:19

to add later so I'm going to go ahead

play09:21

and drag off of the out here and type in

play09:24

bounds and choose bounds modifier and

play09:27

we'll just up the bounds m Max to 10 on

play09:30

all of these once we've done that we can

play09:32

go ahead and debug that node and we can

play09:34

see these are much larger cubes which

play09:36

will work a lot better when we're

play09:37

cutting it out with the road okay now

play09:39

it's time to add our static mesh spawner

play09:41

to put our buildings in I'll drag off of

play09:43

the bounce modifier here type in static

play09:45

mesh spawner okay so we have the static

play09:48

mesh spawner I'll come over here to the

play09:51

mesh entries and expand that now I have

play09:54

downloaded a medieval buildings pack

play09:56

which I will link below this video if

play09:58

you're interested in using those as well

play10:00

but it contains all of these buildings

play10:01

here so I have a bunch of different

play10:03

buildings that I'm going to be adding to

play10:05

my mesh spawner so I'll just add one to

play10:07

show you how to do it which is to expand

play10:09

the mesh entries under the static mesh

play10:11

instance here and drag in a building of

play10:14

your choice then contract it hit the

play10:16

plus button again add another one open

play10:18

the descriptor drag in another building

play10:20

and we can see that we're already

play10:22

starting to populate our little village

play10:24

here now this is actually going to

play10:26

really look the best if you have a lot

play10:29

of different building options and I

play10:32

actually do I have around 22 of these

play10:34

buildings so I'm going to go ahead and

play10:36

plug all of those into this mesh spawner

play10:38

all right now they're all plugged in and

play10:39

we can see we already have a village

play10:41

that's looking pretty good here if

play10:43

you're not really happy with sort of the

play10:45

placement of the buildings or it doesn't

play10:47

quite look random enough you can come

play10:49

over here to the static mesh spawner and

play10:51

you can adjust the seed which is going

play10:53

to choose a just a random different

play10:55

selection of buildings here or if you're

play10:57

still not getting enough random

play10:59

something I have noticed helps a little

play11:01

bit is to add an additional node which

play11:04

I'll grab by typing in noise and I'll

play11:05

choose attribute noise and I'll plug

play11:07

that in in between and in the attribute

play11:10

noise under the input source I'm going

play11:12

to click on the little plus button here

play11:13

and choose seed and by default it's

play11:15

going to have only one building and then

play11:17

as I increase this noise Max here it's

play11:20

going to just creep increasing the

play11:22

randomness till I get something that I

play11:24

like that looks pretty good and if we

play11:26

have our buildings pointing in the wrong

play11:28

direction we you can always modify that

play11:29

as well by adding a transform points

play11:31

note here in between coming over here to

play11:34

the rotation Min and Max and adding a

play11:36

rotation in Z maybe 9° and that will

play11:39

rotate all of the buildings 90° now this

play11:42

really works best if you've modeled or

play11:45

at least rotated your building assets

play11:47

that you're starting with to be all

play11:49

facing the correct direction if they're

play11:51

all have the front of the building faced

play11:53

in different positions they're not going

play11:55

to quite look that well here and instead

play11:57

of adding like a lot of logic in to make

play11:59

sure they're all pointing the same

play12:00

direction it's just simpler to make sure

play12:02

each of your assets is you know

play12:04

efficiently pointing in the direction

play12:06

that you want them to point you could

play12:07

also use this rotation to add like a

play12:09

slight bit of Randomness maybe not too

play12:11

much but maybe between -5 and 5 that

play12:14

just rotates the building ever so

play12:16

slightly depends how gridlike you want

play12:18

them to look so now we're ready to add

play12:19

our road and the road is going to be

play12:21

another spline that we add on top here

play12:23

and it's going to cut through the points

play12:25

that we've already laid out for the town

play12:27

so come back over here to the mod

play12:28

modeling drop down and choose my draw

play12:31

spline option here I'm just going to

play12:34

have it go straight through the middle

play12:36

of my town I'll go ahead and hit enter

play12:39

switch back to selection mode and our

play12:41

second spline actor here we need to add

play12:43

a tag as well too so I'm going to come

play12:45

over here and insert type in tag for the

play12:49

asset and choose a little plus button

play12:51

here and type in Road shape or whatever

play12:53

you want to add next we'll come back

play12:55

into our graph here we'll right click

play12:57

and get spline data again and and this

play12:59

time we'll choose all World actors and

play13:01

the tag will be Road shape then we'll

play13:03

drag off of that sample it and I'm going

play13:05

to actually disconnect the houses here

play13:07

so that I can actually see the points

play13:09

that this new road is making so hold

play13:10

down alt and disconnect the static

play13:12

meshes and we'll go ahead and hit D to

play13:15

look at the spline sampler and I'm going

play13:16

to come over here to the mode here where

play13:18

it says subdivision and switch it to

play13:20

distance this is going to lay the points

play13:23

out along the curve more evenly we will

play13:25

keep it as on spline here in contrast to

play13:28

what we did for the town earlier and

play13:30

we'll drag off of here and make a bounds

play13:33

modifier we'll debug that and let's

play13:35

expand those points because right now

play13:37

there are actually points being

play13:38

simulated but they're too tiny to see so

play13:40

we'll just come over to the bounds Min

play13:42

and Max and let's in the Y AIS increase

play13:45

it to 500 here we can see the points

play13:48

have expanded the width of about the

play13:50

shape of the road that we want however

play13:51

they're only getting simulated again

play13:53

within the volume the PCD shape so

play13:55

probably we should have just made it

play13:56

bigger but at this point I'm committed

play13:58

to using the Unbound option here so I'll

play14:01

come over to the spinee sampler and

play14:02

check on Unbound and now you can see the

play14:05

points are being simulated all along

play14:06

this line okay so now we have our road

play14:08

and we have the points of the town so we

play14:12

need to make a difference node in

play14:13

between here so drag off of the

play14:15

transform points that we're using to

play14:17

simulate the buildings make a difference

play14:19

node and the difference is going to plug

play14:21

into those points from the road let's go

play14:24

ahead and look at what that looks like

play14:26

and you can see the road is cutting

play14:27

right through the building here however

play14:29

nothing is happening as because in the

play14:31

difference Zone we need to come back

play14:33

over here if you remember earlier we

play14:34

need to switch the density function to

play14:37

Binary and then it will cut out the

play14:39

buildings that overlap with those points

play14:42

now we can plug it back into our static

play14:43

mesh spawner and we have a road that

play14:45

will dynamically cut through our town

play14:49

and to make this road look a little bit

play14:50

better I'm going to add a mesh to be

play14:52

simulated and spawned along it and

play14:54

repeated to make kind of a muddy path so

play14:57

I'll drag off of the actual Road points

play14:59

here and make a transform points node so

play15:02

I know I will need it to modify the mesh

play15:04

then I'll drag off of that and type in

play15:05

static mesh spawner and I will be adding

play15:08

the forest ground mesh which you can

play15:10

find in the quickel bridge so add a mesh

play15:12

entry here drag that in and we can see

play15:14

it is a bit too small so we'll come over

play15:16

to the transform points and increase the

play15:18

scale Min and Max by five We'll add a

play15:20

random rotation as well in the rotation

play15:22

Max section here under the Z axis We'll

play15:25

add a 360 so it'll rotate from 0 to 360

play15:28

and to push it down into the ground ever

play15:31

so slightly to help it blend a little

play15:32

bit better I'll come over to the offset

play15:34

mid and Max and add in a negative one to

play15:37

the Z axis and if I feel like there are

play15:40

maybe too many meshes getting spawned in

play15:42

a line here I can just come over to the

play15:45

spline sampler here and this distance

play15:48

increment is very similar to the one we

play15:50

used for the placement of the buildings

play15:52

so I can come over here and increase

play15:53

this to 500 so create fewer points um

play15:57

along the spine there you have have it

play15:58

that's how you make a medieval town in

play16:00

just a few minutes this can go very

play16:03

complicated very quickly if you'd like

play16:04

to add additional Logic for how the

play16:06

buildings are placed or how the road

play16:09

maybe spawns other meshes I could

play16:11

imagine you having Street lamps that are

play16:13

spawned along the outside of the spline

play16:15

on either side but the starting point is

play16:17

really to get that spline shape in the

play16:20

overall shape of the town and then the

play16:22

road spline that goes through it let me

play16:24

know in the comments what you end up

play16:26

actually using this effect for I'm very

play16:28

curious to see how you all will apply it

play16:30

in different types of projects if you

play16:32

found this video helpful shoot me a

play16:33

thumbs up so I know to make more on this

play16:35

type of thing and if there you're out

play16:37

there and you're a beginner and you're

play16:39

just confused and you want more of an

play16:41

onramp up to these more complicated

play16:43

effects and specifically making

play16:45

animations or films with Unreal Engine I

play16:47

have a free training which you can take

play16:48

a look at which is linked below this

play16:50

video as well as a bunch more videos on

play16:52

ptg specifically right here so I will

play16:54

see you in the next one

Rate This

5.0 / 5 (0 votes)

Related Tags
Unreal Engineプロシージャルスプライン中世の街コンテンツ生成チュートリアルPCGフレームワーク街作りゲーム開発環境構築
Do you need a summary in English?