godot游戏引擎自学入门笔记,官方文档翻译(一)

版权声明:本文为博主dark_tone暗色调 原创文章,未经博主允许不得转载。 https://blog.csdn.net/dark_tone/article/details/89038713

从来还没接触过游戏引擎,对比了一下untiy,cocos,白鹭erget等等,发现要么太复杂,要么我无法下载页面出错,要么太老旧,工具链不充足,需要额外去找。

我就想要一个很轻量级的,别太复杂,够简单易用,但又不能过于底层,否则直接用dx或者opengl来画。

无意中发现了godot,跨平台,轻量级,有一定的工具链,主打2d游戏开发。

godot最大缺点有一个:

  1. 没有中文,没有中文。这就造成了查询资料,提问,还有反馈都增加了门槛。

另外,我查了下两个引擎的底层图形实现,godot是兼容OpenGL 2.1 / OpenGL ES 2.0,opengl 2.1 发布时间在2007年。
而白鹭 egret 是基于 webgl,再次查询WebGL is based on the OpenGL ES 2.0 specification。

早期的OpenGL使用立即渲染模式,也就是固定渲染管线;优点在于确实容易使用和理解,缺点在于效率教低。
于是从OpenGL3.2开始(2009年),规范文档开始废弃立即渲染模式,鼓励开发者在OpenGL的核心模式下进行开发,这个分支的规范完全移除了旧的特性。当我们试图使用一个已废弃的函数时,OpenGL会抛出一个错误并终止绘图。
核心模式的优势是更高的灵活性和效率,然而也更难于学习。

所以这两个引擎都是用的立即渲染模式???

为什么还在用10年前的东西呢? 个人觉得主要是稳定,支持面广,再说现在硬件性能相对过剩,所以没必要去追最新的图形技术。

搞研究当然追新,追前沿,但是工程实践,还是追求稳定第一,受众面足够广,成本尽量小。

首先去官网下载godot下载

我是win10 64位,版本3.1,解压出来50MB
在这里插入图片描述
双击运行
在这里插入图片描述
检测一下显卡,老当益壮750ti,hoho
在这里插入图片描述
打开asset库,资源商店
在这里插入图片描述
右上角可以修改语言,改成中文。
在这里插入图片描述
有各类官方给的demo,幸好界面还有中文,可惜资料全英文。
新建一个项目:
在这里插入图片描述
这里官方给出了提示,我还是选择opengl es2.0版本,3.0不推荐用于网络游戏么,第一次知道。
在这里插入图片描述
默认进来是3D工作界面,在上面点选成2D.
近视眼感觉字体小了点,在编辑器界面调整一下:
在这里插入图片描述
下面该做什么有点懵,查询官方帮助step by step:

节点

Imagine for a second that you are not a game developer anymore. Instead, you’re a chef!
Now, instead of making games, you create new and delicious recipes for your guests.

‘想想自己不是游戏开发者,而是一个厨师,厨师要给客人做美味菜单。’

So, how does a chef create a recipe? Recipes are divided into two sections: the first is the ingredients and the second is the instructions to prepare it. This way, anyone can follow the recipe and savor your magnificent creation.

‘厨师怎么做食谱? 食谱被分成了两个部分:首先是配料,然后是准备它的操作。 这样,任何人都可以遵循食谱,品味你华丽的创作’

Using the engine feels like being in a kitchen. In this kitchen, nodes are like a refrigerator full of fresh ingredients with which to cook

‘使用引擎就好像在厨房里,节点就是需要烹饪的原料。’

Nodes are fundamental building blocks for creating a game.

‘节点是创建游戏的基本构建块’

a node can perform a variety of specialized functions

‘节点可以执行各种特殊功能’

However, any given node always has the following attributes:
It has a name.
It has editable properties.
It can receive a callback to process every frame.
It can be extended (to have more functions).
It can be added to another node as a child.

但是,任何给定的节点总是具有以下属性:
①它有名字
②它具有可编辑属性
③它可以接收回调来处理每一帧
④它可以被扩展(具有更多的功能)
⑤它可以作为一个子节点添加到另一个节点中
在这里插入图片描述
所以节点可以形成节点树。

Since different nodes have different functions,combining them allows for the creation of more complex functions.

由于不同的节点具有不同的功能,组合它们可以创建更复杂的功能。

场景

A scene is composed of a group of nodes organized hierarchically (in tree fashion)
always has one root node.
can be saved to disk and loaded back.
can be instanced (more on that later).

场景是由一组分层组织的节点构成(在行为树)
①总是有一个根节点
②可以保存到磁盘并加载回
③可以实例化(稍后再讨论)

Running a game means running a scene. A project can contain several scenes, but for the game to start, one of them must be selected as the main scene.

运行一个游戏意味着运行一个场景,一个项目可以包含几个场景,但游戏开始时其中一个必须作为主要场景选择。

猜你喜欢

转载自blog.csdn.net/dark_tone/article/details/89038713