Speed increase per powered rail is unpredictable #3
Labels
No Label
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: andrew/SpeedCarts#3
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This technically happens at normal speeds, but it's much less noticeable.
The cause of the issue is that a fast-moving cart may traverse multiple blocks in one tick. If a powered rail is "skipped" in this way, it does not speed up the cart. This causes "dead zones" of speed that depend on the distance between each powered rail.
A way to fix this would be to raycast in the movement direction of the cart and apply the effects of each intersected block in the order. Care must be taken using this technique to avoid "double-counting" blocks (applying the effects of the same block at the end of one tick and the beginning of the next tick at high speeds).
If this raycast technique works well, it could eventually be modified to allow carts to go up and down hills, on diagonals, or around corners at higher speeds.
At the moment I do a sort of primitive, orthogonal ray-cast along the horizontal axis the cart is traveling, to look for signs indicating to stop the cart. I could expand this to include searching for powered rails, but the actual application of speedup is still quite convoluted to me, so I don't know how I would scale it based on the number of rails encountered.
I gave it a shot myself back when I created this issue and didn't make much progress. The vanilla "rail check" method is just a huge mess of logic that I'm afraid to change lol
perhaps you could use this mod to fix these issues? IDK I'm not a programmer pro
https://github.com/audaki/minecraft-cart-engine