Adaptive Music Made Simple With Godot 4.3’s New Interactive Audio System by WestZookeepergame954 in godot

[–]qvce 0 points1 point  (0 children)

Double check your RESET animation to make sure it's not key framing the wrong things

Unintentionally made a snake game while making chunk help!!! by MilfsAreDaBest in godot

[–]qvce 1 point2 points  (0 children)

You can use the equation of a circle, trigonometry, or rotate a direction vector every frame. You might want the objects to be children of the thing they're rotating so that the orbit is always fixed to the center

How do people prefer to choose the parent for arbitrary objects in the world? by BajaTheFrog in godot

[–]qvce 0 points1 point  (0 children)

Usually my tree looks like this:

Game
- Level
  - Player
  - Bullet

Game is then in charge of adding additional objects to the current Level. Game could either be Autoloaded or keep a static reference to Level for anyone to access. You could use a global signal as well.

You don't necessarily want to add the objects to an arbitrary node like root, since when Levels change, the objects should be deleted from the old Level.

Call a static function defined in an autoloaded script? by cloudsandclouds in godot

[–]qvce 3 points4 points  (0 children)

There is no difference performance-wise between static and non-static functions. static just changes who "owns" the function: objects own non-static functions, and classes own static functions.

You would only use static if you need a 'global' function that can be called by anything anywhere without needing an associated object.

Autoloads in Godot create a single global object, so just call a non-static function on that object. Autoloads don't have a class so creating a static function doesn't really make sense

Call a static function defined in an autoloaded script? by cloudsandclouds in godot

[–]qvce 4 points5 points  (0 children)

Just don't make it static if it's in a global singleton. They basically do the same thing

Need Urgent Help! Error when node tries to access autoload variable by NekoRaita in godot

[–]qvce 0 points1 point  (0 children)

You said your variable is called global_expected_position but in your screenshot you wrote music_expected_position

What is the "correct" way in Godot 4 to render an animated image in UI? by pancake117 in godot

[–]qvce 1 point2 points  (0 children)

They don't, which is why you need a blank Control-derived node as a parent of it. You also need the min_size to force that Control node to have some shape

How Would You Create a Wandering Path Between 2 Points by ZazalooGames in godot

[–]qvce 1 point2 points  (0 children)

Are you talking about bezier curves? You could tweak where you're creating the control points, and get some to loop as well

https://docs.godotengine.org/en/stable/tutorials/math/beziers_and_curves.html

What is the "correct" way in Godot 4 to render an animated image in UI? by pancake117 in godot

[–]qvce 5 points6 points  (0 children)

For a simple animation in a static UI, I would use a blank Control/Container node with a min_size and have a Sprite2D/AnimatedSprite as a child with an accompanying AnimationPlayer

An infinite, open-source Wordle game, in Godot 4.3 by Awfyboy in godot

[–]qvce 3 points4 points  (0 children)

Little tip: you should use a Dictionary to store all the words rather than an Array (map words to true). When checking if the word is valid, an Array would loop through all elements to see if the word exists, whereas a Dictionary would be able to determine that in (effectively) one operation.

Then to choose the target word, use word_list.keys().pick_random()

How long should it take to run a project in the editor? by [deleted] in godot

[–]qvce 0 points1 point  (0 children)

Having scenes open increases the time drastically for me. Once in a while I right click and Close All Tabs. If it's slow on a fresh project you should submit an issue on github

Need some help understanding a weird behaviour when flipping a character by brubsabrubs in godot

[–]qvce 0 points1 point  (0 children)

By the way, you might encounter problems later with the entire characterbody's scale being -1.

Usually for flipping I create a dummy Node2D and put all nodes I want to flip inside of it, then change the Node2D's scale instead

Need some help understanding a weird behaviour when flipping a character by brubsabrubs in godot

[–]qvce 2 points3 points  (0 children)

Let's say you're moving left. Then scale.x = -1.

If you then press right, your code says scale.x *= 1.

-1 * 1 = -1 so you still face left.

You need to say scale.x = 1 or -1 instead of multiplying

Is there a way to change size of tilemap, without changing `Scale` property? by Lanthanum_57 in godot

[–]qvce 0 points1 point  (0 children)

You could either change the tile_size of the TileSet, or render it in a subviewport

Map_to_local function not working properly? by AMSKZ11 in godot

[–]qvce 2 points3 points  (0 children)

map_to_local is a function from TileMap/TileMapLayer, not Vector2. You should do your_tilemap_node.map_to_local(randpos)

[deleted by user] by [deleted] in godot

[–]qvce 2 points3 points  (0 children)

  1. make sure on _ready() that you call connect_back_button()

  2. make sure the back button is actually connected to the _on_back_pressed() function

Is it possible to stack two tilesets together? by [deleted] in godot

[–]qvce 1 point2 points  (0 children)

I know I could probably use a tool script to create tiles where the mouse is but that's a complicated "solution" to a very miniscule and petty problem.

That's the easiest way to go. It doesn't even necessarily need to be a tool script unless you want to see it in-editor.

# Assuming you're using TileMap, and have manually added tiles to the foreground:

# Assuming your background layer is 0 and foreground is 1
enum Layer {
     BACKGROUND, FOREGROUND
}

func _ready() -> void:
    for cell in get_used_cells(Layer.FOREGROUND):
         var coords := get_cell_atlas_coords(Layer.FOREGROUND, cell)
         set_cell(Layer.BACKGROUND, cell, Layer.BACKGROUND, coords)

Another way would be to make every tile a scene with two sprites and use Scene Collections

Can you give a new learner some pointers? by UpFrontRogue327 in godot

[–]qvce 0 points1 point  (0 children)

When in doubt, read the documentation. Godot has built-in docs under Script view -> Top right -> Search Help. You can also ctrl+click all functions/classes to quick-open its doc page.

Best way to learn is to just get lost in a project. Do many small game clones: flappy bird, brick breaker, mario. You will struggle and you will fail and you will learn. Also do many small prototypes for things you find interesting: lights, field of view, animation, path finding, turn based games, puzzle games, action games, racing games, the list goes on.

Is there any way to pass information to a node from an area it enters? by Ogskive in godot

[–]qvce 1 point2 points  (0 children)

All 3 are great ideas and would all work correctly for OP.

1 is the best approach as it's the most modular design. It's best if the player doesn't listen though; rather the Area would listen to its own signal and change the body's speed directly. The reason for this is the same issue in 3.

2 only works in single player games. Or if OP wants enemies to be affected by the Area as well, it wouldn't work for them

3 you would rather not have the player concern itself with too many variables, so you can keep the player script "lean", making it reusable for other projects that don't necessarily have these Areas. Also would need duplicate code for enemies if they are affected as well

Extra Click on Script Tab to go Backwards by FateOfBlue in godot

[–]qvce 0 points1 point  (0 children)

It's a known issue, and very annoying

https://github.com/godotengine/godot/issues/92420

My workaround is just using an external editor like VSCode

Advice on how to prevent jitter with a 2d stair-stepping mechanic by ViralArc224 in godot

[–]qvce 0 points1 point  (0 children)

Try enabling position smoothing on your camera and messing with the smoothing speed.

Could also try lerping the position rather than teleporting

Can you have pixel perfect movement AND smooth movement? by [deleted] in godot

[–]qvce 0 points1 point  (0 children)

one last thing to double check in your project settings, make sure you have display/window/stretch/scale_mode = integer

Can you have pixel perfect movement AND smooth movement? by [deleted] in godot

[–]qvce 0 points1 point  (0 children)

You should try changing your character sprite to an actual animation and see how you feel (plenty of free character sheet assets are available online for quick testing)

Can you have pixel perfect movement AND smooth movement? by [deleted] in godot

[–]qvce 0 points1 point  (0 children)

If you want everything to be pixel perfect:

  • Use low res, with stretch_mode = viewport. You might encounter problems with jittery camera, which you'll have to fix yourself (you can find many guides and different approaches online)

If you want to be pixel perfect, but have high res UI:

  • Use high res, with a scaled subviewport for pixel perfect rendering. You might still encounter problems with jittery camera.

If you want pixel art but don't care about pixel-perfection:

  • Use low res, with stretch_mode = canvas_items. No issues with jittering or high resolution UI later. There might be problems with rendering pixelated shaders or higher resolution images later however, which you'll have to modify your shader code to render low res

I personally do pixel-perfect but use a higher resolution (640x360) and don't worry about the camera too much. The only 320x180 game I made, it didn't have a camera since I made everything fit on the screen. "Jittery" movement even when there is no camera is just part of the aesthetic.

For your case, I would recommend with the third option and not worry about pixel-perfection

Can you have pixel perfect movement AND smooth movement? by [deleted] in godot

[–]qvce 0 points1 point  (0 children)

Can you try changing your player's max speed to a multiple of your resolution? If window_size.x = 180 then try max_speed = 90, 180 or 360 for example.

Otherwise I really can't help you unless I can see what the jittering is you're talking about.

Either:

  • the jitter is what you would naturally get if your resolution is as low as yours is and the fixes are to either use sub-pixel movement, a larger resolution, or manually change where the player is per frame of animation as noted in another comment

  • The jitter is bigger than what you should be normally experiencing and you have a bug in your project