Godot

5909 readers
1 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 1 year ago
MODERATORS
126
 
 

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).

127
128
134
submitted 5 months ago by Psyhackological to c/godot
 
 

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

129
130
16
submitted 5 months ago by mac to c/godot
131
34
submitted 5 months ago by mac to c/godot
132
133
 
 

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.

134
 
 

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.

135
 
 

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!

136
 
 

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.

137
63
ClamAV Frontend in Godot (autumn.revolt.chat)
submitted 5 months ago* (last edited 5 months ago) by [email protected] to c/godot
 
 

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)

138
139
 
 

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.

140
141
 
 

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.

142
42
submitted 5 months ago by popcar2 to c/godot
143
 
 

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.

144
37
submitted 5 months ago by [email protected] to c/godot
145
 
 

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.

146
20
submitted 6 months ago* (last edited 6 months ago) by [email protected] to c/godot
 
 

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

147
394
Solodev life (i.redd.it)
submitted 6 months ago by [email protected] to c/godot
 
 
148
 
 

This is just a question.

In case you don't know, motion matching is the term for animating characters... basically in a way that smoothly blends minor and even major animations into each other, such that characters are animated much closer to life.

It is most notable in scenarios where a character rotates their axis of movement dramatically, or speeds up or stops suddenly. Instead of the more old school instant rotation or sudden transition from running to stationary, you get a dynamic and procedural animation. Perhaps most notably, feet and legs actually take steps, instead of gliding, during transitions.

It is not the same as inverse kinematics. That basically just matches feet and legs to the geometry they are standing on, for stairs or inclines. (You can use it with arms for things like adjusting arms during arm anims to better match individual weapons or other things, etc.)

Unity, Unreal and O3DE all have freely available motion matching plugins, and I know Unreal and O3DE have freely available prepackaged humanoid animation libraries. Unity probably does as well, though more expansive anim sets cost some money.

So... question is: Is motion matching even possible in Godot? Is there some plugin hidden in GitHub or somewhere that does this?

From what I've been able to figure out... the YMAA project... apparently? claimed to be working on this, but their repo has not been updated in months, their current release does not even have half the features they show off on their youtube channel, and they appear to now be making a machinima or something so who knows.

That is all I have really been able to find. A few other github devs and youtube channels have extremely rudimentary procedural animation in demos, but either they have not listed their code anywhere or its been abandoned for months or years, sometimes since before Godot 4.

So yeah, anyone know if there is a Godot Motion Matching plugin?

149
 
 

Hi everybody! In this video, I would like to create a simple and effective shader that can significantly change the appearance of a selected sprite or even the entire screen. The effect you are seeing now can certainly have many uses, such as disabling a specific UI element or simulating an image in an old newspaper article. Let's do it.

150
 
 

I have been trying to make receiving file paths really easy, with this method in an autoload:

func file_dialog_path(extentions:PackedStringArray = [], dialog_type:FileDialog.FileMode = FileDialog.FileMode.FILE_MODE_OPEN_FILE) -> String:
	var new_dialog:FileDialog = FileDialog.new()
	new_dialog.min_size = Vector2i(400, 400)
	new_dialog.access = FileDialog.ACCESS_FILESYSTEM
	new_dialog.file_mode = dialog_type
	for i in extentions:
		new_dialog.add_filter(i)
	get_tree().current_scene.add_child(new_dialog)
	new_dialog.popup_centered()
	var file_path:String = ""
	new_dialog.file_selected.connect( func receive_path(path:String):
		file_path = path
		print("file path from within the signal: ", path)
		return path)
	file_path = await new_dialog.files_selected
	print("this is the file now", file_path)
	
	#while file_path == "":
		#await get_tree().create_timer(0.1)
	return file_path

I commented out the while loop, as it froze the entire game when I do this.

I have tried this many times now, but the method always seems to get stuck somewhere. Right now, it gets stuck in the "receive path" function, where it will print the path, but not actually return. I am receiving the output from the file_dialog_path method like this:

var file:String = await file_dialog_path(["*.mml"], FileDialog.FileMode.FILE_MODE_SAVE_FILE)
print("This is the filepath for our level ", file)

Could anyone help me with this? The best idea I have right now would be to let that commented while loop run on a thread, but that seems unneccessarily difficult for such a simple problem.

view more: ‹ prev next ›