如何继续在UE4中创建地图

所有人的美好一天


在上一篇文章中,我们描述了如何通过使用Yandex.Map部分作为参考来创建级别。剩下的要讨论的是道路的“铺路”,以及我使用“世界构图”作为优化大地图的一种方法遇到的细微差别。



道路


当然,通过水平拉伸纹理“绘制”的道路非常适合使用(例如,用于空气模拟器),但是汽车模拟器需要更详细的方法。在UE中最适合创建道路的组件是样条线,至少是“长连续段”。我还没有遇到交集和交汇处,很可能他们将不得不用手创建单独的对象。


样条线有两种类型:蓝图样条线景观样条线前者具有强大的定制功能,并且可以很好地分解。频道上的史诗游戏。在他们的帮助下,您可以立即控制沿道路的对象(路标,围栏,沟渠,电源线)的创建,但是我在Blueprint Splines中找不到与景观结合的功能,并且不能用双手将道路的每一米安装在景观下(反之亦然)您想以什么开始一个项目。因此,我选择了“景观样条线”以在关卡的第一个版本上创建道路,只需使用“编辑样条线工具”并单击纹理即可。原来有两条样条线-一条用于柏油路,另一条用于土路。十字路口是简单地通过相互叠加而形成的。为了“实现”样条线,需要为线段设置“网格”。我从“车辆游戏”中获得了完整的曲目,在那条轨道上也像“景观样条线”(Epic Games Launcher>虚幻引擎>库> Vault)一样制作,从材质中剪切出一条关于轨道的复杂片段。原来这是一条伟大的土路!无法对沥青重复这种技巧,因此我使用了相同的“网格”,将“材质”中的纹理从土路更改为沥青(像这样)并应用于Z比例= 0.2的样条线上,效果很好。最后,您一定不要忘记在“样条线”下变形景观,只需单击一个按钮即可完成,道路已经准备就绪:



世界构成


YouTube , , , . UE : World Composition Level Streaming. «» ( , UE ). «», Level Streaming Volumes ( ), .


World Composition 4 4 16 1 1 . , — «» . , — Scale . .. Z-Scale , Z-Scale, ( 16).


World Composition , . , , , :

  1. Make current. , , ( Levels), \ . «» Persistent Level. PlayerStart «», UE , .
  2. MyGameInstance.cpp UE World Composition: Persistent Level > Persistent Level > > > . , .. , , . , , =) , 不幸的是,我对UE的了解不允许我从该线程一对一地复制修复程序,我只是制作了一个类型为“ GameInstance”的C ++类,并在项目属性中指定了该类。MyGameInstance.h和MyGameInstance.cpp分别为:

    #pragma once
    
    #include "CoreMinimal.h"
    #include "Engine/GameInstance.h"
    #include "MyGameInstance.generated.h"
    
    UCLASS()
    class SAMPLE_01_API UMyGameInstance : public UGameInstance
    {
    	GENERATED_BODY()
    	
    public:
    	virtual void LoadComplete(const float LoadTime, const FString& MapName) override;
    };
    

    
    #include "MyGameInstance.h"
    #include "Engine/World.h"
    #include "Engine/WorldComposition.h"
    #include "Engine/LevelStreaming.h"
    
    void UMyGameInstance::LoadComplete(const float LoadTime, const FString & MapName)
    {
    	Super::LoadComplete(LoadTime, MapName);
    	
    	UWorld* World = GetWorld();
    	
    	// WorldComposition won't work in Standalone mode without next statement
    	if ( World->WorldComposition ) {
    		const TArray<ULevelStreaming*> TilesStreaming = World->WorldComposition->TilesStreaming;
    		World->ClearStreamingLevels();
    		World->SetStreamingLevels(TilesStreaming);
    	}
    	
    	// "Pause" game till streaming complete
    	GEngine->BlockTillLevelStreamingCompleted(World);
    }
    


目前为止就这样了。这些计划说明了游戏中开始菜单和小地图的创建。谢谢。


All Articles