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

Portals - Autoplacing static objects and further work #50482

Merged
merged 2 commits into from
Jul 20, 2021

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented Jul 15, 2021

In order to make level building easier, the system can now support STATIC and DYNAMIC objects in the roomlist that are not placed in rooms. The system will automatically place them in the appropriate room.

  • Lifts restrictions now allowing the RoomManager to be the roomlist.
  • Fixes a couple of bugs which could occur if the user attempted to link Portals to Rooms that were outside the roomlist.
  • Adds a PortalEditorPlugin allowing you to flip individual portals.
  • Add support for MultiMeshInstance in calculating room bound.

Notes

  • This should prove a lot easier to use for users. Instead of placing all objects within each room, they only need to make sure the Room bound is defined (either by placing walls and floor in the room, or manual bound), and that Portals are placed in the Room. Other objects can be placed freely within the roomlist (not in rooms) and they will be autoplaced during conversion.
  • Autoplacing does not change their position in the scene tree, it just changes how they are structured in the portal renderer.
  • Autoplaced nodes cannot affect the room bounds (hence why you need to place walls etc explicitly in the room if you are deriving the bound from the geometry)
  • It should work in most cases and uses the AABB centre to determine which room to put in
  • It is not guaranteed to work with internal rooms. It will attempt to choose the highest priority internal rooms and will work in 95% of cases, but there are some special cases for large objects that sprawl outside internal rooms (see the portal instructions) and these should be placed manually in the rooms in the scene tree rather than relying on autoplace.
  • At the moment autoplaced objects will not be merged (static batching) if you have that option selected. I may be able to get this to work in a later PR.

@lawnjelly lawnjelly requested a review from a team as a code owner July 15, 2021 13:52
@lawnjelly lawnjelly force-pushed the portals_autoplace branch from 1165988 to 8b0b5a8 Compare July 15, 2021 13:56
@Calinou Calinou added this to the 3.4 milestone Jul 15, 2021
@lawnjelly lawnjelly force-pushed the portals_autoplace branch from 8b0b5a8 to 0fe6ecb Compare July 16, 2021 08:16
@lawnjelly lawnjelly changed the title Portals - Add the ability to autoplace static objects Portals - Autoplacing static objects and further work Jul 16, 2021
@lawnjelly lawnjelly force-pushed the portals_autoplace branch 2 times, most recently from 3692020 to 71f5bf1 Compare July 16, 2021 10:53
In order to make level building easier, the system can now support STATIC and DYNAMIC objects in the roomlist that are not placed in rooms. The system will automatically place them in the appropriate room.
Allows users to have the RoomManager as the roomlist.

Fixes a couple of bugs dealing with situations where users attempt to link Portals to Rooms outside the roomlist.

Adds a PortalEditorPlugin allowing you to flip individual portals.
@lawnjelly lawnjelly force-pushed the portals_autoplace branch from 71f5bf1 to 83f1377 Compare July 20, 2021 18:05
@akien-mga akien-mga merged commit 843ab4e into godotengine:3.x Jul 20, 2021
@akien-mga
Copy link
Member

Thanks!

@lawnjelly lawnjelly deleted the portals_autoplace branch July 22, 2021 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants