请选择 进入手机版 | 继续访问电脑版

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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

查看: 2318|回复: 2

【Godot 3.2】1. Introduction 引言

[复制链接]
发表于 2020-8-6 11:24:30 | 显示全部楼层 |阅读模式
本帖最后由 蚊子 于 2020-8-6 12:16 编辑


  1. func _ready():
复制代码

Welcome to the official documentation of Godot Engine, the free and open source community-driven 2D and 3D game engine! Behind this mouthful, you will find a powerful yet user-friendly tool that you can use to develop any kind of game, for any platform and with no usage restriction whatsoever.

欢迎使用Godot Engine的官方文档,Godot Engine是由社区驱动的免费和开源2D和3D游戏引擎!在这口功能的背后,您将找到一个功能强大且用户友好的工具,可用于开发任何类型的游戏,针对任何平台,并且没有任何使用限制。

This page gives a broad presentation of the engine and of the contents of this documentation, so that you know where to start if you are a beginner or where to look if you need info on a specific feature.

该页面对引擎和本文档的内容进行了广泛介绍,因此,如果您是初学者,则可以知道从哪里开始,或者如果需要特定功能的信息,则可以从哪里知道。

Before you start 在你开始前

The Tutorials and resources page lists video tutorials contributed by the community. If you prefer video to text, those may be worth a look.

In case you have trouble with one of the tutorials or your project, you can find help on the various Community channels, especially the Godot Discord community, Q&A, and IRC.

教程和资源”页面列出了社区提供的视频教程。如果您更喜欢视频而不是文本,那么可能值得一看。
如果您对教程之一或项目有任何疑问,可以在各种社区渠道(特别是Godot Discord社区,问答和IRC)上找到帮助。

About Godot Engine关于Godot引擎

A game engine is a complex tool, and it is therefore difficult to present Godot in a few words. Here's a quick synopsis, which you are free to reuse if you need a quick writeup about Godot Engine.

Godot Engine is a feature-packed, cross-platform game engine to create 2D and 3D games from a unified interface. It provides a comprehensive set of common tools, so users can focus on making games without having to reinvent the wheel. Games can be exported in one click to a number of platforms, including the major desktop platforms (Linux, macOS, Windows) as well as mobile (Android, iOS) and web-based (HTML5) platforms.

Godot is completely free and open source under the permissive MIT license. No strings attached, no royalties, nothing. Users' games are theirs, down to the last line of engine code. Godot's development is fully independent and community-driven, empowering users to help shape their engine to match their expectations. It is supported by the Software Freedom Conservancy not-for-profit.

For a more in-depth view of the engine, you are encouraged to read this documentation further, especially the Step by step tutorial.

游戏引擎是一个复杂的工具,因此很难用几句话来介绍Godot。这是一个快速的提要,如果您需要关于Godot Engine的快速撰写,可以随意重用。

Godot Engine是功能丰富的跨平台游戏引擎,可通过统一界面创建2D和3D游戏。它提供了一套全面的通用工具,因此用户可以专注于制作游戏,而无需重新发明轮子。一键即可将游戏导出到多种平台,包括主要的桌面平台(Linux,macOS,Windows)以及移动平台(Android,iOS)和基于Web的平台(HTML5)。

在许可的MIT许可下,Godot是完全免费和开源的。没有附加条件,没有特许权使用费,什么也没有。用户的游戏是他们的游戏,一直到引擎代码的最后一行。Godot的开发完全独立且由社区驱动,使用户能够帮助塑造自己的引擎以符合他们的期望。它由非营利性软件自由保护协会支持。



要更深入地了解引擎,建议您进一步阅读本文档,尤其是分教程。

About the documentation关于Godot文档

This documentation is continuously written, corrected, edited, and revamped by members of the Godot Engine community. It is edited via text files in the reStructuredText markup language and then compiled into a static website/offline document using the open source Sphinx and ReadTheDocs tools.

该文档由Godot Engine社区的成员不断编写,更正,编辑和修订。通过使用reStructuredText标记语言的文本文件对其进行编辑 ,然后使用开源SphinxReadTheDocs工具将其编译为静态网站/离线文档。
Note

You can contribute to Godot's documentation by opening issue tickets or sending patches via pull requests on its GitHub source repository, or translating it into your language on Hosted Weblate.

您可以通过在GitHub 源存储库上打开发布票证或通过拉取请求发送补丁程序,或在Hosted Weblate上将其翻译成您的语言,为Godot的文档做出贡献 。


All the contents are under the permissive Creative Commons Attribution 3.0 (CC-BY 3.0) license, with attribution to "Juan Linietsky, Ariel Manzur and the Godot Engine community".
所有内容均受许可的知识共享署名3.0(CC-BY 3.0)许可,并注明“ Juan Linietsky,Ariel Manzur和Godot Engine社区”。


Organization of the documentation文件的组织

This documentation is organized in five sections with an impressively unbalanced distribution of contents – but the way it is split up should be relatively intuitive:
该文档分为五个部分,内容分布不平衡,但是拆分方式应该相对直观:

  • The General section contains this introduction as well as information about the engine, its history, its licensing, authors, etc. It also contains the Frequently asked questions.
    常规”部分包含此简介以及有关引擎,其历史,其许可,作者等的信息。还包含“ 常见问题”
  • The Getting started section is the raison d'être of this documentation, as it contains all the necessary information on using the engine to make games. It starts with the Step by step tutorial which should be the entry point for all new users.
    入门部分是存在的理由这个文件,因为它包含有关使用引擎,使游戏的所有必要信息。它从逐步教程开始,该教程应该是所有新用户的切入点。
  • The Tutorials section can be read as needed, in any order. It contains feature-specific tutorials and documentation.
    可以根据需要以任何顺序阅读“ 教程”部分。它包含特定于功能的教程和文档。
  • The Development section is intended for advanced users and contributors to the engine development, with information on compiling the engine, developing C++ modules or editor plugins.
    开发”部分面向引擎开发的高级用户和贡献者,提供有关编译引擎,开发C ++模块或编辑器插件的信息。
  • The Community section gives information related to contributing to engine development and the life of its community, e.g. how to report bugs, help with the documentation, etc. It also points to various community channels like IRC and Discord and contains a list of recommended third-party tutorials outside of this documentation.
    社区”部分提供了与有助于引擎开发及其社区生活有关的信息,例如,如何报告错误,提供文档帮助等。它还指向了各种社区渠道(例如IRC和Discord),并包含了推荐的第三方列表。本文档之外的第三方教程。
  • Finally, the Class reference is the documentation of the Godot API, which is also available directly within the engine's script editor. It is generated automatically from a file in the main source repository, therefore the generated files of the documentation are not meant to be modified. See Contributing to the class reference for details.
    最后,类参考是Godot API的文档,也可以直接在引擎的脚本编辑器中找到。它是从主源存储库中的文件自动生成的,因此文档的生成文件不打算修改。有关详细信息,请参见 贡献给类参考

