Cataclysmanic / GO2022

4 stars 1 forks source link

Auto-Generate navmesh from alpha channel on walls sprite. #37

Closed plexsoup closed 1 year ago

plexsoup commented 1 year ago

In Building.gd, We have a list of occlusion polygons for static objects and light occluders.

We should be able to Make a big polygon rectangle encompassing the entire map, then use boolean clip operations to remove the occlusion polygons from it.

See: https://github.com/godotengine/godot/pull/28987

plexsoup commented 1 year ago

This might be easier than I thought. Just append "outlines" to a polygon 2d and it will make the cutouts automatically.

https://youtu.be/uzqRjEoBcTI

https://docs.godotengine.org/en/stable/classes/class_navigationpolygon.html#class-navigationpolygon-method-add-outline

plexsoup commented 1 year ago

We have working manual nav polygon instances. They work fine for the prototype. We'll have to manually update them, but I don't see us changing the map much, so this is probably acceptable.

plexsoup commented 1 year ago

Implemented in https://github.com/Cataclysmanic/GO2022/commit/ab5046461d38586311991514062245b225e31d11