Minecart system overhaul
#2
As for the Proposed solutions part A, Vanilla actually doesn't use curves, it uses straight lines even for the curved rails. This is why alternating curves produce a straight diagonal movement.

I don't think adjusting the velocity is a good solution; rather, calculate the end position, set it directly and then calculate the end speed (right-wards in your example picture) and set it directly as well. Orientation (for C) could be calculated as well.

As for the constants, definitely do pull them out of the code into the front of the file. Keep their values for now (unless you change the calculations), we can check them against vanilla later on.

It might be a good idea to actually implement "neighbor walking" - when ticking the minecart physics, start with the block the minecart's in, then continue along the neighbor into which it runs using the current velocity, then the next neighbor, and the next; update the velocity's direction on entering each neighbor, as well as add in each rail's effect (booster / brake / activate / detect / ...). Do this until the tick's worth of movement is exhausted, then set the final position, velocity and yaw into the minecart entity.
Reply
Thanks given by:


Messages In This Thread
Minecart system overhaul - by ChriPiv - 08-18-2014, 02:42 AM
RE: Minecart system overhaul - by xoft - 08-18-2014, 06:27 AM
RE: Minecart system overhaul - by ChriPiv - 08-18-2014, 08:11 AM
RE: Minecart system overhaul - by ChriPiv - 08-18-2014, 11:42 PM
RE: Minecart system overhaul - by tigerw - 08-19-2014, 01:44 AM
RE: Minecart system overhaul - by NiLSPACE - 08-19-2014, 02:29 AM
RE: Minecart system overhaul - by xoft - 08-19-2014, 06:40 AM
RE: Minecart system overhaul - by tigerw - 08-20-2014, 06:58 AM
RE: Minecart system overhaul - by ChriPiv - 08-19-2014, 10:57 PM
RE: Minecart system overhaul - by tigerw - 08-19-2014, 11:59 PM
RE: Minecart system overhaul - by ChriPiv - 08-20-2014, 12:39 AM
RE: Minecart system overhaul - by ChriPiv - 08-20-2014, 10:34 PM
RE: Minecart system overhaul - by NiLSPACE - 08-20-2014, 11:13 PM



Users browsing this thread: 7 Guest(s)