Godot

6222 readers
129 users here now

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

[email protected]

Credits

founded 2 years ago
MODERATORS
201
 
 

Hi everybody! Would you like to know how to easily create a screenshot in your game using the Godot Engine, whether it's a 2D or 3D game? In this short video, I'll show you how.

202
 
 

A screenshot of some of the current Godot gold level supporters. The one supporter highlighted has chosen the name "TaraSophieDev (pls fix #43093)"

The issue is still open! The merge request seems to be almost ready. Though there hasn't been any new development since May.

203
 
 

That intro though.

204
 
 

Hi everybody! I know I often say "Let's make a quick video about a simple effect" and then I usually end up talking about it for over 20 minutes. But this time I hope I'll finally manage to make a shorter video because today's effect is really easy, as you can see in the background.

205
 
 

I'm curious because GDScript sounds like a very high and good abstraction for the engine.

Dynamic nature

Pros & cons of dynamic typing

GDScript is a Dynamically Typed language. As such, its main advantages are that:

  • The language is easy to get started with.
  • Most code can be written and changed quickly and without hassle.
  • Less code written means less errors & mistakes to fix.
  • The code is easy to read (little clutter).
  • No compilation is required to test.
  • Runtime is tiny.
  • It has duck-typing and polymorphism by nature.

While the main disadvantages are:

  • Less performance than statically typed languages.
  • More difficult to refactor (symbols can't be traced).
  • Some errors that would typically be detected at compile time in statically typed languages only appear while running the code (because expression parsing is more > strict).
  • Less flexibility for code-completion (some variable types are only known at run-time).

Additionally, the interesting thing for me, it resembles Python

It uses an indentation-based syntax similar to languages like Python. GDScript is entirely independent from Python and is not based on it.

and because I come from Rust, this is mind-boggling for me:

Memory management

Godot implements reference counting to free certain instances that are no longer used, instead of a garbage collector, or requiring purely manual management. Any instance of the RefCounted class (or any class that inherits it, such as Resource) will be freed automatically when no longer in use. For an instance of any class that is not a RefCounted (such as Node or the base Object type), it will remain in memory until it is deleted with free() (or queue_free() for Nodes).

206
207
 
 

The mine is Dome Keeper. I linked what's coming soon to this fun game!

208
209
210
211
212
 
 

Hi everyone! I always wanted to create this kind of effect with running lines, but I didn't know how to do it before. Now I finally know, and since it's a relatively simple algorithm, this video won't be extremely long either. Let's start with the tutorial.

213
 
 

For character abilities that have a certain trigger condition, eg. "OnAttack", "OnJump", "OnDamaged" etc..

Currently each of these triggers is a signal. When a signal fires, the character loops through all of its abilities and activates each one with that specific condition, so it just runs an if statement for every ability, regardless of whether it has that condition or not:

if ability.trigger_condition == Triggers.OnAttack:
  ability.activate()

My issue is that this could get a little unscalable with many characters on-screen each having many abilities of their own. A character could have 1 OnDamaged ability and 19 OnAttack abilities, but when an "OnDamaged" signal is received, it will still loop through all 19 OnAttack abilities.

Any advice on this is appreciated, thank you all.

214
 
 

I'm learning as I go. Proud of getting some interaction with the environment working. Still lots of bugs to sort out, especially player and camera movement!

215
 
 

Hi everyone! This time, I would create a really simple shader that can be quite useful if we need to make a smooth transition from one image to another. I experimented with it a bit while working on a side project. Let's take a look at what such a shader might look like.

216
64
ClamAV Frontend in Godot (autumn.revolt.chat)
submitted 8 months ago* (last edited 8 months ago) by MarshReaper to c/[email protected]
 
 

I hope this software is useful to those who feel they need it.

Available on codeberg: https://codeberg.org/MarshReaper/GuardianSecurityCenter/releases/latest

This is a client that makes use of the ClamAV packages available in most repositories. It is made to replace ClamTK and check that box for people wanting to use Linux.

Some features are still in development, so not for production use just yet. But, you can run a quick scan and update signatures which is basic enough for most users.

I saw a video DistroTube posted and it made me a bit confused. It was about the Kasperky being offered on Linux. If you have seen the comments you would understand.

Anyways, this had me remember people I know ask me about anti viruses on Linux. I tried ClamTK, but it is very unintuitive and has a somewhat broken workflow.

I hopped on Godot and searched for an image of a popular antivirus software. I then made the software using the pretty layout that many people are used to.

I learned some things about Godot and I hope others will too with this project. Enjoy!

Also, if anyone could help me find the best way to distribute this software that would be great! (flatpak? repos? it requires administrative privileges)

217
218
 
 

Hi everyone! This is the third part of the video, where I explained the possibility of using 3D objects as part of a 2D scene in the Godot Engine. It turned out that the previous part was not entirely ideal because I explained the individual parts of the solution using the finished code of our game, which utilizes our own structure of classes and functions. This time, I am returning to this topic for the last time and will create the puzzle from scratch, as an entirely new project in Godot 4.

219
220
 
 

Hi everybody! In this video, I would like to demonstrate how we can create a simple effect for the background of our space game. It will be a moving star field that we can adjust with various parameters.

221
222
 
 

Hi everyone! This is the second part of the video, where I explained the possibility of using 3D objects as part of a 2D scene in the Godot Engine. And because I received several requests for a continuation that would clarify other aspects of this simple 3D puzzle, that's exactly what this video is about. Let's take a look.

223
224
 
 

Durant mes courtes errances je lis la doc de @godot et plus ça va plus ça me fait penser à flash. Tu colles littéralement des scripts dans des scenes/sprites/movieclip et tu connectes des events : onLoad, onEnterFrame.

225
20
submitted 8 months ago* (last edited 8 months ago) by [email protected] to c/[email protected]
 
 

I want to implement a threaded loading component into my game. I am currently saving all my settings and other level files as bytes externally (meaning not in the res:// folders), as I want to be able to export files and send them to others, so they can use them as well. There is the ResourceLoader.load_threaded_request() method, but that only returns Resources and not PackedByteArrays. As far as I can tell, there is only the FileAccess.get_file_as_bytes() method for importing byte files, which has to run in the main thread (and thus blocking it until the load is complete). Does someone know if I am missing some method here?

EDIT: I have put my fix for this into the comments

view more: ‹ prev next ›