Godot-Learning-Path
Learning path for Godot. Bắt đầu với các course online, sau đó test các function của 1 game nào đó. Tạo 1 game hoàn thiện đủ sound và UI. Thêm shader, AI, network.
1 Tutorial game¶
Game đơn giản nhất là platformer 2D, mình học theo khóa học trên Udemy cho Godot 3. Những thứ quan trọng nhất cần nhớ khi bắt đầu Godot.
Dù Godot 4 đã có vài tháng và mình cũng có 1 khóa học Godot 4, nhưng có lẽ sử dụng Godot 3 hiện tại là đủ và phù hợp cho Android và web game hơn. Vừa học vừa chơi có lẽ phù hợp lúc này. Mình quyết định hoàn thành khóa Udemy mà mình mua được hơn 1 năm nhưng chưa có cơ hội học. Các notes dưới đây ghi lại quá trình và các thành quả mình học được.
Mình sẽ không dùng Assets có sẵn trong course mà mình học mà sử dụng Assets mình đã mua riêng như Godot-Learning-Path để có các hình ảnh nhân vật hứng thú hơn. Ngoài ra mình cũng áp dụng thêm custom engine mà mình compile cho Godot-Vita để game có thể chạy được trên Ps Vita và sử dụng được Assets Animation của DragonBones (load trực tiếp animation json file thay vì load rất nhiều ảnh mô tả chuyển động).
Bây giờ tôi sẽ tập luyện những chức năng nhỏ nhất trong game nhờ theo các code từ GDQuest course.
Bắt đầu với làm sao để cho nhân vật có thể di chuyển
Godot-4-Learn-Notes thì học khóa Godot-JumpStart
Test vài chức năng trong game Image-to-region-Godot
3 NODE COMMUNICATION (THE RIGHT WAY)¶
4 Node and scene organization¶
Anything that can be reused should be saved as its own scene and just instanced as a child of the main node. In my game, that includes things like the Inventory, Armature (handles animation and setting meshes), State Machine, Controlled Camera.
To keep dependencies low, you just have to keep the ol’ Godot addage : “Call down, signal up”. This means use function calls if a parent wants something from a child and use signals to tell a parent node something happened. As soon as a child node needs to know any details of its parent, you’ve created a dependency. If you’ve done it right, you can put that child on anything and just write a response to its signals to utilize it.
You can also stash a lot of reused functionality in inherited classes. For example, I have a BaseMobile class that has all the standard things I would expect a character to be able to do. These are things like adding an item to the inventory or functions for reacting to signals. Player inherits from and extends that class. So, he’s got his own on_death, on_hit, and lock_on functions that override the base class.
It’s very important that you don’t split any of this out in reaction to the sheer size of it. Only split up code in ways it’s going to improve how your system interacts with it. Trying to organize your code on purpose, instead of in reaction to a real need, is a sure way to make a fucking mess.
Nodeless classes are probably just resources. Resources are either the perfect thing to solve a problem or a disastrous trap. Be wary and read up before choosing to use them.
This means that Player has an Armature. Armature has an AnimationPlayer. Only the Armature knows how the AnimationPlayer works. Only the Player knows how the Armature works. Many things understand the standard functions of the BaseMobile class. If I want to play an animation, I use Player.play(), it calls Armature.play(), and Armature calls AnimationPlayer.play(). As a result, I can change anything in the chain, below the Player’s play() function, without touching anything outside its ecosystem.
5 Projections¶
Game 2D nhưng muôn hiệu ứng 3D thì có thể chọn Isometric hoặc ¾ (Three-Quarters View perspective, tức là giống với top-down game), nhưng Three-Quarters View thì dễ hơn vì x, y không bị méo, tương tự như video dưới đây.
Tuy nhiên có các game đặc biệt khác như game One hour One life thì chỉ là góc nhìn như platformer tức là nhìn đối diện, nhưng vẫn di chuyển được 4 hướng như top-down game. Chỉ khác biệt với top-down hoặc ¾ view là không thấy được nóc nhà (topview), nhưng nó mô tả được cảnh vật rất tốt
6 Game assets¶
Đăng ký 1 năm tại https://craftpix.net/ từ ngày 25/04/2023 giá 48e
Backlinks¶
No other pages link to this page.
Created : Feb 28, 2023
Recent Posts
- 2024-11-02: BUỔI 10 - Phân tích thị trường
- 2024-11-02: BUỔI 11 - Phân tích thị trường
- 2024-11-02: BUỔI 12 - Phân tích sóng tăng
- 2024-11-02: BUỔI 13 - Phân tích hỏi đáp
- 2024-11-02: BUỔI 14 - Yếu tố kiểm soát
- 2024-11-02: BUỔI 15 - Hỏi đáp
- 2024-11-01: BUỔI 6 - Ôn lại và bổ sung
- 2024-11-01: BUỔI 7 - Chiến thuật Trend
- 2024-11-01: BUỔI 8 - Công thức điểm vào lệnh
- 2024-11-01: K2023 - BUỔI 9 - Quy trình vào lệnh