In addition to this documentation you may also want to take a look at the various Godot demo projects.

Have fun reading and making games with Godot Engine!

除了本文档之外,您可能还想看看各种Godot演示项目

使用Godot Engine享受阅读和制作游戏的乐趣!



 楼主| 发表于 2020-8-6 12:14:23 | 显示全部楼层
本帖最后由 蚊子 于 2020-8-6 12:17 编辑

Frequently asked questionsWhat can I do with Godot? How much does it cost? What are the license terms?
经常问的问题我可以用Godot做什么?它要多少钱?许可条款是什么?

Godot is Free and Open-Source Software available under the OSI-approved MIT license. This means it is free as in "free speech" as well as in "free beer."
Godot是经OSI批准的 MIT许可证提供的免费和开源软件。这意味着它是免费的,如“言论自由”和“免费啤酒”一样。

In short:简而言之:

  • You are free to download and use Godot for any purpose, personal, non-profit, commercial, or otherwise.您可以出于个人,
    非营利,商业或其他目的免费下载和使用Godot。
  • You are free to modify, distribute, redistribute, and remix Godot to your heart's content, for any reason, both non-commercially and commercially.
    无论出于非商业目的还是商业原因,您都可以自由地将Godot修改,分发,重新分发和重新混合到您的内心。

All the contents of this accompanying documentation are published under the permissive Creative Commons Attribution 3.0 (CC-BY 3.0) license, with attribution to "Juan Linietsky, Ariel Manzur and the Godot Engine community."
随附文档的所有内容均根据许可的知识共享署名3.0(CC-BY 3.0)许可发布,并注明“ Juan Linietsky,Ariel Manzur和Godot Engine社区”。

Logos and icons are generally under the same Creative Commons license. Note that some third-party libraries included with Godot's source code may have different licenses.
徽标和图标通常在同一知识共享许可下。请注意,Godot的源代码附带的某些第三方库可能具有不同的许可证。

For full details, look at the COPYRIGHT.txt as well as the LICENSE.txt and LOGO_LICENSE.txt files in the Godot repository.
有关完整的详细信息,请查看Godot存储库中的COPYRIGHT.txt以及LICENSE.txtLOGO_LICENSE.txt文件。

Also, see the license page on the Godot website.
另外,请参阅Godot网站上的许可页面


Which platforms are supported by Godot?
Godot支持哪些平台

For the editor:
对于编辑者:

  • Windows
  • macOS
  • X11 (Linux, *BSD)

For exporting your games:
导出游戏:

  • Windows (and UWP)
  • macOS
  • X11 (Linux, *BSD)
  • Android
  • iOS
  • Web

Both 32- and 64-bit binaries are supported where it makes sense, with 64 being the default.
合理地支持32位和64位二进制文​​件,默认为64位。

Some users also report building and using Godot successfully on ARM-based systems with Linux, like the Raspberry Pi.
一些用户还报告说,在具有Linux的基于ARM的系统(例如Raspberry Pi)上成功构建和使用Godot。

Additionally, there is some unofficial third-party work being done on building for some consoles. However, none of this is included in the default build scripts or export templates at this time.
此外,在为某些控制台进行构建时,还进行了一些非正式的第三方工作。但是,此时,默认构建脚本或导出模板中都不包含所有这些。

For more on this, see the sections on exporting and compiling Godot yourself.
有关更多信息,请参阅有关自己导出 编译Godot的部分


Which programming languages are supported in Godot?
Godot支持哪些编程语言?

The officially supported languages for Godot are GDScript, Visual Scripting, C#, and C++. See the subcategories for each language in the scripting section.
Godot官方支持的语言是GDScript,Visual Scripting,C#和C ++。请在脚本部分中查看每种语言的子类别

If you are just starting out with either Godot or game development in general, GDScript is the recommended language to learn and use since it is native to Godot. While scripting languages tend to be less performant than lower-level languages in the long run, for prototyping, developing Minimum Viable Products (MVPs), and focusing on Time-To-Market (TTM), GDScript will provide a fast, friendly, and capable way of developing your games.
如果您只是刚开始使用Godot或进行游戏开发,那么GDScript是Godot的母语,因此是推荐学习和使用的语言。从长远来看,脚本语言的性能往往不如低级语言,但对于原型设计,开发最小可行产品(MVP)以及着重于产品上市时间(TTM)而言,GDScript将提供快速,友好且实用的功能。开发游戏的有效方法。

Note that C# support is still relatively new, and as such, you may encounter some issues along the way. Our friendly and hard-working development community is always ready to tackle new problems as they arise, but since this is an open-source project, we recommend that you first do some due diligence yourself. Searching through discussions on open issues is a great way to start your troubleshooting.
请注意,C#支持仍是相对较新的,因此,在此过程中可能会遇到一些问题。我们友好而努力的开发社区随时准备解决新问题,但是由于这是一个开源项目,因此我们建议您首先自己进行尽职调查。搜索有关未解决问题的讨论是开始进行故障排除的好方法。

As for new languages, support is possible via third parties using the GDNative / NativeScript / PluginScript facilities. (See the question about plugins below.) Work is currently underway, for example, on unofficial bindings for Godot to Python and Nim.
对于新语言,可以使用GDNative / NativeScript / PluginScript工具通过第三方提供支持。(请参阅下面有关插件的问题。)例如,正在进行有关Godot与PythonNim的非正式绑定的工作


