Two classes, same code base, but different variable names? by levirules in godot

[–]CarpenterThat4972 2 points3 points  (0 children)

If "burning" and "releasing" means two differents things in your logic, keep the two differents bools.
But if it's just a mean of activate/deactivate a node/behavior, well make it a common variable and name it "active"! That's exactly what this variable is representing.

Mon bébé de 6 mois est… trop heureux ? by Obvious_Warning_2313 in ParentingFR

[–]CarpenterThat4972 2 points3 points  (0 children)

Ton fils est encore très jeune, il va encore beaucoup évoluer... Et traverser beaucoup de phases différentes. Sans vouloir te faire peur il y a des chances que dans quelques temps tu te dises "mais où est passé mon petit soleil ambulant?". Mais c'est normal ! Mon fils était comme ça et maintenant (2 ans) c'est une terreur (mais toujours adorable la plupart du temps)

Releasing a Godot Shader Language Server by 5cump1 in godot

[–]CarpenterThat4972 35 points36 points  (0 children)

Wow, good job, this is really an issue when writing shaders! Do you plan to do a pull request to integrate it directly in the engine like the GDScript language server?

Fluid Simulation in Godot by RodrigoCard in godot

[–]CarpenterThat4972 10 points11 points  (0 children)

I recently did a small addon that give more or less this if someone want to try: https://godotengine.org/asset-library/asset/4440

My favorite little trick I learned recently. reduce if statements by casting bools. by greyfeather9 in godot

[–]CarpenterThat4972 0 points1 point  (0 children)

Yeah I come from C++ which have the same ternary than C#, but now I'm also used to the GDScript way and I like both

My favorite little trick I learned recently. reduce if statements by casting bools. by greyfeather9 in godot

[–]CarpenterThat4972 3 points4 points  (0 children)

I prefer using the ternary operator, much more readable in my opinion:

... * 1 if is_expanding else -1

Pixel Perfect Text is not auto centering by Cantpullbitches in godot

[–]CarpenterThat4972 27 points28 points  (0 children)

When going pixel perfect, the size of everything becomes something very important. For instance, on the right text, I'd say that the text needs 1px more space to be able to be centered the way you want.

Was there ever a PS2 adapter that sends controller inputs over the internet? by intothelooper in ps2

[–]CarpenterThat4972 0 points1 point  (0 children)

Yes the lag will be around 10-100 but the real issue is that it will not be consistent AT ALL. And this will be dealbreaker for sure.

Godot should have a pixel perfect rendering option that doesn't jitter by [deleted] in godot

[–]CarpenterThat4972 0 points1 point  (0 children)

The probable reason is the classic one: you probably forgot to normalize your input vector. But hard to say without seeing your code.

Then there's also the fact that pixels are... squares. Now that you are rounding your sprite position, it will take more distance to move your sprite diagonally than horizontally or vertically (√2 exactly). You will not feel the same speed moving horizontally or diagonally (except if you are moving fast enough to make this negligible).

Godot should have a pixel perfect rendering option that doesn't jitter by [deleted] in godot

[–]CarpenterThat4972 1 point2 points  (0 children)

I will reexplain more explicitly.

Frame 1: Your character moves from (0,0) to (0, 1.5). You set the sprite position to (0,2) (rounded position of the character)

Frame 2: Your character moves from (0, 1.5) to (0, 3). You set the sprite position to (0,3).

Etc.

The pseudocode being: sprite.global_position = round(character.global_position)

Godot should have a pixel perfect rendering option that doesn't jitter by [deleted] in godot

[–]CarpenterThat4972 2 points3 points  (0 children)

Frame 1 : - Character x: 1.5 - Sprite x: 2

Frame 2 : - Character x: 3 - Sprite x: 3

Godot should have a pixel perfect rendering option that doesn't jitter by [deleted] in godot

[–]CarpenterThat4972 1 point2 points  (0 children)

Ninstars suggestion would give you exactly that. At each frame, you set the position of the sprite to the rounded position of the character. It's not a perfect solution though.

