oddlama / vane

Immersive and lore friendly enhancements for vanilla Minecraft
MIT License
276 stars 34 forks source link

Suggestion (vane-trifles): Walk faster with horses on grass paths #87

Closed knniDE closed 2 years ago

knniDE commented 2 years ago

Currently, only players on grass paths can speed up. I hereby propose that horses can also be affected by this.

oddlama commented 2 years ago

Nice idea, will implement.

ryantheleach commented 2 years ago

To add to this, give all entities on grass paths the boost. This will make it easier to bring tamed animals etc with leads.

oddlama commented 2 years ago

The problem with boosting all entities is that PaperMC doesn't expose movement events for entities (only for players), which I would need for that. Their reasoning is that it causes severer lag, which indeed is a problem when inexperienced developers do some heavy work in this event callback. Unfortunately for us this means it cannot be done easily and I'm not to keen on injecting bytecode patches at runtime.

ryantheleach commented 2 years ago

The other unspoken option is to check entities every x ticks for if they are standing on grass path. I believe that would be more efficient then some sort of entity move event anyway, but I may be naive without testing both.

oddlama commented 2 years ago

Definitely more cache friendly and a lot less function calls. Could also easily be runtime-capped by introducing an upper limit of say 2 ms for total per-tick entity processing. By additionally randomizing entity iteration order, it doesn't even matter if the budget is spent, as the perceived tick-rate for each entity will just decrease statistically. So this wouldn't break when an unexpectedly high number of entities are encountered for whatever reason.

oddlama commented 2 years ago

That's actually also a viable solution for #37 👀.

oddlama commented 2 years ago

All living entities are now boosted by blocks configured for fast-walking.