What is GDScript and why should I use it?什么是GDScript,为什么要使用它?

GDScript is Godot's integrated scripting language. It was built from the ground up to maximize Godot's potential in the least amount of code, affording both novice and expert developers alike to capitalize on Godot's strengths as fast as possible. If you've ever written anything in a language like Python before then you'll feel right at home. For examples, history, and a complete overview of the power GDScript offers you, check out the GDScript scripting guide.
GDScript是Godot的集成脚本语言。它是从头开始构建的,旨在以最少的代码最大程度地发挥Godot的潜力,使新手和专家开发人员都可以尽快利用Godot的优势。如果您曾经用Python这样的语言编写过任何东西,那么您会感到宾至如归。有关示例,历史记录以及GDScript为您提供的强大功能的完整概述,请查阅GDScript脚本指南

There are several reasons to use GDScript--especially when you are prototyping, in alpha/beta stages of your project, or are not creating the next AAA title--but the most salient reason is the overall reduction of complexity.
使用GDScript的原因有很多-特别是在原型设计,项目的alpha / beta阶段或未创建下一个AAA标题时-但最明显的原因是总体上降低了复杂性。

The original intent of creating a tightly integrated, custom scripting language for Godot was two-fold: first, it reduces the amount of time necessary to get up and running with Godot, giving developers a rapid way of exposing themselves to the engine with a focus on productivity; second, it reduces the overall burden of maintenance, attenuates the dimensionality of issues, and allows the developers of the engine to focus on squashing bugs and improving features related to the engine core--rather than spending a lot of time trying to get a small set of incremental features working across a large set of languages.
为Godot创建紧密集成的自定义脚本语言的初衷是双重的:首先,它减少了启动和运行Godot所需的时间,从而为开发人员提供了一种快速专注于引擎的方法。关于生产力;其次,它减少了总体维护负担,减轻了问题的严重性,并使引擎的开发人员能够专注于解决错误并改善与引擎核心相关的功能,而不必花费大量时间来尝试解决问题。跨多种语言工作的一组增量功能。

Since Godot is an open-source project, it was imperative from the start to prioritize a more integrated and seamless experience over attracting additional users by supporting more familiar programming languages--especially when supporting those more familiar languages would result in a worse experience. We understand if you would rather use another language in Godot (see the list of supported options above). That being said, if you haven't given GDScript a try, try it for three days. Just like Godot, once you see how powerful it is and rapid your development becomes, we think GDScript will grow on you.
由于Godot是一个开源项目,因此从一开始就必须优先考虑更集成和无缝的体验,而不是通过支持更熟悉的编程语言来吸引更多用户-特别是在支持那些更熟悉的语言会导致更糟糕的体验时。我们了解您是否愿意在Godot中使用其他语言(请参阅上面支持的选项列表)。话虽如此,如果您没有尝试GDScript,请尝试三天。就像Godot一样,一旦您看到它强大而迅速的发展,我们就会认为GDScript将对您有所帮助。

More information about getting comfortable with GDScript or dynamically typed languages can be found in the GDScript: An introduction to dynamic languages tutorial.
有关适应GDScript或动态类型的语言的更多信息,请参见GDScript:动态语言简介教程。


What were the motivations behind creating GDScript?创建GDScript的动机是什么?

In the early days, the engine used the Lua scripting language. Lua is fast, but creating bindings to an object oriented system (by using fallbacks) was complex and slow and took an enormous amount of code. After some experiments with Python, it also proved difficult to embed.
在早期,引擎使用[color=var(--link-color-visited)]Lua 脚本语言。Lua很快,但是创建到面向对象系统的绑定(通过使用后备)很复杂且很慢,并且花费了大量代码。经过使用[color=var(--link-color-visited)]Python的一些实验之后 ,它也被证明很难嵌入。

The main reasons for creating a custom scripting language for Godot were:
为Godot创建自定义脚本语言的主要原因是:

  • Poor threading support in most script VMs, and Godot uses threads (Lua, Python, Squirrel, JavaScript, ActionScript, etc.).
    大多数脚本VM中的线程支持差,并且Godot使用线程(Lua,Python,Squirrel,JavaScript,ActionScript等)。
  • Poor class-extending support in most script VMs, and adapting to the way Godot works is highly inefficient (Lua, Python, JavaScript).
    大多数脚本VM中对类扩展的支持都很差,并且无法适应Godot的工作方式(Lua,Python,JavaScript)非常低效。
  • Many existing languages have horrible interfaces for binding to C++, resulting in large amount of code, bugs, bottlenecks, and general inefficiency (Lua, Python, Squirrel, JavaScript, etc.) We wanted to focus on a great engine, not a great amount of integrations.
    许多现有的语言都具有绑定到C ++的可怕接口,从而导致大量代码,错误,瓶颈和一般效率低下的问题(Lua,Python,Squirrel,JavaScript等)。我们希望专注于出色的引擎,而不是大量集成。
  • No native vector types (vector3, matrix4, etc.), resulting in highly reduced performance when using custom types (Lua, Python, Squirrel, JavaScript, ActionScript, etc.).
    没有本机向量类型(vector3,matrix4等),导致使用自定义类型(Lua,Python,Squirrel,JavaScript,ActionScript等)时的性能大大降低。
  • Garbage collector results in stalls or unnecessarily large memory usage (Lua, Python, JavaScript, ActionScript, etc.).
    垃圾收集器会导致停顿或不必要地占用大量内存(Lua,Python,JavaScript,ActionScript等)。
  • Difficulty to integrate with the code editor for providing code completion, live editing, etc. (all of them). This is well-supported by GDScript.
    难以与代码编辑器集成以提供代码完成,实时编辑等(所有这些)。GDScript对此提供了很好的支持。

GDScript was designed to curtail the issues above, and more.
GDScript旨在减少上述问题,甚至更多。


What type of 3D model formats does Godot support?
Godot支持哪种类型的3D模型格式?

Godot supports Collada via the OpenCollada exporter (Maya, 3DSMax). If you are using Blender, take a look at our own Better Collada Exporter.
Godot通过[color=var(--link-color-visited)]OpenCollada导出器(Maya,3DSMax)支持Collada 。如果您使用的是Blender,请查看我们自己的[color=var(--link-color-visited)]Better Collada Exporter

