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

Smoother piece attachment visuals (and even physical locations?) #1898

Open
GoogleFrog opened this issue Jan 14, 2025 · 3 comments
Open

Smoother piece attachment visuals (and even physical locations?) #1898

GoogleFrog opened this issue Jan 14, 2025 · 3 comments

Comments

@GoogleFrog
Copy link
Collaborator

GoogleFrog commented Jan 14, 2025

Moving_storage

The units in that gif are carrying structures via Spring.AttachUnit. They visibly lag quite a distance behind the underlying pieces, as the arms of the units move left and right as they walk. It would be a great improvement for modular unit games, or things such as big ship with constructable hardpoints, if units were a bit better at updating their position to the underlying pieces. I'm aware that things like frame interpolation are likely to make the problem not entirely solvable, but perhaps there is something cheap to try that would still be a noticeable improvement.

@saurtron
Copy link
Collaborator

Do you mean Spring.UnitAttach?

Also, if you could provide some explanation about how to replicate that, would be great. Like, if it's something z-k does, what's the fastest way to do it (what units to /give for example).

@Beherith
Copy link
Contributor

Give a hat to the enemy team
/give cor_hat_viking 1
Capture the hat with your commander :D
Watch it bob.

@lhog
Copy link
Collaborator

lhog commented Jan 18, 2025

This is going to be complicated to do right.

Ideally we want to:

  1. Run unit scripts for normal units and transporters
  2. Run the transporter -> transportees subordination logic to put transportees into the right position and orientation
  3. Run unit scripts for transportees

Now since Lua unit scripting is controlled solely by Lua and can generally be executed from many different callins, I just don't see how we can line it all up to match the flow above.

What we perhaps can try to do is to run parts of CUnit::UpdateTransportees() code after the animation is played for the current frame, while it will fix bobbing, it's still a hack as transportees' unit scripts will receive wrong input about the object orientation.

@GoogleFrog send instructions how to reproduce Warrior + Storage attachment, BAR's hats bobbing is harder to track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants