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

Area cloud effect does not behave like vanilla #665

Closed
IvanCraft623 opened this issue Sep 4, 2022 · 6 comments
Closed

Area cloud effect does not behave like vanilla #665

IvanCraft623 opened this issue Sep 4, 2022 · 6 comments
Assignees
Labels
improvement Improvement of an existing part of the codebase
Milestone

Comments

@IvanCraft623
Copy link
Contributor

IvanCraft623 commented Sep 4, 2022

Eg: In this implementation the cloud lasts only about 15 seconds, when in fact it should last about 30 seconds.

I have described some of these behaviors in:
pmmp/PocketMine-MP#5276 (comment)

@JustTalDevelops JustTalDevelops added the improvement Improvement of an existing part of the codebase label Sep 4, 2022
@JustTalDevelops JustTalDevelops added this to the v0.9.0 milestone Sep 4, 2022
@JustTalDevelops
Copy link
Member

JustTalDevelops commented Sep 9, 2022

In this implementation the cloud lasts only about 15 seconds, when in fact it should last about 30 seconds.

Where did you get this from? The duration is always set to 30 seconds.

return NewAreaEffectCloudWith(pos, t, time.Second*30, time.Second*2, 0, 3.0, -0.5, -0.005)

@JustTalDevelops
Copy link
Member

Yeah, I don't think this issue is valid — the logic seems to match up with the PR you linked. Is there anything in specific that is incorrect based off of vanilla, aside from the duration (which also is correct by the looks of it)?

@IvanCraft623
Copy link
Contributor Author

Where did you get this from? The duration is always set to 30 seconds.

Did you play-tested it?

dragonfly_area_effect_cloud_duration.mp4

@IvanCraft623
Copy link
Contributor Author

Is there anything in specific that is incorrect based off of vanilla, aside from the duration (which also is correct by the looks of it)?

  • Area effect clouds only trigger updates every five tick, it should be 10.
  • If the potion effect is instantaneous ReapplicationDelay is must be set to 0 (Actualy it would be applied every 10 ticks due to the above mentioned)

This information is obtained through play-tests and analysis of the NBT in vanilla.

@IvanCraft623
Copy link
Contributor Author

About duration after debugging I found that the problem was on the client side, because it requires certain metadata to calculate the radius itself.

AREA_EFFECT_CLOUD_RADIUS => (float) Initial radius
AREA_EFFECT_CLOUD_SPAWN_TIME => (int) world time when it spawned
AREA_EFFECT_CLOUD_RADIUS_PER_TICK => (float) radiusGrowth
AREA_EFFECT_CLOUD_RADIUS_CHANGE_ON_PICKUP => (float) radiusOnUse
AREA_EFFECT_CLOUD_PICKUP_COUNT => (int) Times it has been pick up

(It is likely that their names do not match because they were obtained from pocketmine)

@JustTalDevelops
Copy link
Member

I believe a lot of this can actually be avoided @IvanCraft623 by disabling the client-side behaviour of the cloud. Geyser does this, actually - see https://github.com/GeyserMC/Geyser/blob/3d66d2790f3a03ca8bafa7ce1cc6429ad9ab7a18/core/src/main/java/org/geysermc/geyser/entity/type/AreaEffectCloudEntity.java#L53.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement of an existing part of the codebase
Projects
None yet
Development

No branches or pull requests

2 participants