-
Notifications
You must be signed in to change notification settings - Fork 362
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 refactoring: fixes, docs, enhancements #2295
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- projectile related code has been refactored, documented and commented. - renamed variables to follow current Intersect's naming conventions. - fixed variable typos. - removed unused variables, libraries and imports. - a lot of methods have been merged into one (GetProjectileOffset, GetRange, FindProjectileRotation) for better organization. - created AdjustPositionOnMapBoundaries methods for better organization within CheckForCollision (server and client) - Suppress finalization to optimize garbage collection on projectile disposal (client), this is important for performance and to prevent the finalizer from running. - fixes server crash due to IndexOutOfRangeException when attacking across maps. - fixes projectiles not crossing map boundaries when stepping into more than one boundary (ie. diagonal crossing maps). - fixes server crash due to Z Dimension and Z block level issues with projectiles. - fixes projectile issues when stepping into Z block attributes, now they are destroyed when they are supposed to. - Linear interpolation improvements (client): we had time as a constant, this caused the two problems: non linear movement and the object not actually reaching the target position visually, so now, linear interpolation is dinamically based on the elapsed time since the projectile was spawned. Also, The interpolation factor is now clamped to ensure that the projectile does not overshoot its target position. - GetProjectileLerping considers Options.Instance.Processing.ProjectileUpdateInterval in order to visually adjust projectiles according to the server update intervals - Pattern Matching Enhancements: specifically the use of the switch expression with pattern matching introduced in C# 8.0 and enhanced in later versions. The use of the or keyword to combine multiple patterns in a single case is a feature of these enhancements, allowing for more concise and readable code when checking for multiple conditions. (GetRange, FindProjectileRotation.
Arufonsu
added
enhancement
Minor feature addition or quality of life change
chore
Cleans up code, documentation or project structure without altering functionality
performance
Performance optimization
bug fix
Pull request that fixes a bug
labels
Jun 30, 2024
1 task
WeylonSantana
requested changes
Jul 1, 2024
Arufonsu
force-pushed
the
refactoring/projectiles-june-2024
branch
from
July 2, 2024 22:14
80ce56f
to
bc76e88
Compare
WeylonSantana
approved these changes
Jul 3, 2024
Thanks to @WeylonSantana for reviewing, we ended up with a very clean and organized PR 🎊 |
cydyn
pushed a commit
to cydyn/Intersect-Engine
that referenced
this pull request
Jul 3, 2024
) * projectile refactoring: fixes, docs, enhancements - projectile related code has been refactored, documented and commented. - renamed variables to follow current Intersect's naming conventions. - fixed variable typos. - removed unused variables, libraries and imports. - a lot of methods have been merged into one (GetProjectileOffset, GetRange, FindProjectileRotation) for better organization. - created AdjustPositionOnMapBoundaries methods for better organization within CheckForCollision (server and client) - Suppress finalization to optimize garbage collection on projectile disposal (client), this is important for performance and to prevent the finalizer from running. - fixes server crash due to IndexOutOfRangeException when attacking across maps. - fixes projectiles not crossing map boundaries when stepping into more than one boundary (ie. diagonal crossing maps). - fixes server crash due to Z Dimension and Z block level issues with projectiles. - fixes projectile issues when stepping into Z block attributes, now they are destroyed when they are supposed to. - Linear interpolation improvements (client): we had time as a constant, this caused the two problems: non linear movement and the object not actually reaching the target position visually, so now, linear interpolation is dinamically based on the elapsed time since the projectile was spawned. Also, The interpolation factor is now clamped to ensure that the projectile does not overshoot its target position. - GetProjectileLerping considers Options.Instance.Processing.ProjectileUpdateInterval in order to visually adjust projectiles according to the server update intervals - Pattern Matching Enhancements: specifically the use of the switch expression with pattern matching introduced in C# 8.0 and enhanced in later versions. The use of the or keyword to combine multiple patterns in a single case is a feature of these enhancements, allowing for more concise and readable code when checking for multiple conditions. (GetRange, FindProjectileRotation. * weylon's review (I)
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug fix
Pull request that fixes a bug
chore
Cleans up code, documentation or project structure without altering functionality
enhancement
Minor feature addition or quality of life change
performance
Performance optimization
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Preview
(projectiles across maps - diagonally - map edges - fixes #2287)
1.mp4
(fixes #2287)
2.1.mp4
(ZD block levels fixed for projectiles, they are actually destroyed when they should now - also doesn't crashes the server with homing nor direct projectiles anymore)
3.mp4
(Linear interpolation visual improvements)
4.mp4