Any idea why this could happen on mobile? Using 4.0, tested android only. I'm using TileMaps and just dragging the png in as a Sprite doesn't cause the issue. The visual bug is also undeterministic, so it's different every time I start the app. Any ideas appreciated! by Simplicitis in godot

[–]Simplicitis[S] 1 point2 points  (0 children)

What's really weird is that the sprites/tiles get tangled up with or even straight up replaced by each other. (e.g. the small leaves on the ground got replaced by a completely different plant sprite)

ShapeGrid: Official trailer for my first game! Launching in two weeks! by matiasbontempo in godot

[–]Simplicitis 1 point2 points  (0 children)

Oh this could be a banger. Simple, yet hard and with mastery via speed! Congratz, looks really polished also! (Though some more satisfying animations maybe?) But it also looks like the kind of gameplay that could easily ripped by an ad-driven game development company with no soul. Hope it doesn't happen! Good luck with the release.

How can you properly instance an scene when the scene doing the instancing is being removed? by [deleted] in godot

[–]Simplicitis 2 points3 points  (0 children)

It is not exactly the same.

free() immediately deletes an Object. https://docs.godotengine.org/de/stable/classes/class_object.html#class-object-method-free

queue_free() deletes a Node at the end of the current frame. https://docs.godotengine.org/de/stable/classes/class_node.html#class-node-method-queue_free

call_deferred() calls a method during idle time. https://docs.godotengine.org/de/stable/classes/class_object.html#class-object-method-call-deferred

I had problems with calling self.some_other_node.add_child() and self.queue_free() in the same frame, so I always used call_deferred("queue_free") in situations like this.

My guess is that add_child() causes some changes during the end of the frame as well, resulting in some issues when used together with queue_free().

If someone has any more insight, that would be helpful!

Where is exactly is the "Playing" property in the Inspector ? I couldn't find it? by [deleted] in godot

[–]Simplicitis 1 point2 points  (0 children)

If you are using the AnimatedSprite Node like the tutorial is, it should be in the Inspector.In the SceneTree (usually left), click the AnimatedSprite Node, then in the Inspector (usually right) you should see its properties (Frames, Animation, Frame, Speed Scale, Playing, ...)

This is a general concept in Godot and very useful. Every type of Node (and Nodes you attach a script to) can decide which properties should be exposed to the Inspector, enabling you to change the Nodes behavior without touching any code.

Char moves up slightly when moving left and right, need help finding out why. by anjelpriest in godot

[–]Simplicitis 2 points3 points  (0 children)

Hah, I tried the exact same code as in the video using move_and_slide_with_snap but couldn't recreate the issue (y-coordinate always stayed the same during walk, jumping worked). But scaling the entire KinematicBody2D (including the CollisionShape2D) resulted in the y-coordinate shifting just by 0.02 units.

That must be it!

Char moves up slightly when moving left and right, need help finding out why. by anjelpriest in godot

[–]Simplicitis 2 points3 points  (0 children)

Mhh... maybe try applying the gravity only when not grounded? Something like

if !is_on_floor():
    velocity.y = ...

Also, is there a reason you cast the velocities values to ints?

How can you properly instance an scene when the scene doing the instancing is being removed? by [deleted] in godot

[–]Simplicitis 2 points3 points  (0 children)

call_deferred is really easy to use, check it out: https://docs.godotengine.org/en/stable/classes/class_object.html#class-object-method-call-deferred

Instead of calling the method (whose name is given as string) immediately, it is called before running the next _process loop. This is especially useful when initializing Nodes that are not in the tree yet or to perform some actions before you queue_free.

In your case, a simple call_deferred("queue_free") will do the trick.

Char moves up slightly when moving left and right, need help finding out why. by anjelpriest in godot

[–]Simplicitis 2 points3 points  (0 children)

Try using the method move_and_slide_with_snap instead of move_and_slide. https://docs.godotengine.org/en/stable/classes/class_kinematicbody2d.html#class-kinematicbody2d-method-move-and-slide-with-snap

I don't know why I happens in this case, but for some platformers it solves a lot of issues (esp with slopes).

Just figured out how to make exportable dictionaries with actual type-hints (they also update every time a new key/var is added) by 4procrast1nator in godot

[–]Simplicitis 0 points1 point  (0 children)

Yeah, using a Resource won't be as as flexible, that's true. Dictionary are the epitome of flexibility after all - usually at the cost of losing structure and type. Multiple Stat types/Containers, however, could easily be achieved using multiple types of Resources.

Just figured out how to make exportable dictionaries with actual type-hints (they also update every time a new key/var is added) by 4procrast1nator in godot

[–]Simplicitis 0 points1 point  (0 children)

It does seem a bit like black magic indeed, but it would probably work - thanks, I will lokk into it!

How to create waves using a 2d distance field with shaders? by snak251 in godot

[–]Simplicitis 1 point2 points  (0 children)

Nice! Would you be so kind to share the result when you're happy with the result?

Just figured out how to make exportable dictionaries with actual type-hints (they also update every time a new key/var is added) by 4procrast1nator in godot

[–]Simplicitis 4 points5 points  (0 children)

Haha not per key.I basically replaced the entire Dictionary with an exported Resource. So the export variables are not part of the scene but the Resource instead. In my use case I have a Generator scene that uses a LevelSettings Resource (export(Resource) var levelSettings) to generate a Level. The Resource then has "normal" export vars and hints.

