dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Area cloud effect does not behave like vanilla

Open IvanCraft623 opened this issue 3 years ago • 5 comments

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: https://github.com/pmmp/PocketMine-MP/pull/5276#issuecomment-1236198936

IvanCraft623 avatar Sep 04 '22 00:09 IvanCraft623

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. https://github.com/df-mc/dragonfly/blob/967faf17ce46564cbf57893dc078a739c361bdb5/server/entity/area_effect_cloud.go#L36

JustTalDevelops avatar Sep 09 '22 17:09 JustTalDevelops

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)?

JustTalDevelops avatar Sep 09 '22 17:09 JustTalDevelops

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

Did you play-tested it?

https://user-images.githubusercontent.com/57236932/189500543-05352acd-8e98-4e6e-a80f-4a470358e863.mp4

IvanCraft623 avatar Sep 10 '22 20:09 IvanCraft623

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 avatar Sep 10 '22 20:09 IvanCraft623

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)

IvanCraft623 avatar Sep 17 '22 04:09 IvanCraft623

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.

JustTalDevelops avatar Dec 06 '22 01:12 JustTalDevelops