Content warning:re: Godot, bragging
In addition to all this, the entire large compound polygon is its own scene, and the main scene of the project instantiates multiple instances of that smaller scene, so now I've learnt how to make things modular in #godot by using scenes as a container for part of the entire thing. It's easy but I never had that intuition before and always did everything in one big scene, which is unnecessary when I want the same thing happening multiple times.
It's also trivial to make the polygon retain its overall shape and not drift who-knows-where over time. Just make each Marker2D a child of another Node2D that's unmoving, and wiggle the child each frame relative to the parent, not to its previous position. So it will always oscillate around one fixed point.
These things may seem extremely simple, but I learnt all this on my own, no tutorials, no Reddit threads, no forums, nothing.
I think I did a good job!
Content warning:Godot, bragging
OK, so I am learning #godot . I am a beginner, so I am mostly setting up exercises for me to do, and then trying to figure them out.
I want to share a journey of discovery that I went on, because I am proud of my reasoning. Looking this stuff up on the Internet was NO help, so I seriously think I did a good job slowly puzzling it out!
* The basic idea is simple. A big, complex polygon is on screen, and every point in the polygon wiggles randomly every frame, while keeping the polygon intact. Seems straightforward enough!
* So I add a script to the polygon, every frame it picks a random integer within the range that is the size of the polygon's point array. It picks a float within a random range centering on zero twice, and adds the respective numbers to the x and y parametres of the Vector2 of the point in the polygon corresponding to that number. Easy! Except it did nothing.
* After some thinking, I figured it out. I can't directly change one item in a packed array. I have to create a second array from it that has the point modified, then set the "polygon" property of the polygon to that new array. Presto! It worked. But now after a while the polygon would start flickering on and off and eventually disappear. What gives?
* This time I figured it out much quicker. If the points in the polygon cross over wrong, it's an invalid polygon so it doesn't render. The solution was a bit tedious but easy enough. Have a bunch od Node2D objects (specifically Marker2D to make editing easier) at each point of the polygon, make *those* Node2D wiggle programmatically, and then have a bunch of triangles whose corners update to the x,y coordinates of a selected Node2D. That will make those triangles follow the shape of the wiggling points in space, and the overall polygon will retain its shape. And you can't have a malformed polygon with only three points no matter where they randomly end up.
* So I did that. I added three Node2D variables to each little polygon's script that were exposed to the editor, I put the proper values for those three, and the script would adjust the x, y of points 0,1,2 in the polygon array every frame. Once again a bit tedious to input those as there were like 30 triangles. But straightforward enough. And of course, it didn't work. There were a bunch of triangles wiggling on screen but they were all in wrong places. And they didn't touch each other.
* I spent a little time annoyed, then tried to work through this logically. Clearly the position of the polygons updates, but it updates wrong. But how to check what is actually happening incorrectly? I gave three of the Marked2D objects a small child polygon each, to mark visually where they were. Checked and, sure enough, the three points and the corresponding triangle had the same shape. They were just not in the same position. Progress!
* Next step, I removed the part of the scripts that wiggled the markers, just left in the part that moves the points of the little triangle polygons to the right place. They didn't touch each other. So even though they were updated on runtime, the ones corresponding to some of the same markers still ended up in different spots? Hmm.
* Then it hit me. The x,y of the individual points are relative to the polygon's position, not global positions. I set the positions of all little polygons to 0,0 and yes, it worked! Except the shape was squashed.
* After some experimenting, I figured out that the polygon shapes had scales set to something else than 1,1. Changing that for all of them worked!
I learnt SO much about testing things and debugging today!
How do the Kitty Corps get to the Evil Capitalist AI Robot facilities in order to forcibly redistribute their wealth? And where do they store the goods??
Well, they use public transit of course!
Corporal Button's latest experiment in strapping rockets to things that really shouldn't have rockets strapped to them, the Kitty Corps Mobile Command Tram will get you to the facilities in no time, while storing all the goodies you collect on your run! 🐈
#gamedev #indiedev #godot #kitty #indiegame
I love it when I have a question, and then the documentation answers it for me.

Content warning:gamedev
Learning #godot . I managed to write a script that makes vectors in a polygon wiggle randomly.
It's completely useless for anything I'm making, but I'm learning how to set up simple stuff in order to remind myself how things work in Godot.
So that was a tiny victory!
Let's investigate day #392 of #Godot games using #GodotSteam! Today is Cultprits by Yuggothian Aubergines! Search for clues with friends or foes in this multiplayer game about stopping an Eldritch God. Also has an incredible art style too. Go wishlist it now!
https://store.steampowered.com/app/3348260/Cultprits/
https://github.com/Paragrimm/GDKata
Since nobody cared: I polished it a bit and made it open source. I think it's a nice resource to #learn #godot and #gdscript via code #kata. Feel free to add further Katas :). Also make sure to read the disclaimer as I've used AI for the finishing touch to save time.
Content warning:Godot question, Boost please
How do you change a node in a Polygon2D at runtime, in #godot ?
I added this script to my Polygon2D but it doesn't seem to do anything:
func _process(delta):
var temp_point := Vector2(700,700)
polygon.set(7,temp_point)
pass
(ignore that it's at _process and does it every frame. I am testing a thing out. And a good thing too, because the test clearly didn't work. Nothing happens.)
🦾 Godot 4.6 Release: It's all about your flow
https://godotengine.org/releases/4.6/
Is there anything in GDScript that converts a type name to a string of that type name? I generally really dislike string errors BC they are tricky to debug, so if I can avoid them I would!
#Godot #GodotEngine
I released this Godot transition shader for free today. It's based on gradient textures so literally any direction, any shape and any pattern is possible!
Link: https://binbun3d.itch.io/godot-modular-transitions
#godot #GodotEngine #shader #gamedev #gameart
Getting started on my localization CSV now, because it would be hell to implement later. Thankfully Godot seems to make localization relatively painless (said the person who has never tried to implement it before).
#godot #indiedev #rpg #roguelike
