【3D技术宅公社】XR数字艺术论坛  XR技术讨论 XR互动电影 定格动画

 找回密码
 立即注册

QQ登录

只需一步,快速开始

调查问卷
论坛即将给大家带来全新的技术服务,面向三围图形学、游戏、动画的全新服务论坛升级为UTF8版本后,中文用户名和用户密码中有中文的都无法登陆,请发邮件到324007255(at)QQ.com联系手动修改密码

3D技术论坛将以计算机图形学为核心,面向教育 推出国内的三维教育引擎该项目在持续研发当中,感谢大家的关注。

查看: 1987|回复: 0

【Godot 3.2】5.Instancing 实例化(续)

[复制链接]
发表于 2020-8-6 21:33:34 | 显示全部楼层 |阅读模式
Recap
回顾

Instancing has many handy uses. At a glance, with instancing you have:
实例化有许多方便的用途。一目了然,通过实例化,您可以:

  • The ability to subdivide scenes and make them easier to manage.细分场景并使其更易于管理的能力。
  • A tool to manage and edit multiple node instances at once.一次管理和编辑多个节点实例的工具。
  • A way to organize and embed complex game flows or even UIs (in Godot, UI Elements are nodes, too).一种组织和嵌入复杂游戏流程甚至UI的方法(在Godot中,UI元素也是节点)。

Design language
设计语言

But the greatest strength that comes with instancing scenes is that it works as an excellent design language. This distinguishes Godot from all the other engines out there. Godot was designed from the ground up around this concept.
但是,实例化场景所具有的最大优势在于,它是一种出色的设计语言。这将Godot与其他所有引擎区分开来。Godot是围绕这个概念从头开始设计的。

When making games with Godot, the recommended approach is to dismiss most common design patterns, such as MVC or Entity-Relationship diagrams, and instead think about your scenes in a more natural way. Start by imagining the visible elements in your game, the ones that can be named not just by a programmer, but by anyone.
使用Godot制作游戏时,建议的方法是消除最常见的设计模式,例如MVC或实体关系图,而以更自然的方式考虑场景。首先想象一下游戏中的可见元素,这些元素不仅可以被程序员命名,还可以被任何人命名。

For example, here's how a simple shooter game could be imagined:
例如,以下是一个简单的射击游戏的想象方式:

You can come up with a diagram like this for almost any kind of game. Write down the parts of the game that you can visualize, and then add arrows to represent ownership of one component by another.
您可以为几乎所有类型的游戏设计出这样的图表。写下游戏中您可以可视化的部分,然后添加箭头以表示一个组件的所有权。

Once you have a diagram like this, the recommended process for making a game is to create a scene for each element listed in the diagram. You'll use instancing (either by code or directly in the editor) for the ownership relationships.
一旦有了这样的图表,推荐的制作游戏的过程就是为图表中列出的每个元素创建一个场景。您将通过实例化(通过代码或直接在编辑器中)用于所有权关系。

A lot of time spent in programming games (or software in general) is on designing an architecture and fitting game components to that architecture. Designing based on scenes replaces that approach and makes development much faster and more straightforward, allowing you to concentrate on the game logic itself. Because most game components map directly to a scene, using a design based on scene instantiation means little other architectural code is needed.
在对游戏(或一般而言的软件)进行编程时,要花费大量时间来设计体系结构并使游戏组件适合该体系结构。基于场景的设计取代了这种方法,使开发更快,更直接,使您可以专注于游戏逻辑本身。由于大多数游戏组件都直接映射到场景,因此使用基于场景实例化的设计意味着几乎不需要其他架构代码。

Let's take a look at one more, somewhat more complex, example of an open-world type game with lots of assets and nested elements:
让我们看一下一个开放世界类型的游戏的例子,该例子有点复杂,其中包含很多资产和嵌套元素:

Take a look at the room element. Let's say we started there. We could make a couple of different room scenes, with different arrangements of furniture (also scenes) in them. Later, we could make a house scene, connecting rooms to make up its interior.
看看房间元素。假设我们从这里开始。我们可以制作几个不同的房间场景,并在其中布置不同的家具(也包括场景)。后来,我们可以制作房屋场景,将房间连接起来以构成其内部。

Then, we could make a citadel scene, which is made out of many instanced houses. Then, we could start working on the world map terrain, adding the citadel onto it.
然后,我们可以制作一个城堡场景,该场景由许多实例化的房屋组成。然后,我们可以开始在世界地图地形上进行工作,将城堡添加到其上。

Later, we could create scenes that represent guards (and other NPCs) and add them to the citadel as well. As a result, they would be indirectly added to the overall game world.
以后,我们可以创建代表守卫(和其他NPC)的场景,并将它们也添加到城堡中。结果,它们将被间接添加到整个游戏世界中。

With Godot, it's easy to iterate on your game like this, as all you need to do is create and instance more scenes. Furthermore, the editor UI is designed to be user friendly for programmers and non-programmers alike. A typical team development process can involve 2D or 3D artists, level designers, game designers, and animators, all working with the editor interface.
使用Godot,您可以像这样轻松地迭代游戏,因为您要做的就是创建并实例化更多场景。此外,编辑器UI旨在使程序员和非程序员都易于使用。典型的团队开发过程可能需要2D或3D艺术家,关卡设计师,游戏设计师和动画师,并且他们都需要使用编辑器界面。


Information overload!
信息过量!

This has been a lot of high level information dropped on you all at once. However, the important part of this tutorial was to create an awareness of how scenes and instancing are used in real projects.
这是一次将大量高级信息提供给您的信息。但是,本教程的重要部分是使人们意识到在实际项目中如何使用场景和实例化。

Everything discussed here will become second nature to you once you start making games and putting these concepts into practice. For now, don't worry about it too much, and go on to the next tutorial!
一旦您开始制作游戏并将这些概念付诸实践,这里讨论的一切将成为您的第二天性。现在,不必太担心,继续下一个教程!



您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|3D数字艺术论坛 ( 沪ICP备14023054号 )

GMT+8, 2024-4-20 00:17

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表