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

Draft setup for persistent tree groups #6097

Draft
wants to merge 1 commit into
base: deploy/fafdevelop
Choose a base branch
from

Conversation

Garanas
Copy link
Member

@Garanas Garanas commented Apr 19, 2024

Description of the proposed changes

This is based on a suggestion of @clyfordv where when a tree group breaks (because of a collision, damage, etc) we do not delete the group and instead spawn in individual trees that are not reclaimable. That way we can still reclaim the tree group as a whole, and instead reduce the mass value as individual trees are destroyed.

Testing done on the proposed changes

Additional context

Ran into a strange bug where I am unable to change the mesh of a tree group after creating it.

When the tree group 'breaks' we want to hide the mesh of the tree group itself. This allows the individual trees to take over, which in turn allows for interactions with units and damage.

Attempts:

  • (1) Hide the mesh - this is not possible. Units are able to do this, but those are unit-specific functions.
  • (2) Scale the mesh to 0 - this is not possible. The rendering bounding box appears to be used to determine if we're hovering over a tree (group). As a result if we reduce the scale to 0 then the tree group becomes unclickable.
  • (3) Change the mesh - this appears to be buggy and is where I am now. I can change the mesh to a version with a shader that doesn't render any pixels on screen but only in the tick the prop is created. When I try it at a later moment it simply does not work and the game does not tell me why. I suspect it may be because of batching of the props, but then why does it work for individual trees as they take (fire) damage?

Checklist

  • Changes are annotated, including comments where useful
  • Changes are documented in the changelog for the next game version

@Garanas
Copy link
Member Author

Garanas commented Apr 19, 2024

@Hdt80bro any idea why the mesh change no longer works 1 tick after creating a tree group?

@clyfordv
Copy link
Contributor

What if instead of hiding the mesh you just spawn an additional prop with the invisible shader? So parent tree group goes away, new invisible reclaim entity appears from the break.

@Garanas
Copy link
Member Author

Garanas commented Apr 19, 2024

Because you'd lose the reclaim order on the original tree group when we do that. The nice part about this solution is that you would not lose that order 😃 !

@clyfordv
Copy link
Contributor

Okay what about the reverse--the tree group is always an invisible, but has a submesh/entity/something(?) that gets resized when it breaks (so the parent bounding box remains for clickability). Does that require an additional dummy parent entity?

@Garanas
Copy link
Member Author

Garanas commented Apr 19, 2024

I just tried that suggestion; I can't get it to work reliable. I just don't know how the engine determines what is and is not clickable and what the preferences are

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.

None yet

2 participants