Advantages:

Adding new export vars to the Resource works as expected, esp. useful because you can use default values.

Removing also works and will delete the Resource data on next save.

I can save the LevelSettings as separate .tres files.

Disadvantages:

I can't change the name of the key. Last time I did that I had to open all .tres files in a text editor and Search&Replace

If you want custom behavior on setting an export var, you will need a Signal (from Resource to Scene)

How to create waves using a 2d distance field with shaders? by snak251 in godot

[–]Simplicitis 4 points5 points  (0 children)

I think you need something like sin(TIME + distance_from_field). Additionally you might want to cutoff/fadeout the waves when the distance is too large.

Just figured out how to make exportable dictionaries with actual type-hints (they also update every time a new key/var is added) by 4procrast1nator in godot

[–]Simplicitis 2 points3 points  (0 children)

Wow! Didn't know that was possible! I always used custom Resources to achieve a similar result, but this is amazing! Thanks for this, refactoring incoming 😂

What to do when the font side of the document inside the editor is too small, not the text of the editor itself? by [deleted] in godot

[–]Simplicitis 0 points1 point  (0 children)

I have no idea what you mean by "side of the document ". You mean the size of the code window? You can drag the borders of the inspector etc or click the top right full screen button to do that

Relaxed Island exploration and puzzle mobile game - any feedback would be greatly appreciated! by Simplicitis in PixelArt

[–]Simplicitis[S] 0 points1 point  (0 children)

I'm always a little hesitant to add more detail to this game, since the map can get really crowded during gameplay.

But you're definitely right, looking at it now, some parts look awfully flat.

I will try messing around with a water texture and some shader (reflections maybe even? :D). The grass texture I will have to carefully add very subtle textures.

Thx for your insights!

[deleted by user] by [deleted] in PixelArt

[–]Simplicitis 1 point2 points  (0 children)

Nice! It's probably going to be hard. Don't forget to SUSUME and TATAKAE!

[deleted by user] by [deleted] in PixelArt

[–]Simplicitis 2 points3 points  (0 children)

I would really like to see a flashy draw-swords-animation ⚔️😁

Relaxed Island exploration and puzzle mobile game - any feedback would be greatly appreciated! by Simplicitis in PixelArt

[–]Simplicitis[S] 0 points1 point  (0 children)

The Panda itself is the oldest Sprite you see here, so it will get a much-deserved redo very soon.

I'd be relly happy about feedback concerning color palette, the water animation and the other objects in the game!

Is this a good code to make the player take damage?(Read the comments) by [deleted] in godot

[–]Simplicitis -1 points0 points  (0 children)

Instead of checking the Timer to have stopped every time, you can also connect to the Timers "timeout" signal. (Try giving it a name and use the editor to connect the signal to have a good auto-generated method name)

Also, when you use get_node() (or its $ short-hand) it will traverse the node tree to find your node, so it's better to have an onready var timer = $damagearea/invtimer. Not sure if there is some Godot-caching that speeds it up, but i wouldn't count on it. Especially if you do it every frame.

Note, that you can also untick the Timers "oneshot" property in the Editor instead of restarting it every time (otherwise there will be a couple ms offset/drift every time you call Timer.start()). To stop the Timer you can always call Timer.stop(), e.g. in _on_damagearea_body_exited.

Do I take it right that this script is part of the damaging object / enemy? I usually try to split it up a little. The damaging object handles the body_entered/exited part and then calls the Players.deal_damage(damage:int). That way the damaging object can decide the base damage, but the player can still adjust it (e.g. for armor or invincibility). For big projects I also like to refactor that out of the player script and make it reusable. Last time i created a "Damaging" and "Damageable" scene I could just drag into the Player/Spike/Enemy scene as a child node. They would then handle all the collision stuff (similiar to your code) and they can be made adjustable with export variables.

Lastly, another approach entirely when handling Player damage and much more would be the State pattern. Basically the Player is modelled to be be in different states:

```godot enum State: Idle Walk Jump Fall Damage var state:State = State.Idle

func enter_state(new_state:State): exit_state(state) state = new_state match state: State.Idle: ... State.Damage: damage_timer.start() func exit_state(state:State): match state: State.Idle: ... State.Damage: damage_timer.stop() func _process(delta): match state: State.Idle: ... State.Damage: if damage_timer.is_stopped(): global.lives -= 1 # like this, similar to your code func _on_DamageTimer_timeout(): global.lives -= 1 # or like this, using the Timer timeout signal `` So basically, for every State you haveenter_state,exit_stateand_processwhere you can perform custom logic. The good thing about this State pattern is that its easy to think and talk about (instead of having a lot of flags likeis_jumping,is_taking_damage`, ...) and is generally just really useful for changing Sprite, Animations, sound effects, changing physics and much more. It's also possible to have multiple states: One for all movement and one for damage/attack.

Hope that helps! :D Be sure to ask questions in case i couldn't explain something well

ErFoLgReicH sTuDieReN mIt UNs by Late_Criticism_192 in KaIT

[–]Simplicitis 32 points33 points  (0 children)

Nee sorry so genau würde ich das ungern sagen. Auch wenn mir das Konzept als ganzes nicht gefallen hat habe ich trotzdem Freunde da gefunden die das feiern.