As of Godot 3.0, glTF is supported.
从Godot 3.0开始,支持glTF。

FBX is supported via the Open Asset Import library. However, FBX is proprietary so we recommend using other formats listed above, if suitable for your workflow.
通过开放资产导入库支持FBX。但是,FBX是专有的,因此,如果适合您的工作流程,我们建议使用上面列出的其他格式。


Will [insert closed SDK such as FMOD, GameWorks, etc.] be supported in Godot?
Godot是否将支持[插入封闭的SDK,例如FMOD,GameWorks等]?

The aim of Godot is to create a free and open-source MIT-licensed engine that is modular and extendable. There are no plans for the core engine development community to support any third-party, closed-source/proprietary SDKs, as integrating with these would go against Godot's ethos.
Godot的目标是创建一个模块化的可扩展的免费开放源代码的MIT许可引擎。核心引擎开发社区尚无计划支持任何第三方,封闭源/专有的SDK,因为与它们集成会违反Godot的精神。

That said, because Godot is open-source and modular, nothing prevents you or anyone else interested in adding those libraries as a module and shipping your game with them--as either open- or closed-source.
就是说,由于Godot是开放源代码和模块化的,因此您或任何有兴趣将这些库添加为模块并随其附带发行您的游戏的人,无论是开放源代码还是封闭源代码,都无法阻止。

To see how support for your SDK of choice could still be provided, look at the Plugins question below.
要查看仍如何提供对所选SDK的支持,请查看下面的插件问题。

If you know of a third-party SDK that is not supported by Godot but that offers free and open-source integration, consider starting the integration work yourself. Godot is not owned by one person; it belongs to the community, and it grows along with ambitious community contributors like you.
如果您知道Godot不支持的第三方SDK,但是它提供了免费和开源的集成,请考虑自己开始集成工作。Godot不是一个人所有;它属于社区,并且与像您一样的雄心勃勃的社区贡献者一起成长。


How should assets be created to handle multiple resolutions and aspect ratios?
应该如何创建资产以处理多种分辨率和宽高比?

This question pops up often and it's probably thanks to the misunderstanding created by Apple when they originally doubled the resolution of their devices. It made people think that having the same assets in different resolutions was a good idea, so many continued towards that path. That originally worked to a point and only for Apple devices, but then several Android and Apple devices with different resolutions and aspect ratios were created, with a very wide range of sizes and DPIs.
这个问题经常出现,这可能是由于苹果最初将设备分辨率翻倍时造成的误解。人们认为在不同的决议中拥有相同的资产是一个好主意,因此许多人继续朝着这条道路前进。最初只适用于Apple设备,但是后来创建了具有不同分辨率和宽高比的几款Android和Apple设备,具有各种尺寸和DPI。

The most common and proper way to achieve this is to, instead, use a single base resolution for the game and only handle different screen aspect ratios. This is mostly needed for 2D, as in 3D it's just a matter of Camera XFov or YFov.
实现此目的的最常见,最正确的方法是,对游戏使用单一的基本分辨率,并且仅处理不同的屏幕纵横比。这对于2D来说是最需要的,因为在3D中,这只是Camera XFov或YFov的问题

  • Choose a single base resolution for your game. Even if there are devices that go up to 2K and devices that go down to 400p, regular hardware scaling in your device will take care of this at little or no performance cost. Most common choices are either near 1080p (1920x1080) or 720p (1280x720). Keep in mind the higher the resolution, the larger your assets, the more memory they will take and the longer the time it will take for loading.
    为您的游戏选择一个基本分辨率。即使有些设备的速度达到2K,而设备的速度下降到400p,设备中的常规硬件扩展也可以以很少或根本没有性能成本的代价来解决这一问题。最常见的选择是接近1080p(1920x1080)或720p(1280x720)。请记住,分辨率越高,资产越大,它们将占用的内存越多,并且加载时间就越长。
  • Use the stretch options in Godot; 2D stretching while keeping aspect ratios works best. Check the Multiple resolutions tutorial on how to achieve this.
    在Godot中使用拉伸选项;在保持纵横比的同时进行2D拉伸效果最佳。查看有关如何实现此目标的“ 多分辨率”教程。
  • Determine a minimum resolution and then decide if you want your game to stretch vertically or horizontally for different aspect ratios, or if there is one aspect ratio and you want black bars to appear instead. This is also explained in Multiple resolutions.
    确定最低分辨率,然后确定是要针对不同的纵横比垂直或水平拉伸游戏,还是要有一个纵横比并希望显示黑条。多种分辨率中也对此进行了说明。
  • For user interfaces, use the anchoring to determine where controls should stay and move. If UIs are more complex, consider learning about Containers.
    对于用户界面,请使用锚点 确定控件应保留和移动的位置。如果用户界面较为复杂,请考虑学习有关容器的知识。

And that's it! Your game should work in multiple resolutions.
就是这样!您的游戏应在多种分辨率下工作。

If there is a desire to make your game also work on ancient devices with tiny screens (fewer than 300 pixels in width), you can use the export option to shrink images, and set that build to be used for certain screen sizes in the App Store or Google Play.
如果希望您的游戏也能在具有小屏幕(宽度小于300像素)的古老设备上运行,则可以使用导出选项来缩小图像,并在应用程序中将生成的图像设置为用于某些屏幕尺寸商店或Google Play。


How can I extend Godot?如何扩展Godot?

For extending Godot, like creating Godot Editor plugins or adding support for additional languages, take a look at EditorPlugins and tool scripts.
要扩展Godot,例如创建Godot Editor插件或添加对其他语言的支持,请查看EditorPlugins 和工具脚本。

Also, see the official blog posts on these topics:另外,请参阅有关这些主题的官方博客文章:

You can also take a look at the GDScript implementation, the Godot modules, as well as the unofficial Python support for Godot. This would be a good starting point to see how another third-party library integrates with Godot.
您还可以查看GDScript实现,Godot模块以及对Godot 非官方Python支持这将是了解另一个第三方库如何与Godot集成的良好起点。


