Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
plexsoup opened this issue Nov 10, 2022 · 3 comments
Closed

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

plexsoup opened this issue Nov 10, 2022 · 3 comments
Labels
minor minor or trivial issues. fix them if its convenient someday maybe Nice to have, but not very important.

Comments

@plexsoup
Copy link
Collaborator

plexsoup commented Nov 10, 2022

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: godotengine/godot#28987

  • Geometry.clip_polygons_2d(poly_a, poly_b) # difference
@plexsoup
Copy link
Collaborator Author

plexsoup commented Nov 10, 2022

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 plexsoup added the someday maybe Nice to have, but not very important. label Nov 10, 2022
@plexsoup
Copy link
Collaborator Author

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 plexsoup added the minor minor or trivial issues. fix them if its convenient label Nov 10, 2022
@plexsoup plexsoup changed the title Generate a navmesh so we can use navigation server 2d for NPC behaviour Generate a dynamic navmesh from alpha channel on walls sprite. Nov 11, 2022
@plexsoup plexsoup changed the title Generate a dynamic navmesh from alpha channel on walls sprite. Auto-Generate navmesh from alpha channel on walls sprite. Nov 11, 2022
@plexsoup
Copy link
Collaborator Author

plexsoup commented Nov 12, 2022

Implemented in ab50464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor minor or trivial issues. fix them if its convenient someday maybe Nice to have, but not very important.
Projects
None yet
Development

No branches or pull requests

1 participant