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

Cleanup ExecutionSystem #24382

Merged
merged 30 commits into from
Feb 25, 2024

Conversation

nikthechampiongr
Copy link
Contributor

@nikthechampiongr nikthechampiongr commented Jan 21, 2024

Resolves #24180

About the PR

This prs cleans up the ExecutionSystem.

Additionally it has the following differences functionally from the current one:

  • No doafter modifier based on swing speed on melee weapons.
  • Laser weapons can currently not execute due to a limitation in the gunsystem that may be fixed at a later time.(Maybe in this pr if I have time tomorrow).

Why / Balance

On the no extra damage modifier, I do not think that melee weapons should get a doafter modifier considering in an execution they will do 9 times damage. This can be altered back to its original condition if needed.

Technical details

  • The system was moved to Shared and as much as possible is now predicted.

  • Some functions were generalized or removed to reduce duplication.

  • All gun code is gone. It now just listen to some events made by the gun system.

  • All melee code gone. It now just listens to an event made by the melee system.

  • The ExecutionComponent is now added to all weapons that can execute. Using it you can modify values for the doafter, damage modifier, and the many different messages that may be shown on executions.

  • Swords got a base type as to not put the component on every single sword individually.

  • The ActiveExecutionComponent is added to guns just before they fire and removed right after in order to display the correct messages if the gun fires and to adjust the projectile if the person is shooting themselves so it can collide with them. Similar use for melee weapons.

  • The ExecutionProjectileComponent is added to projectiles as they fire. This is later used to make sure that people in the way of an execution don't get 9 times damage as well as to make sure that a clumsy clown shooting their foot doesn't either.

Note on strange thing: In order for me to get shooting yourself to work properly, I create fake coordinates that are slightly offset from the person. This is because otherwise we would be trying to shoot a projectile to its own positions which doesn't work.

Media

  • I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Breaking changes

Changelog

no cl no fun.

… ActiveExecution Component.

Transferred the Execution system into shared. Heavily re-wrote the system in order to reduce duplication,
and remove gun code from the system.
The melee weapon modifier which was dependant on swing rate was removed.

The ActiveExecutionComponent was created in order to apply the damage modifier to the shot from a gun execution.
It is added just before the gun fires and removed after an attempt is made.
The execution completed text will now only show up if the gun fires.

The client also no longer crashes because I forgot to network the component.
Currently the gun system does not have a way to alter hitscan damage like it does with projectiles.
This reverts commit a46da64.
Everything about the shot goes through the gun system now.
The Damage multiplier is only applied when a projectile impacts the target so people that get in the way don't get hit
with 9 times damage for no reason.

In order to make suicides work I needed to create fake EntityCoordinates because the gun system and the projectile
system do not play well with a projectile that has the same start and end position.
The OnAmmoShotEvent is only raised on the server.
@nikthechampiongr nikthechampiongr marked this pull request as draft January 21, 2024 23:32
Addressed reviews on overriding messages.
Now I actually mark doafters as handled.
Return normal cooldown to some meleeweapons I forgot on the previous commit.
@nikthechampiongr nikthechampiongr marked this pull request as ready for review January 21, 2024 23:56
Copy link
Contributor

@metalgearsloth metalgearsloth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still seems to double suicide a fair bit so we have 2 systems to maintain doing identical things.

Remove duplication
@nikthechampiongr
Copy link
Contributor Author

This still seems to double suicide a fair bit so we have 2 systems to maintain doing identical things.

I'll check tomorrow if it can even be integrated into the SuicideSystem.

@nikthechampiongr nikthechampiongr marked this pull request as draft January 22, 2024 00:48
@nikthechampiongr nikthechampiongr marked this pull request as ready for review January 23, 2024 00:21
@github-actions github-actions bot added the S: Needs Review Status: Requires additional reviews before being fully accepted label Jan 23, 2024
@metalgearsloth
Copy link
Contributor

Gonna suss this one out over the weekend sorry on the delay.

@nikthechampiongr
Copy link
Contributor Author

Gonna suss this one out over the weekend sorry on the delay.

All good thanks. If you know how I could get around the hack of having to create fake entity coordinated to use the gun system for shooting yourself that'd be amazing.

@github-actions github-actions bot added the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Feb 25, 2024
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

# Conflicts:
#	Content.Shared/Projectiles/SharedProjectileSystem.cs
@github-actions github-actions bot removed the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Feb 25, 2024
@metalgearsloth metalgearsloth enabled auto-merge (squash) February 25, 2024 11:07
@metalgearsloth metalgearsloth merged commit bcbe2ec into space-wizards:master Feb 25, 2024
9 checks passed
metalgearsloth added a commit to metalgearsloth/space-station-14 that referenced this pull request Feb 25, 2024
metalgearsloth added a commit that referenced this pull request Feb 25, 2024
* Revert "Cleanup ExecutionSystem (#24382)"

This reverts commit bcbe2ec.

* Revert "Executions (#24150)"

This reverts commit 2e83f5a.

# Conflicts:
#	Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs
@Scribbles0 Scribbles0 mentioned this pull request Jul 16, 2024
1 task
Erisfiregamer1 pushed a commit to The-Arcadis-Team/arc-station-14 that referenced this pull request Jan 9, 2025
* Creat Execution Component and add to sharp items

* Kill Server ExecutionSystem. Create ExecutionSystem in shared. Create ActiveExecution Component.
Transferred the Execution system into shared. Heavily re-wrote the system in order to reduce duplication,
and remove gun code from the system.
The melee weapon modifier which was dependant on swing rate was removed.

The ActiveExecutionComponent was created in order to apply the damage modifier to the shot from a gun execution.
It is added just before the gun fires and removed after an attempt is made.

* Fix bugs

The execution completed text will now only show up if the gun fires.

The client also no longer crashes because I forgot to network the component.

* Remove clumsy text

* Make BaseSword abstract

* Add ExecutionComponent to every weapon

* Fix bug

* Remove execution comp from battery weapons

Currently the gun system does not have a way to alter hitscan damage like it does with projectiles.

* Cleanup

* Revert "Remove clumsy text"

This reverts commit a46da64.

* Actually fix the ExecutionSystem

Everything about the shot goes through the gun system now.
The Damage multiplier is only applied when a projectile impacts the target so people that get in the way don't get hit
with 9 times damage for no reason.

In order to make suicides work I needed to create fake EntityCoordinates because the gun system and the projectile
system do not play well with a projectile that has the same start and end position.

* Make launchers able to execute

* Fix prediction bug

The OnAmmoShotEvent is only raised on the server.

* Readd ability for clowns to accidentally shoot themselves while executing

* Cleanup

* Reset melee cooldown to initial value

* Address reviews fix bug

Addressed reviews on overriding messages.
Now I actually mark doafters as handled.
Return normal cooldown to some meleeweapons I forgot on the previous commit.

* Address Reviews

Remove duplication

* Exorcise codebase

Remove evil null coercion that I was sure I removed a while ago

* Address reviews again

* Remove melee weapon attack logic and rely on the system. Remove gun and
melee checks.

* Make system functional again and cleanup

* Remove code I forgot to remove

* Cleanup

* stalled

* Selectively revert gun penetration

The collision layer check doesn't work and I don't have time to fix it.

* Fixes

---------

Co-authored-by: metalgearsloth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: Needs Review Status: Requires additional reviews before being fully accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Executions need cleanup
4 participants