I would like to contribute! How can I get started?我想贡献!我该如何开始?

Awesome! As an open-source project, Godot thrives off of the innovation and ambition of developers like you.
太棒了!作为一个开源项目,Godot摆脱了像您这样的开发人员的创新和野心

The first place to get started is in the issues. Find an issue that resonates with you, then proceed to the How to Contribute guide to learn how to fork, modify, and submit a Pull Request (PR) with your changes.
首先要解决的是问题。找到引起您共鸣的问题,然后继续阅读《如何贡献》 指南,以了解如何对您的更改进行派生,修改和提交“拉取请求”(PR)。


I have a great idea for Godot. How can I share it?
我对Godot有个好主意。我该如何分享?

It might be tempting to want to bring ideas to Godot, like ones that result in massive core changes, some sort of mimicry of what another game engine does, or alternative workflows that you'd like built into the editor. These are great, and we are thankful to have such motivated people want to contribute, but Godot's focus is and always will be the core functionality as outlined in the Roadmap, squashing bugs and addressing issues, and conversations between Godot community members.
想要将想法带入Godot可能很诱人,例如那些导致大量核心更改的想法,对其他游戏引擎的模仿,或者您希望在编辑器中内置的替代工作流。这些都是伟大的,我们很感激有这样的上进心的人想参与,但戈多的重点是而且将永远是相同的核心功能在列出路线图 挤压错误和解决问题,而戈多社区成员之间的对话。

Most developers in the Godot community will be more interested to learn about things like:
Godot社区中的大多数开发人员将对以下方面的知识更加感兴趣:

  • Your experience using the software and the problems you have (we care about this much more than ideas on how to improve it).
    您使用该软件的经验以及遇到的问题(我们不仅仅在意于如何改进它,而是在乎于此)。
  • The features you would like to see implemented because you need them for your project.
    您希望看到的功能已实现,因为您的项目需要它们。
  • The concepts that were difficult to understand while learning the software.
    学习软件时难以理解的概念。
  • The parts of your workflow you would like to see optimized.
    您希望看到的工作流程部分已优化。
  • Parts where you missed clear tutorials or where the documentation wasn't clear.
    您错过了清晰的教程或文档不清楚的部分。

Please don't feel like your ideas for Godot are unwelcome. Instead, try to reformulate them as a problem first, so developers and the community have a functional foundation to ground your ideas on.
请不要觉得您对Godot的想法不受欢迎。相反,请尝试首先将它们重新定义为问题,以便开发人员和社区具有功能基础,可将您的想法作为基础。

A good way to approach sharing your ideas and problems with the community is as a set of user stories. Explain what you are trying to do, what behavior you expect to happen, and then what behavior actually happened. Framing problems and ideas this way will help the whole community stay focused on improving developer experiences as a whole.
与社区共享您的想法和问题的一种好方法是作为一组用户故事。说明您要做什么,您预期会发生什么行为,然后实际发生什么行为。通过这种方式解决问题和想法将有助于整个社区专注于改善整体开发人员的体验。

Bonus points for bringing screenshots, concrete numbers, test cases, or example projects (if applicable).
带来截图,具体数字,测试用例或示例项目(如果适用)的加分点。


Is it possible to use Godot as a library?可以将Godot用作图书馆吗?

Godot is meant to be used with its editor. We recommend you give it a try, as it will most likely save you time in the long term. There are no plans to make Godot usable as a library, as it would make the rest of the engine more convoluted and difficult to use for casual users.
Godot旨在与其编辑器一起使用。我们建议您尝试一下,因为从长远来看,它很可能会节省您的时间。目前尚无计划使Godot可用作库,因为这会使引擎的其余部分更加混乱,难以为临时用户使用。

If you want to use a rendering library, look into using an established rendering engine instead. Keep in mind rendering engines usually have smaller communities compared to Godot. This will make it more difficult to find answers to your questions.
如果要使用渲染库,请考虑使用已建立的渲染引擎。请记住,与Godot相比,渲染引擎通常具有较小的社区。这将使查找问题的答案变得更加困难。


Why does Godot not use STL (Standard Template Library)
为什么Godot不使用STL(标准模板库)

Like many other libraries (Qt as an example), Godot does not make use of STL. We believe STL is a great general purpose library, but we had special requirements for Godot.
像许多其他库一样(以Qt为例),Godot不使用STL。我们认为STL是一个很棒的通用库,但是我们对Godot有特殊要求。

  • STL templates create very large symbols, which results in huge debug binaries. We use few templates with very short names instead.
    STL模板创建非常大的符号,这会导致庞大的调试二进制文件。我们使用一些名称非常短的模板来代替。
  • Most of our containers cater to special needs, like Vector, which uses copy on write and we use to pass data around, or the RID system, which requires O(1) access time for performance. Likewise, our hash map implementations are designed to integrate seamlessly with internal engine types.
    我们的大多数容器都满足特殊的需求,例如Vector(使用写时复制并用于传递数据)或RID系统(需要O(1)访问时间来提高性能)。同样,我们的哈希映射实现旨在与内部引擎类型无缝集成。
  • Our containers have memory tracking built-in, which helps better track memory usage.
    我们的容器具有内置的内存跟踪功能,有助于更好地跟踪内存使用情况。
  • For large arrays, we use pooled memory, which can be mapped to either a preallocated buffer or virtual memory.
    对于大型阵列,我们使用池化内存,可以将其映射到预分配的缓冲区或虚拟内存。
  • We use our custom String type, as the one provided by STL is too basic and lacks proper internationalization support.
    我们使用自定义的String类型,因为STL提供的类型太基本,并且缺乏适当的国际化支持。

Why does Godot not use exceptions?为什么Godot不使用exceptions?

We believe games should not crash, no matter what. If an unexpected situation happens, Godot will print an error (which can be traced even to script), but then it will try to recover as gracefully as possible and keep going.
我们认为游戏无论如何都不会崩溃。如果发生意外情况,Godot将打印错误(甚至可以追溯到脚本),但是它将尝试尽可能优雅地恢复并继续运行。

Additionally, exceptions significantly increase binary size for the executable.
此外,异常会大大增加可执行文件的二进制大小。


