美文网首页
UE4之GamePlay

UE4之GamePlay

作者: 蛋求疼 | 来源:发表于2017-08-17 10:00 被阅读0次

    问题列表

    1. World与Level的概念
    2. Actor的概念
    3. Actor与Component关系
    4. Player, LocalPlayer, PlayerController的概念
    5. CameraManager
    6. PlayMode
    7. PlayerInput

    一幅图介绍概念

    UE4_Gameplay_图解.jpg

    LocalPlayer是在Game中提供的一个对象,用于表示真实玩家,而LocalPlayer又通过在World中放置PlayerController来控制玩家的Pawn。LocalPlayer起到了真实玩家和游戏世界的桥梁作用。 一个游戏实例可以有多个localPlayer,比如同屏2人玩各有自己的分画面(这种游戏现在很少见了(如二人玩俄罗斯方块))。

    术语解释
    官方文档GamePlay
    官方文档Terminology

    • Level
      用户定义的一个游戏区域(上面可以摆放植被、树木、地形、野怪等),并且可以在Level-Blueprint里定义该Level的逻辑处理 。 每个Level在编辑器里制作后保存为umap后缀的文件,所以也被称为Map。

    • World
      World就是表示当前的游戏世界, 同时可以包含多个Levels,这些Levels拼凑成一个巨大的游戏场景。World可以动态加载这些 Levels(根据玩家在世界的何处),这个技术称为Streaming Level。通过World提供的Spwan()接口,我们可以在游戏进行时动态地添加Actors。

    • Actor
      Actor是放在Level中的基本的实体,它可以动态地被创建到World中。

    • Component
      Component是一个功能对象体, 它隶属于Actor, 通过给Actor添加不同的Component来赋予它不同的功能特性。如一个StaticMesh-Component就会让Actor能够在场景画面上有视觉表现, 一个Audio-Component让Actor能够发出声音功能。RotatingMovement-Component可以让Actor在世界中移动旋转。

    • Pawn
      Pawn是一个特殊的Actor,表示游戏世界中的生命体, 它可以被Controller控制,并且可以被设置成可接受用户的Input, 它不局限于表示人类。
      The Pawn class is the base class of all Actors that can be controlled by players or AI. A Pawn is the physical representation of a player or AI entity within the world. This not only means that the Pawn determines what the player or AI entity looks like visually, but also how it interacts with the world in terms of collisions and other physical interactions. This can be confusing in certain circumstances as some types of games may not have a visible player mesh or avatar within the game. Regardless, the Pawn still represents the physical location, rotation, etc. of a player or entity within the game.

    • Character
      Character是一个类人的Pawn. 它带有用于碰撞的胶囊体(CapsuleComponent)和人物运动组件(CharacterMovementComponent),它做基本的类人运动。

    • HUD
      A HUD is a "heads-up display",用于在屏幕上显示二维的UI信息(如血条、玩家名称等). NOTE: 每个PlayerController只有一个AHUD类对象.

    • Camera
      PlayerCameraManager相当于人的眼睛. NOTE: 每个PlayerController只有一个PlayerCameraManager.
      Camera工作流程,通过阅读链接中的工作流程可知, 绘制场景时使用的SceneView参数是由PlayerCameraManager决定的,其它的Camera, CameraActor, ViewTarget是用于辅助的。

    • GameMode
      定义了游戏的规则. 不用的游戏有不同的GameMode,可以在Project Setting里配置

    • GameState
      GameState包含了游戏的状态,如:当前游戏中的玩家列表、得分情况、玩家的任务清单完成情况等。

    • PlayerState
      玩家的状态,如:名字、得分、等级等。

    对象关系如下图:

    UE4_GamePlay_Relations.jpg

    相关文章

      网友评论

          本文标题:UE4之GamePlay

          本文链接:https://www.haomeiwen.com/subject/burgrxtx.html