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

Projectile smooth movement #72

Merged
merged 3 commits into from
Feb 5, 2024

Conversation

Doubleumc
Copy link
Contributor

About the pull request

Changes the projectile's visual position to animate() across its projected path, providing smoother visuals, especially at higher client framerates.

Bresenham
Black squares: tiles actually traversed by the projectile object
Red line: visual path taken by the projectile
Purple marks: equidistant marks corresponding to number of traversed tiles (black squares)
Blue marks: closest points to center of traversed tiles (black squares)

The projectile's physical path (black squares) is unchanged. The system calculates how far along the physical path the projectile has travelled, draws a line from the start point to the end point (red line), then interpolates where along that line corresponds to that distance travelled (purple marks). This is slightly less accurate to the projectile's physical position than the closest point of the line (blue marks), but this slight potential offset is preferred for its smoother visuals.

This does not touch any code that actually effects the bullet's trajectory, this is purely cosmetic.

Tested:

  • handheld guns
  • scatter
  • in-turf targeting (as visually consistent as the current implementation, at least)
  • rockets
  • plasma caster
  • xeno spit

@morrowwolf : this is PR'd upstream, should be safe to testmerge though

Explain why it's good for the game

Smoother apparent movement for projectiles gives a more appealing look.

Testing Photographs and Procedure

Screenshots & Videos

https://streamable.com/h6esir

Changelog

🆑
code: projectiles smoothly animate their movement
/:cl:

@Doubleumc Doubleumc changed the title initial Projectile smooth movement Nov 21, 2023
@morrowwolf morrowwolf added PR'd upstream needs tested testmerge this to see what breaks labels Nov 21, 2023
@morrowwolf
Copy link
Member

Seems fine from testing, just waiting til upstream merges

code as it was when merged upstream
@Doubleumc Doubleumc reopened this Feb 1, 2024
@morrowwolf morrowwolf removed PR'd upstream needs tested testmerge this to see what breaks labels Feb 5, 2024
@morrowwolf morrowwolf merged commit 4cbc17e into cmss13-devs:master Feb 5, 2024
36 of 39 checks passed
@Doubleumc Doubleumc deleted the projectile-smooth-movement branch February 11, 2024 01:38
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

Successfully merging this pull request may close these issues.

2 participants