Why does Godot not enforce RTTI?为什么Godot不执行RTTI?

Godot provides its own type-casting system, which can optionally use RTTI internally. Disabling RTTI in Godot means considerably smaller binary sizes can be achieved, at a little performance cost.
Godot提供了自己的类型转换系统,可以选择在内部使用RTTI。在Godot中禁用RTTI意味着可以以较小的性能成本实现更小的二进制大小。


Why does Godot not force users to implement DoD (Data oriented Design)?
为什么Godot不强迫用户实施DoD(面向数据的设计)

While Godot internally for a lot of the heavy performance tasks attempts to use cache coherency as well as possible, we believe most users don't really need to be forced to use DoD practices.
虽然Godot在内部执行许多繁重的性能任务时会尽可能尝试使用缓存一致性,但我们认为实际上并不需要强迫大多数用户使用DoD做法。

DoD is mostly a cache coherency optimization that can only gain you significant performance improvements when dealing with dozens of thousands of objects (which are processed every frame with little modification). As in, if you are moving a few hundred sprites or enemies per frame, DoD won't help you, and you should consider a different approach to optimization.
DoD主要是缓存一致性优化,在处理成千上万个对象(几乎不做任何修改就可以处理每个帧)时,只能获得显着的性能改进。例如,如果您每帧移动几百个精灵或敌人,DoD将无济于事,您应该考虑使用其他优化方法。

The vast majority of games do not need this and Godot provides handy helpers to do the job for most cases when you do.
绝大多数游戏都不需要这样做,而Godot在大多数情况下都会为您提供方便的助手来完成这项工作。

