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

[changed/fixed] Decay spam hits + [removed] DecayIfLeftAlone #2258

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mugg91
Copy link
Contributor

@mugg91 mugg91 commented Dec 19, 2024

Status

  • READY

Description

[fixed] DecayIfSpammed won't damage more blobs than necessary
[dev] spam limit can be set to blobs which will be checked for in DecayIfSpammed
[changed] Invincible blobs won't decay
[changed] Attached blobs won't decay
[changed] DecayIfFlipped and DecayIfSpammed will check for disallowDecaying() first
[removed] Script "DecayIfLeftAlone.as"

Fixes #1751
Fixes #860

dissalowDecaying() renamed to disallowDecaying().

Decay scripts that use disallowDecaying() won't decay blobs if they are invincible or attached.

disallowDecaying added to DecayIfFlipped.as and DecayIfSpammed.as.

DecayIfLeftAlone removal

Script DecayIfLeftAlone.as and all references to it removed as it is unused and I don't see it getting brought back in the future. It looks unpopular to me.

DecayIfSpammed change

DecayIfSpammed.as was rewritten.
It checks if a spam limit has been set. Allows for custom spam limit that can be set to blobs via set_u8("spam limit", number). Otherwise defaults to 5.

Blobs are kept track of via network IDs.
Only the blob with the lowest net id will be hit, fixing the problem that several blobs were hit at the same time. More blobs will be hit if there are multiples of the spam limit:

  • 4 buckets, with the limit being 4 - Nothing happens.
  • 5~8 buckets, with the limit being 4 - The first bucket will be hit.
  • 9~12 buckets, with the limit being 4 - The first two buckets will be hit.
  • 13~16 buckets, with the limit being 4 - The first three buckets will be hit. etc.
    Oldest 5 (or whatever the spam limit is) buckets will stay and every bucket past that will decay.

This worked very well in testing.

DecayQuantity change

onAttach() and onThisAddToInventory() are removed from DecayQuantity.as because the only thing they do is set this.getCurrentScript().tickFrequency = (getRules().hasTag("quick decay") ? QUICK_FREQUENCY : FREQUENCY); which is already done in onInit() so it looks like these hooks don't really fulfill a purpose.
If I'm mistaken and there is a purpose, please let me know and I can revert the change.

@mugg91
Copy link
Contributor Author

mugg91 commented Dec 22, 2024

Before

DecayBefore.mp4

After

DecayAfter.mp4

I noticed some things.

  • It looks like the limit in the current live build is actually 5, with the 6th bucket triggering the decay. I will eventually change it accordingly in this PR.
  • I think that decaying everything except the oldest 5 buckets would be better. Only decaying multiples of the limit is not a good counter measure against spamming.

Therefore setting this to "In Development" for now.

@mugg91
Copy link
Contributor Author

mugg91 commented Dec 23, 2024

Committed changes explained above.
Ready for review now.

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.

Invincible Blobs get destroyed by water Fix DecayIfSpammed
1 participant