Godot

5884 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

!roguelikedev@programming.dev

Credits

founded 1 year ago
MODERATORS
126
127
128
 
 

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.

129
 
 

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.

130
 
 

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!

131
 
 

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.

132
63
ClamAV Frontend in Godot (autumn.revolt.chat)
submitted 5 months ago* (last edited 5 months ago) by MarshReaper@lemmy.world to c/godot@programming.dev
 
 

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)

133
134
 
 

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.

135
136
 
 

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.

137
138
 
 

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.

139
140
 
 

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.

141
20
submitted 5 months ago* (last edited 5 months ago) by Smorty@lemmy.blahaj.zone to c/godot@programming.dev
 
 

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

142
 
 
143
 
 

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?

144
 
 

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.

145
 
 

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.

146
17
Understanding PopupMenus (programming.dev)
submitted 5 months ago* (last edited 5 months ago) by dai0@programming.dev to c/godot@programming.dev
 
 

Hi there everyone!

As the title suggests I'm having some problems with PopupMenus and could use a bit of guidance from people more familiar with the engine.

I tried looking through documentation and repo issue discussions but neither of those managed to clear things up for me though it might simply be a case of me being a dumdum. Here's what I'm struggling with:

Issue #1

I'm working on a pixel art title and chose a pretty small screen size as a target (1280x1120 with the scale of 5 so I'm working on 256x224).

Because of this I use font size 11 for most of the text elements but for some reason this does not work well with PopupMenu lists, as options there end up blurry and unreadable.

I read that these elements are scaled somehow differently (or used to anyway) so my question is: is there a way to make it consistent with all the other UI elements? If so, how should I go about it?

Issue #2

I'm adding an optional CRT shader to the game. It works great with both stages and all UI elements except for PopupMenus which simply aren't affected.

Here's my scene setup. CurrentScene is a parent node to the active scene (main menu or one of the stages). I use ZIndex property to draw the CRTShader over other elements.

Any ideas would be greatly appreciated.

Edit: I forgot to mention I'm using Godot 4.3 dev3 and the PopupMenus are automatically created for all OptionButton objects.

Edit #2, in case someone has a similar issue/question: Looks like PopupMenus are rendered as separate windows rather than part of the base one. Writing my own implementation will most likely be the easiest solution to sidestep both issues.

147
 
 

I made a really simple 2D platformer yesterday using @godot and following a tutorial.

It's all assets I downloaded and steps I followed, but it's something I never thought I'd actually be able to do!

It was interesting and I definitely want to learn more in the future!

This is the most fulfilled I've felt in months.

148
17
I made an SDF Control Tool (files.catbox.moe)
submitted 6 months ago* (last edited 6 months ago) by Smorty@lemmy.blahaj.zone to c/godot@programming.dev
 
 

I made a Node which allows for very quick coloring and animating of signed distance field textures. In the linked video, a short demo shows what one can do with this Node and some signed distance field textures. Here is a little tour of the usage of the Node. Should I put it on the asset library, or is this kind of stuff too specific to be useful?

149
 
 

Hi everybody! I recorded this video after a few experiments with color changes using a shader on a sprite. Let's take a look at the options we have available.

150
 
 

I've been working on this game in my free time, and I'd love to hear what you think. This is my first release in Godot, and I have to say I learned quite a lot about how the engine works even if it is very UI-centric.

Hex-A-Guess is a colour guessing game for graphic designers, web developers, and nerds who like hexadecimal numbers. Can you guess one of sixteen million colours in only five attempts?

You can play it free in browser, or download it DRM-free and own it forever at no cost.

https://bougiebirdie.itch.io/hex-a-guess

view more: ‹ prev next ›