If a game that really needs to process such large amount of objects is needed, our recommendation is to use C++ and GDNative for the high performance parts and GDScript (or C#) for the rest of the game.
如果确实需要处理大量对象的游戏,我们的建议是对高性能部件使用C ++和GDNative,对于其余部分使用GDScript(或C#)。


How can I support Godot development or contribute?
我如何支持Godot的发展或做出贡献?

See Ways to contribute.


Who is working on Godot? How can I contact you?
谁在研究Godot?我该如何联系您?

See the corresponding page on the Godot website.



 楼主| 发表于 2020-8-6 12:22:37 | 显示全部楼层
功能清单

该页面旨在列出Godot当前支持的所有功能。

注意

本页列出了当前稳定版本的Godot(3.2)支持的功能。 最新开发版本(4.0)中提供了更多功能



特征平台类

可以同时运行编辑器和导出项目:

  • Windows 7和更高版本(64位和32位)。
  • macOS 10.12及更高版本(64位,x86和ARM)。
  • Linux(64位和32位,x86和ARM)。
    • 二进制文件是静态链接的,并且如果在足够旧的基本发行版上进行编译,则可以在任何发行版上运行。
    • 官方二进制文件在Ubuntu 14.04上编译。

运行导出的项目:

  • Android 4.4及更高版本。
  • iOS 10.0及更高版本。
  • 通过WebAssembly的HTML5(Firefox,Chrome,Edge,Opera)。
  • 控制台

Godot的目标是尽可能地独立于平台,并且可以相对轻松地移植到新平台。


编辑

特征:

  • 场景树编辑器。
  • 脚本编辑器。
  • 支持外部脚本编辑器,例如Visual Studio Code或Vim。
  • GDScript 调试器
    • 尚不支持线程调试。
  • 性能监控工具。
  • 实时脚本重新加载。
  • 现场场景编辑。
    • 所做的更改将反映在编辑器中,并在关闭正在运行的项目后将其保留。
  • 远程检查器。
    • 更改不会反映在编辑器中,并且在关闭正在运行的项目后不会保留更改。
  • 实时摄像机复制。
    • 移动编辑器内的摄像头,然后在运行的项目中查看结果。
  • 以社区提供的多种语言使用编辑器。

外挂程式:

  • 可以从资产库下载编辑器插件 以扩展编辑器功能。
  • 使用GDScript创建自己的插件,以添加新功能或加快工作流程。
  • 从项目管理器中的资产库下载项目,然后直接导入。

2D图形

提供两个渲染器:

  • OpenGL ES 3.0渲染器(在桌面平台上使用OpenGL 3.3)。
    • 高端视觉效果。在台式机平台上推荐。
  • OpenGL ES 2.0渲染器(在桌面平台上使用OpenGL 2.1)。
    • 在移动和Web平台上推荐。

特征:

  • 精灵,多边形和线条渲染。
    • 绘制线和面的高级工具,例如Polygon2D和Line2D。
  • AnimatedSprite作为创建动画精灵的助手。
  • 视差层。
    • 伪3D支持通过自动复制图层多次。
  • 具有法线贴图的2D照明。
    • 硬阴影或软阴影。
  • 使用位图(BitmapFont)渲染字体,或使用FreeType(DynamicFont)光栅化。
    • 可以使用BMFont之类的工具导出位图字体。
    • DynamicFont支持单色字体和彩色字体。支持的格式为TTF和OTF。
    • DynamicFont支持宽度和颜色可调的可选字体轮廓。
    • 支持字体过采样,以在较高分辨率下保持字体清晰。
  • 基于GPU的粒子,支持自定义粒子着色器。
  • 基于CPU的粒子。

2D工具
  • 具有内置平滑和拖动边距的2D相机。
  • 表示2D空间中路径的Path2D节点。
    • 可以在编辑器中绘制或按程序生成。
    • 使节点跟随Path2D的PathFollow2D节点。
  • 2D几何帮助程序类。
  • Line2D节点可绘制带纹理的2D线。

2D物理

物理机构:

  • 静态物体。
  • 刚体。
  • 运动机构。
  • 关节。
  • 探测进入或离开尸体的区域。

碰撞检测:

  • 内置形状:线,框,圆,胶囊。
  • 碰撞多边形(可以手动绘制,也可以从编辑器中的精灵生成)。

3D图形

提供两个渲染器:

  • OpenGL ES 3.0渲染器(在桌面平台上使用OpenGL 3.3)。
    • 高端视觉效果。在台式机平台上推荐。
    • 与sRGB的HDR渲染。
  • OpenGL ES 2.0渲染器(在桌面平台上使用OpenGL 2.1)。
    • 在移动和Web平台上推荐。
    • LDR渲染具有更大的兼容性。
    • 并非所有功能都可用。仅在使用OpenGL ES 3.0渲染器时可用的功能在下面标记为GLES3。

相机:

  • 透视,正射和平截头偏移相机。

基于物理的渲染:

  • 遵循迪士尼PBR模型。
  • 使用支持ORM纹理的粗糙度金属工作流程。
  • 法线贴图。
  • GLES3:视差/浮雕贴图具有基于距离的自动细节级别。
  • GLES3:次表面散射和透射率。
  • GLES3:接近淡入(软颗粒)。
  • 距离淡入可以使用alpha混合或抖动来避免通过透明管道。
  • 可以基于每个像素或每个对象确定抖动。

实时照明:

  • 方向灯(太阳/月亮)。每个场景最多4个。
  • 全向灯。
  • 可调锥角和衰减的聚光灯。

阴影贴图:

  • DirectionalLight:正交(最快),PSSM 2分割和4分割。支持拆分之间的混合。
  • OmniLight:双抛物线(快速)或立方体贴图(速度较慢,但​​更准确)。支持全景形式的彩色投影仪纹理。
  • SpotLight:单一纹理。

间接照明的整体照明:

  • 烘焙的光照贴图(快速,但无法在运行时更新)。
    • 光照贴图在CPU上烘焙。
  • GLES3: GI探测器(较慢的半实时)。支持反射。

感言:

  • GLES3:基于体素的反射(使用GI探针时)。
  • 使用ReflectionProbe进行快速烘焙的反射或慢速的实时反射。视差校正可以选择启用。
  • GLES3:屏幕空间反射。
  • 反射技术可以混合在一起以提高准确性。

天空:

  • 全景天空(使用HDRI)。
  • 程序的天空。

多雾路段:

  • 具有可调节衰减曲线的深度雾。
  • 高雾(地板或天花板),衰减可调。
  • 支持根据相机方向自动调整深雾颜色(以匹配太阳颜色)。
  • 可选的透射率,使雾中的灯光更清晰可见。

粒子:

  • GLES3:基于GPU的粒子,支持自定义粒子着色器。
  • 基于CPU的粒子。

后期处理:

  • 音调映射(线性,莱因哈德,电影,ACES)。
  • GLES3:根据视口亮度自动调整曝光。
  • GLES3:近景和远景。
  • GLES3:屏幕空间环境光遮挡。
  • 发光/花光,带有可选的双三次放大和多种混合模式可用:屏幕,柔光,添加,替换。
  • 使用一维渐变进行色彩校正。
  • 亮度,对比度和饱和度调整。

纹理过滤:

  • 最近,双线性,三线性或各向异性过滤。

纹理压缩:

  • GLES3:用于高质量压缩的BPTC(macOS不支持)。
  • GLES3: ETC2(在macOS上不支持)。
  • ETC1(使用GLES2渲染器时推荐)。
  • GLES3: S3TC(移动/ Web平台不支持)。

抗锯齿:

  • 多样本抗锯齿(MSAA)。

这些效果中的大多数都可以调整以获得更好的性能或进一步改善质量。使用Godot进行脱机渲染时,这可能会有所帮助。


3D工具
  • 内置网格:立方体,圆柱/圆锥,(半)球,棱镜,平面,四边形。
  • 程序几何生成工具。
  • 构造实体几何体(用于原型设计)。
  • 表示3D空间中路径的Path3D节点。
    • 可以在编辑器中绘制或按程序生成。
    • 使节点跟随Path3D的PathFollow3D节点。
  • 3D几何帮助器类。

3D物理

物理机构:

  • 静态物体。
  • 刚体。
  • 运动机构。
  • 车身(用于街机物理,而非模拟)。
  • 关节。
  • 柔软的身体。
  • 布娃娃。
  • 探测进入或离开尸体的区域。

碰撞检测:

  • 内置形状:长方体,球体,胶囊,圆柱体(仅在Bullet物理中)。
  • 从编辑器为任何网格生成三角形碰撞形状。
  • 从编辑器为任何网格生成一个或多个凸形碰撞形状。

着色器
  • 2D:自定义顶点,片段和灯光着色器。
  • 3D:自定义顶点,片段,灯光和天空着色器。
  • 使用受GLSL <doc_shading_language>启发的着色器语言的基于文本的着色器。
  • 可视着色器编辑器。
    • 支持视觉着色器插件。


脚本编写

一般:

  • 带有扩展节点脚本的面向对象设计模式。
  • 脚本之间进行通信的信号和组。
  • 支持跨语言脚本
  • 许多2D和3D线性代数数据类型,例如向量和变换。

GDScript:

C#:

  • 打包在单独的二进制文件中,以减小文件大小和依赖性。
  • 使用Mono6.x。
    • 完全支持C#7.0语法和功能。
  • 支持所有平台。
  • 建议使用外部编辑器以受益于IDE功能。

视觉脚本:

  • 基于图的可视脚本语言
  • 当用于特定目的(例如特定于级别的逻辑)而不是用于创建整个项目的语言时,效果最佳。

GDNative(C,C ++,Rust,D等):

  • 在需要时,链接到本机库以获得更高的性能和第三方集成。
    • 对于脚本游戏逻辑,如果性能合适,建议使用GDScript或C#。
  • C和C ++的官方绑定。
    • 使用所需的任何构建系统和语言功能。
  • 维护社区提供的D,Kotlin,Python,Nim和Rust绑定。

音讯

特征:

  • 单声道,立体声,5.1和7.1输出。
  • 2D和3D中的非位置和位置播放。
    • 2D和3D中的可选多普勒效果。
  • 支持可重新路由的音频总线和效果。
    • 包括数十种效果。
  • Listener3D节点从不同于3D摄像机的位置收听。
  • 音频输入以录制麦克风。
  • MIDI输入。
    • 尚不支持MIDI输出。

使用的API:

  • Windows: WASAPI。
  • macOS: CoreAudio。
  • Linux: PulseAudio或ALSA。

进口

格式:

  • 图片:请参阅支持的图片格式
  • 音讯:
    • 带有可选IMA-ADPCM压缩的WAV。
    • Ogg Vorbis。
  • 3D场景:
    • glTF 2.0 (推荐)。
    • ESCN (从Blender直接导出)。
    • FBX(实验性)。
    • Collada(.dae)。
    • Wavefront OBJ(仅静态场景,可以直接作为网格加载)。


输入项
  • 使用硬编码的输入事件或可重映射的输入动作的输入映射系统。
    • 轴值可以映射到具有可配置死区的两个不同的动作。
    • 使用相同的代码支持键盘和游戏手柄。
  • 键盘输入。
  • 鼠标输入。
    • 鼠标光标可以在窗口内可见,隐藏,捕获或限制。
    • 捕获后,原始输入将在Windows和Linux上使用,以避开OS的鼠标加速设置。
  • 游戏手柄输入(最多8个模拟控制器)。
  • 具有压力支持的笔/平板电脑输入。

导航
  • 2D和3D中的A *算法。
  • 导航网格。
    • 支持Godot 4.0中计划的动态避障。
  • 从编辑器生成导航网格物体。

联网
  • 使用StreamPeer和TCP_Server的低级TCP网络。
  • 使用PacketPeer和UDPServer的低级UDP网络。
  • 使用HTTPClient的低级HTTP请求。
  • 使用HTTPRequest的高级HTTP请求。
    • 使用捆绑的证书开箱即用地支持HTTPS。
  • 使用UDP和ENet的高级多人API。
    • 使用远程过程调用(RPC)自动复制。
    • 支持不可靠,可靠和有序的传输。
  • WebSocket客户端和服务器,在所有平台上都可用。
  • WebRTC客户端和服务器,在所有平台上都可用。
  • 支持UPnP以在将服务器托管在NAT之后时避免转发端口的要求。

国际化
  • 完全支持Unicode,包括表情符号。
  • 使用CSVgettext存储本地化字符串。
  • 自动在GUI元素中或通过使用tr()功能在项目中使用本地化的字符串。
  • 支持Godot 4.0中计划的从右到左的排版和文本成形。

窗口和操作系统集成
  • 移动,调整大小,最小化和最大化项目产生的窗口。
  • 更改窗口标题和图标。
  • 请注意(在大多数平台上,标题栏会闪烁)。
  • 全屏模式。
    • 不使用独家全屏,因此无法通过这种方式更改屏幕分辨率。请改用其他分辨率的视口。
  • 无边框窗口(全屏或非全屏)。
  • 能够使窗口始终位于顶部。
  • 具有每个像素透明度的透明窗口。
  • macOS上的全局菜单集成。
  • 以阻塞或非阻塞方式执行命令。
  • 使用默认或自定义协议处理程序(如果已在系统上注册)打开文件路径和URL。
  • 解析自定义命令行参数。

移动
  • 在Android和iOS上进行应用内购买。
  • 支持使用第三方模块的广告。

XR支持(AR和VR)
  • 开箱即用,对iOS上的ARKit的支持。
  • 支持OpenXR和OpenVR API。
  • 借助插件,支持了流行的VR耳机,例如Oculus Quest和HTC Vive。

GUI系统

Godot的GUI使用与Godot中制作游戏相同的Control节点构建。使用插件可以很容易地以多种方式扩展编辑器UI。

节点:

  • 纽扣。
  • 复选框,复选按钮,单选按钮。
  • 使用LineEdit(单行)和TextEdit(多行)输入文本。
  • 使用PopupMenu和OptionButton的下拉菜单。
  • 滚动条。
  • 标签。
  • RichTextLabel用于使用BBCode格式化文本
  • 树(也可以用来表示表格)。
  • 容器(水平,垂直,网格,中心,边距,可拖动拆分器等)。
  • 控件可以旋转和缩放。

浆纱:

  • 将GUI元素保持在特定角,边缘或中心的锚点。
  • 遵循某些规则自动放置GUI元素的容器。
  • 使用2dviewport拉伸模式缩放至多种分辨率。
  • 使用锚点和expand拉伸宽高比支持任何宽高比。

主题:

  • 内置主题编辑器。
    • 根据当前编辑器主题设置生成主题。
  • 使用StyleBoxFlat基于过程矢量的主题
    • 支持圆角/斜角,阴影和边框宽度。
  • 使用StyleBoxTexture基于纹理的主题

Godot的发行规模较小,可以使其适合替代Electron或Qt之类的框架。


动画
  • 正运动学和逆运动学。
  • 支持使用可自定义插值对任何属性设置动画。
  • 支持动画轨道中的调用方法。
  • 支持播放动画轨道中的声音。
  • 支持动画中的贝塞尔曲线。

格式
  • 场景和资源可以以基于文本或二进制的格式保存。
    • 基于文本的格式易于阅读,并且对版本控制更为友好。
    • 对于大型场景/资源,二进制格式的保存/加载速度更快。
  • 使用File读写文本或二进制文件。
    • 可以选择压缩或加密。
  • 读取和写入JSON文件。
  • 使用ConfigFile读写INI样式的配置文件。
    • 可以(反)序列化任何Godot数据类型,包括Vector,Color,...
  • 使用XMLParser读取XML文件。
  • 将游戏数据打包到PCK文件(为快速查找而优化的自定义格式),ZIP存档中,或直接打包到可执行文件中以进行单文件分发。
  • 导出引擎可以读取的其他PCK文件,以支持mod和DLC。

  • 对服务器的低级别访问,可以在需要时绕过场景树的开销。
  • 自动化的命令行界面。
    • 使用持续集成平台导出和部署项目。
    • 完成脚本 适用于Bash,zsh和fish。
  • 支持静态链接到引擎二进制文件的C ++模块
  • 用C ++ 03编写的引擎和编辑器。
    • 可以使用GCC,Clang和MSVC 进行编译。还支持MinGW。
    • 对打包程序友好:在大多数情况下,可以使用系统库代替Godot提供的库。构建系统不下载任何内容。构建可以完全复制。
    • Godot 4.0将用C ++ 17编写。
  • 根据许可的MIT许可进行许可。



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

本版积分规则

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

GMT+8, 2024-3-29 21:44

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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