Advance your Code in Godot : Apply 3 Principles for any Project - Gdscript Tutorial

Nanotech Gamedev
Nanotech Gamedev
2.9 هزار بار بازدید - 4 ماه پیش - Through the development of my
Through the development of my RTS project I have come around some structural issues that were quite hard to figure out as I couldn't brainstorm solutions working with Godot, So on this video I am going to share how I applied 3 important principles that allowed my project to be built as I wanted. This is some groundwork to implement the AI in my project as I want AI behaviors to be controlled through attributes. Github Page Link for Traits System: (Godot-Proposals nº6416) github.com/godotengine/godot-proposals/issues/6416 This video would have helped me a lot when I first started to brainstorm solutions for my project, so if you are building a RTS or a game with unique objects like an RPG, and you are thinking how to have a system that allows to design units easily just by changing some options, I am going to show you how I did it for my RTS project, What I am going to present here took quite a while to figure out and stablish having started from scratch, hopefully you won't have the same issues as I had, The first principle is what I have talked a lot in other videos, modular scripts, because at the moment Godot doesn't allow multiple inheritance in gdscript with it's classes, and the project I am building needs a lot of specialized isolated code, it's a perfect candidate to creating re-usable modular script pieces, so I have developed a system using static scripts in order to work around that problem, The second one is about creating attributes for objects, the need for attributes was evident as RTS have many different objects that share the same structure but are completely different, making it quite a challenge to structure in code, however, having considered them as attributes I could create a solution that allows me to combine or separate as many attributes as I want, in order to build objects with a combination of different behaviors, using attributes is the way to go about that. The third one is how the those two first ones allows you to build the complex objects we need, with modular code the behaviors we want can be isolated functions stored and ready to be used at anytime anywhere in another script, through attributes we can select and combine the behaviors we want, which in turn will allow us to make the complex objects we want. This isn't a beginner tutorial, so if you don't completely understand, don't be discouraged, this is something that took quite some time to figure out, but I believe that it will be very useful if you want to build real complex games with Godot,
4 ماه پیش در تاریخ 1403/02/26 منتشر شده است.
2,920 بـار بازدید شده
... بیشتر