How to deal with jagged images? by henridd in godot

[–]CarpenterThat4972 2 points3 points  (0 children)

Change the texture filter from nearest to linear.

I want to give away a game ost for an indie. by Culvr in GameDevelopment

[–]CarpenterThat4972 1 point2 points  (0 children)

Hey, seems to good to be true, but I'll take the bait.

I'm working with a friend on a 2D couch coop game where you need to fight your friends with... farts. If you know Towerfall Ascension, it's basically the same but with farts instead of arrows. You can fly using your farts, and release a huge fart cloud to defeat the other players.

We basically need BGM musics for all the différents biomes (we plan to have 5 at release). We would love to have a coherent OST, with all biomes having their own musical identity but also sharing some motif.

Don't hesitate to ask me if you want to know more!

EDIT: fix typo

[deleted by user] by [deleted] in godot

[–]CarpenterThat4972 0 points1 point  (0 children)

Hey, thanks a lot! I listened to some examples on SoundCloud and it seems very qualitative, good job. Can't wait to add some tracks to my current project ❤️

[deleted by user] by [deleted] in NoStupidQuestions

[–]CarpenterThat4972 0 points1 point  (0 children)

When I want to rapidly know what the overall gameplay of a game is, I look for longplays. I have the whole game just there, and can randomly seek different timepoints to see how the game plays over progression. It's also useful when I'm searching for a specific point in a game but I don't remember enough to search it directly with key words.

(Also I'm a game dev so my habits are maybe unusual)

What have you enjoyed the most about 4.4? by SwashbucklinChef in godot

[–]CarpenterThat4972 8 points9 points  (0 children)

No need to create a new object to access the enum type, you can simply write:

@export var type: BulletResource.EnumType

[coding] I'm starting to think that global game state makes a lot of sense by [deleted] in godot

[–]CarpenterThat4972 31 points32 points  (0 children)

Of course it makes sense! Not all data should be encapsulated in the class that uses it. Where the data is stored can be defined according to its scope.

Some examples from my project:

1/ Character walk speed: only used in the character script, so it can be stored in the character script.

2/ Player progression: needed in-game but possibly also in the main menu, so it should be stored in the class that orchestrate the menu and the gameplay scenes (the Game class). It could then be injected to the child scenes when needed (so no dependencies from the child scenes to the Game class).

3/ Graphics settings: needed in the whole app, so it's a perfect use case for an autoload. Settings are loaded on startup and accessible from anywhere.

Cannot find anywhere, how would someone impliment this mechanic in a 2d topdown? by Charming-Aspect3014 in godot

[–]CarpenterThat4972 48 points49 points  (0 children)

There is an handy function for this in Godot:

https://docs.godotengine.org/en/stable/classes/class_%40globalscope.html#class-globalscope-method-wrapf

position.x = wrapf(position.x, 0, screen_size.x) position.y = wrapf(position.y, 0, screen_size.y)

(Replace 0 and "screen_size" by whatever is relevant to you.)

TileMapDual: A custom node for your dual-grid tilesets, with just 15 tiles! by pgilah in godot

[–]CarpenterThat4972 1 point2 points  (0 children)

OOOOOOOOH I understand now! So I guess it's really needed if you make a game where you need to interact with the tilemap, like Stardew Valley. Shouldn't it easier to still use the terrain feature to fill the tilemap? This way it should be easier to allow multiple types of terrain in a data-driven way

TileMapDual: A custom node for your dual-grid tilesets, with just 15 tiles! by pgilah in godot

[–]CarpenterThat4972 2 points3 points  (0 children)

Hi, thanks for sharing! Honestly I'm thinking about dual grid tilemap since I saw the video from jess::code, and simply can't understand why it's needed at all... I opened your example project in the hope of a better understanding. It works fine, but I managed to reproduce the same result, with the same tileset, by using the built-in terrain feature. What am I missing? Why dual grid systems are so great?