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

Fixes Particle Accelerators being unable to activate tesla/singulo engine. #9942

Merged
merged 9 commits into from
Oct 9, 2023

Conversation

HowToLoLu
Copy link
Contributor

About The Pull Request

Fixes #9887

This fixes a bug that prevented players from making singulos/teslaballs, due to some bad projectile code. So I touched it up and made it so that Piercing behaviour comes before Phasing behaviour- since they're identical but one hits and the other doesn't.

So now the game will try to hit something while passing through before doing nothing while passing through.

projectile_piercing = PASSMOB | PASSANOMALY | PASSMACHINE
projectile_phasing = (ALL & (~PASSBLOB))

as opposed to

projectile_piercing = PASSMOB | PASSANOMALY | PASSMACHINE
projectile_phasing = (ALL & (~PASSMOB) & (~PASSBLOB) & (~PASSANOMALY) & (~PASSMACHINE))

Why It's Good For The Game

Touches up some bad code behaviour so that's it's less so, and fixes a feature that is supposed to work.

Testing Photographs and Procedure

Screenshots&Videos
EnergyGoesUp.mp4
SinguloForms.mp4
TeslaballForms.mp4
BlobHit.mp4

Also touched the sniper penetrating rounds while cleaning up too- so here's evidence that it still works:

SniperPenetratorStillWorks.mp4

Changelog

🆑
fix: The Particles shot out of the Particle Accelerator no longer phase through machines
code: In Projectiles, Piercing behaviour is now prioritized over Phasing behaviour (the difference between the two is whether it deals damage as it's passing through)
/:cl:

Copy link
Member

@itsmeow itsmeow left a comment

Choose a reason for hiding this comment

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

I had no idea this was even broken

@PowerfulBacon
Copy link
Member

Not sure how I feel about the solution, I feel like the phasing flag should have more emphasis than the peircing one, since if something has piercing: ALL and phasing: ALL, then it should phase through things rather than peirce them. This could lead to some knock on effects.

Either way the projectiles need to be configured such that their piercing and phasing don't overlap, otherwise its going to lead to confusing. The sniper rifle shouldn't have ALL on both otherwise it will be confusing as to which one should act.

Copy link
Member

@PowerfulBacon PowerfulBacon left a comment

Choose a reason for hiding this comment

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

Projectiles need to maintain an xor property between phasing and piercing, we don't want a flag enabled on both of them as this leads to confusion as to whether the projectile will pierce or phase when reading the code.

@HowToLoLu
Copy link
Contributor Author

HowToLoLu commented Oct 4, 2023

Not sure how I feel about the solution, I feel like the phasing flag should have more emphasis than the peircing one, since if something has piercing: ALL and phasing: ALL, then it should phase through things rather than peirce them. This could lead to some knock on effects.

Unfortunately when #9700 was ported it introduced a new flag that posed a problem to this logic since it's by default on all machines, but is more of a behaviour flag that can apply to anything else as well. You'd have to memorize that this flag exists in certain niche scenarios which doesn't seem like a great way to do it, for example all machines have it by default. In addition it's vague and you wouldn't be easily able to tell what has it in the future, given the name is LETPASSCLICKS

(Only just now realized I quoted the wrong text, the relevant text is now quoted)

@HowToLoLu
Copy link
Contributor Author

HowToLoLu commented Oct 4, 2023

Which could mean that you'd have to keep track of everything that has LETPASSCLICKS, and if more of these technical flags are added you have to go back and know where to add them because it potentially breaks phase first XOR logic.

As for the confusion, we could just add a comment describing the behaviour since I don't think it's actually described at all currently.

@HowToLoLu
Copy link
Contributor Author

HowToLoLu commented Oct 4, 2023

Perhaps I can make it so the code can get a list of technical pass flags like LETPASSCLICKS and have that automatically be canceled out? The only reason I didn't do it earlier is because it felt like it was going to make this harder to maintain. If you want that instead, just let me know.

@PowerfulBacon PowerfulBacon added this pull request to the merge queue Oct 9, 2023
Merged via the queue into BeeStation:master with commit 17245a8 Oct 9, 2023
8 checks passed
@HowToLoLu HowToLoLu deleted the Particle-Phase branch November 27, 2023 22:24
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.

[Bug]: Tesla Generator - Particle Accelerator doesn't work
3 participants