Speedy Saucer: How could you do the Maze better?

I’m wondering how you can make the collision detection of mazes better, because it’s not ideal right now. Aka after the whole collision exits.

Also the polygon tool is a little clunky/lacking.

To fix the first issue i found this thread: Speedy Saucer - Improve Collision Detection 2

But thats still using the polygon tool. The only alternative i can think of is a tilemap for a topdown mindset but for angles and curves you would need a lot more edge tiles right?
I think thats prob what I want just sounds like a lot of work and curious if anyone else has anything in mind.

I really was hoping for a lecture updating it but no luck :confused:
Also it seems like there is no Godot Category? Which is weird.

The topic you referenced is definitely the better way to do it - I did it this way as well. Manually-drawn Polygons are not the smoothest aspect of Godot, but for the purposes of this project (and the “complete beginner” expected student skill level at this point in the course), they probably are the best-suited tool for the job. Even if you were to have lots of weirdly-shaped tiles in a TileSet, the TileMap still operates with an underlying grid, which gets messy for tile placement and doesn’t really solve collision on its own in that case.

If you want a challenge, you might find that this way gives you more freedom:

  • Use something like GIMP to draw the entire maze as a single piece (to keep things simple). You can give it whatever crazy and curvy lines you want, but if you make any holes, you will need to manually create CollisionPolygons for these afterwards. Make the background transparent.
  • In a new object scene, create an Area2D and add a child Sprite2D. Set the Sprite2D’s Texture to the maze image.
  • With the Sprite2D selected, look for the contextual Sprite2D menu in the Viewport top menu. Click that and select Create CollisionPolygon2D Sibling - this will open a dialog.
  • Play with the settings (particularly Simplification) until you’re satisfied with the CollisionPolygon outline - remember to update the preview - and click Create CollisionPolygon2D.
  • As per the topic you referenced, set the CollisionPolygon’s Build Mode to Segments.
  • Save the object scene, then instance it in your level.

Keep in mind that the lower you set the simplification when generating collision shapes this way, the lower the performance will be. Probably won’t be an issue with a small project like this one, but if you do see low framerates that appear to be caused by your CollisionPolygon (ie disabling it somehow at runtime instantly makes the game faster), go back and regenerate the CollisionPolygon with a higher level of simplification, and with the aim of reducing the number of vertices.

It’s also worth mentioning that you can make maze pieces the same way, but because each of them would be separately enclosed with polygon segments, you would need to adjust your player logic to account for this.

It’s a long post, but if you don’t want to draw with the Polygon tool, this method should give you everything you need =)

Thank you, I think this is probably the best method. I think indeed going more image based maze pieces is what i’m look for.

This helped solidify the direction of thinking I’m wanting to go, thank you.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms