Godot

6457 readers
43 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
1
 
 

Hello. I'm at a point in my learning where I see potential to make a big mess and want some advice before that happens. Particularly, how to organize game systems like inventory, damage calculation, level variables (eg. locked doors -> remain unlocked even after the level scene is reloaded).

For Inventory (consumable items, weapons etc), what I've done so far that seems to work is create a global script called PlayerInventory, within it is a list of every item as a boolean variable to indicate if the player has it or not. So now when the player travels through different level scenes, their inventory is persistent and any upgrades remain. Seems to work so far.

But how would you go about doing this for a locked door in a level scene? One way is to tie it to a key, in the player inventory - if "key" == true, "locked" = false. Ok, fine. What about a wooden crate that has been destroyed by the player? How would you keep track of the crate's destroyed state without it being tied to a "key item" in the PlayerInventory global script? Is the solution to create more global scripts, like "EnvironmentChanges"? What script should be responsible for remembering this and where should it live?

With regards to a damage calculation system, I think the high level question is similar- how to organize this? The path I'm going down looks like, "DamageManager" global script which handles the calculations and updates, meanwhile the player and enemy scenes have an "HP" node added, with the "hp" value variable set by the parent (the player or that specific enemy).

I'm looking for high-level ideas about how to make these things work together and to keep it as easy to maintain and organized as possible. More details and specifics are welcome, too. Thanks

2
3
 
 

Hi everyone! In this video, I won't be showcasing any shader. Instead, I'll show you a trick for easily generating 2D sprites from 3D models in Godot Engine 4.4 or higher.

4
 
 

I just came across this great GDscript reference page and thought it might be handy for other beginners here. Cheers!

5
 
 

so I have the RB2D collision layer just for collisions, and I have a area2d collision layer for detecting contact between cloned nodes, but it doesnt detect the two earth nodes touching unless I set the area2D collision mask to layer 1 and I'm not sure why.

6
 
 

Hello everybody!

I have recently started to make small game jam project with friends using Godot. I previously had some experiences with it, but only on solo dev project. I really like it. I recommended it, and we used it on several project with git the following way: we split our project in a lot of small scene to avoid conflict, and everybody works on their branch. We communicate to be sure nobody is working on the same scene.

Now we face problems that could mean the end of our godot usage as a team: After some commit (I'll say the first one after a fetch), the uid of some random scene changes and will cause merge conflicts. It seems that there is no logic to it, and it leads to a lot of time lost, sometimes file corruption. The faulty commits are then extremely hard to track. Today we worked with godot 4.4 and it was even more painful. We lost a lot of our project.

I really want to continue to work with Godot, but I should say that my teammates were talking about learning other engine (and I want to be clear: the git conflict is our only issue; but we took half our coding time resolving conflict, reverting commit, cherry picking, etc. just so the master branch has something working on it)

If I have to choose between believing that our workflow sucks or that it is impossible to work with Godot in a team, I'm 99% on our skill issue. If you have any solution or advice, thank you! If you work on a team and you never had those kind of problem, that is also good to know!

Best

7
8
 
 

This was a fun one. Here's my newest post on how to dramatically reduce Godot's build size.

Some sacrifices were made... But the end result is a Godot project that works exactly the same, albeit with slightly worse performance. Hope this can help others in achieving tiny build sizes!

9
 
 

cross-posted from: https://lemmy.abnormalbeings.space/post/62732

GodotSteam tutorials for Godot/Steamworks SDK interfacing

10
 
 

Hello everybody! In this video, I would like to create an effect that transforms a scene into its pixelated version. We've seen that before, right? But this time, we won't settle for ordinary square objects—we'll tilt them a bit to create a diagonal grid with an adjustable size. Let's take a look at how such an algorithm works.

11
12
 
 

Still working away on Gopilot, my half-finished LLM-powered AI thingy for Godot.

In the example video you can see an LLM agent creating some nodes and a script to make a login screen.

This is a cherry-picked example, but I am working on improving this.

The @action command is required for it to interact with your nodes and project files and such.

The model used for this is Mistrals codestral model which has a free API. It's presumably a rather small model, coming from Mistral.

If you have any questions, ask right away

13
 
 

Hello, 🙂

I created a new language called FuncSug. Its purpose is to make GUI programming in the browser easier and so game programming. The facility consists on eliminating asynchronism: In FuncSug, the code is no longer managed by an implicit/explicit global loop (I don't speak about implementation).

I intend, if I have time, to implement it for Godot as well. In FuncSug, the first tutorial of Godot would be roughly coded as this:

func showMessage(p_message):
	parallel exitWith branch 2 ||
		showIn(p_message, $MessageLabel)
	||
		waitSeconds(2)

parallel ||
	while true:
		# Start of game
		parallel exitWith branch 2 ||
			showMessage('Dodge the\nCreeps')
		||
			waitSeconds(1)
			awaitPressed($StartButton)
		get_tree().call_group(&"mobs", &"queue_free")
		score := 0
		$Player.start($StartPosition.position)
		
		# Middle of game
		parallel exitWith branch 1 ||
			awaitSignal('hit')
		||
			while true:
				playSoundFile('House In a Forest Loop.ogg')
		||
			showMessage('Get Ready')
			parallel ||
				while true:
					waitSeconds(1)
					score += 1
			||
				while true:
					waitSeconds(0.5)
					callgd spawnMob()
		
		# End of game
		parallel ||
			showMessage('Game Over')
		||
			playSoundFile('gameover.wav')
||
	while true:
		await score
		$ScoreLabel.text := score

The 'player.gd' and 'mob.gd' files would be keeped as they are. The "_on_MobTimer_timeout" function would be renamed as "spawnMob" and moved to 'mob.gd'. The timers wouldn't be needed any more.

Can you tell me what you think about it?

cross-posted from: https://programming.dev/post/26509534

14
15
 
 

So I know the Godot Asset Library links back to some other source like GitHub for the actual files. It also appears that it uses the "git archive" to create the zip file, because you can update .gitattributes to ignore everything but what is in the addons directory which is handy for a plugin.

But does it have any other metrics, like number of times an Asset is downloaded or used? I'm not sure that you can tell from the GitHub analytics if it is pulling it since that table seems to show "clones" and not "archive"s? Also it probably wouldn't look like a new user.

Anyway I was just curious enough to shoot out this question into the ether.

16
17
 
 

Hi everyone! Let's create a simple algorithm that allows us to remap the colors of our scene to a predefined palette. This effect can be useful if, for example, we want to simulate the screen of an older device that only supported, say, 256 colors, and similar scenarios.

18
 
 

Added the swords to have something else for a change than boxes in all ratios. And, well, every Bulletheaven game needs something to collect, right?

19
20
 
 

A few seconds longer and it would take off like a choppa

21
 
 

Wanted to have them orbiting while maintaining center alignment, didn't fully work out ¯_(ツ)_/¯ But I do kinda like it

22
23
24
 
 

Hi everybody. This is the second part of the tutorial, which explains the basics of a technology called ray marching for rendering a 3D scene using a shader. In the first part, we modeled a simple scene with a sphere, a cylinder, and a cube, and this time we will demonstrate how to properly light such a scene and calculate shadows.

25
view more: next ›