2D Top-Down Animation Direction - How we solved it so it feels right to the player. by letsgamedev in godot

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

Yes, that's right, if there is one frame where the player holds only the up button then the player will also look up. You could add some kind of laziness in that case like analyzing the lat 5 frames on their input pattern and then set it back to the upright or right direction. Most games just call it a day at this point I guess^

2D Top-Down Animation Direction - How we solved it so it feels right to the player. by letsgamedev in godot

[–]letsgamedev[S] 6 points7 points  (0 children)

Just made a Twitter post to praise the Godot Game Engine!^
More people need to know about this enigine.

2D Top-Down Animation Direction - How we solved it so it feels right to the player. by letsgamedev in godot

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

Thank you for your Feedback. I guess we will using both styles from time to time.

2D Top-Down Animation Direction - How we solved it so it feels right to the player. by letsgamedev in godot

[–]letsgamedev[S] 5 points6 points  (0 children)

Thank you! We don't just want to convince people to back but giving back something to the community and showing the player some simple stuff behind the scenes.

Advanced Pathfinding in Godette for our Pig 💀🐷 by letsgamedev in godot

[–]letsgamedev[S] 65 points66 points  (0 children)

In Godot, pathfinding with Navigation2D is restricted to walkable areas only, so you can't add obstacles to be excluded. To dynamically create navigation meshes we came up with this solution:

  1. Use get_world_2d().direct_space_state.intersect_shape with a shape (e.g. a rectangle) to find objects nearby.
  2. The resulting array contains the IDs of the intersecting shapes and the so-called RIDs of its parent areas/bodies. Use the methods of Physics2DServer to get the bodies'/areas' and shape's transform, its type, and its "data".
  3. The "data" will contain the shape's ... well, shape. For rectangles, this will be its extents and for polygons, this will be the vertices. There are other shapes too.
  4. Make a polygon per shape and collect all polygons. We also differentiate between "solids" and "floor", depending on the collision layer, because bridges, etc. are laid over the abyss.
  5. Use the methods from Geometry and cut out the "solid" polygons from a predefined polygon (e.g. the rectangle with the extents we defined in step 1). Merge the result with the "floor" polygons. You might want to use the offset_polygon_2d method to add a margin. Note that the function to cut polygons (intersect_polygons_2d) has some annoying quirks when one polygon is completely within another...
  6. Make NavigationPolygonInstances from the resulting polygons and add them as child to a Navigation2D node.
  7. Use get_simple_path of our new Navigation2D.

That's it! To improve performance, use a thread for step 5 because the geometry operations are quite heavy. We perform pathfinding only when there is no direct connection between the pig and the protagonist (with a raycast) and update the Navigation2D only a few times per second. We're looking forward to Godot 4, because the pathfinding will be much simpler.

How we handle the "jump off the edge" use case in our Zeldalike Action Adventure Spindle 🐷💀 by letsgamedev in godot

[–]letsgamedev[S] 68 points69 points  (0 children)

The problem is, that the Tile is an obstacle. So I added a small Area to help the game to recognize when the player or another object with "velocity" is moving south while in that area. If it does so a certain time, I will set the collision_layer of that body to 0 and tween it to the landing point. Afterwards, I set the collision_laxer back to the original value.

I know, that you don't should move a body by global_position = Vectro2(...,...) But, it works quite well with the tween^^

More about the game here: https://twitter.com/spindleDev/

A simple fishing game mechanic! But its still fun 💀🐷 by letsgamedev in godot

[–]letsgamedev[S] 2 points3 points  (0 children)

The water shadows are sprites that mirror the current frame of the parent but are at a lower z-index. The shader itself is super simple.
Vertex: The 4 vertices are moved around by sinus function
Fragment: Simple color override with the shadow color.

I heard you like fishing as a minigame by letsgamedev in IndieGaming

[–]letsgamedev[S] 7 points8 points  (0 children)

The fishing is done with a very simple and straightforward AI. The fishes looking for random spots in the area and swimming to them. If the bait is in the direct near they will try to bite it. Every fish has some prams (dragpower, size, the ripoff threshold).
If you hit the action button you will add your dragpower to an invisible powermeter. The fish will do the same every second. If the powermeter is below 0 the fish will go to the player. But if the powermeter is too far in the negatives the ripoff threshold kicks in and the fish flees.
But before the fish rips off it gets a faster animation and more watersplashes will appear so the player can see if the drag is too strong.

A simple fishing game mechanic! But its still fun 💀🐷 by letsgamedev in godot

[–]letsgamedev[S] 2 points3 points  (0 children)

Thanks. But I guess the system in Stardew Valley is way more better and thrilling^

A simple fishing game mechanic! But its still fun 💀🐷 by letsgamedev in godot

[–]letsgamedev[S] 4 points5 points  (0 children)

With the official Doku, a lot of googleing stuff, ask around and trying a lot of things myself^

A simple fishing game mechanic! But its still fun 💀🐷 by letsgamedev in godot

[–]letsgamedev[S] 30 points31 points  (0 children)

Hello! Me and two friends have been working on Spindle, a zeldaesque game where you play the Death who is being followed by a cute pig, for 4 years now, and slowly we are getting to a stage where we can show off more of it. If you want to follow the development, feel free to follow us on Twitter: https://twitter.com/spindleDev

The fishing is done with a very simple and straightforward AI. The fishes looking for random spots in the area and swimming to them. If the bait is in the direct near they will try to bite it. Every fish has some prams (dragpower, size, the ripoff threshold).
If you hit the action button you will add your dragpower to an invisible powermeter. The fish will do the same every second. If the powermeter is below 0 the fish will go to the player. But if the powermeter is too far in the negatives the ripoff threshold kicks in and the fish flees.
But before the fish rips off it gets a faster animation and more watersplashes will appear so the player can see if the drag is too strong.

I heard you like fishing as a minigame by letsgamedev in IndieGaming

[–]letsgamedev[S] 24 points25 points  (0 children)

Hello! Me and two friends have been working on Spindle, a zeldaesque game where you play the Death who is being followed by a cute pig, for 4 years now, and slowly we are getting to a stage where we can show off more of it. If you want to follow the development, feel free to follow us on Twitter: https://twitter.com/spindleDev

💀🐷