Some more science:
A push will teleport a cart to the beginning
of the next tile (NOT the middle!) in one tick with 19990 speed, while a roller will accelerate a cart to roller speed, and it will start to accumulate regular track friction past the middle of the roller tile. So both propulsion methods start the minecart at the beginning of a tile, but not the same one.
So why do we see a minecart skipping over a pit when pushed?
Because some track features will affect a minecart when it is past the middle of the previous tile
: entering a ramp or a hole/drop and derailment checks are executed when the cart has left the middle of the previous tile, so with these track features a cart doesn't travel the usual ~100.000 distance units, but somewhere between 50.001-100.000, then the leftover distance of the tile will be added to the ramp that we enter, so on certain conditions the first ramp can be ~150.000 long, producing more acceleration then expected. Rollers also accelerate a minecart from the middle of the previous tile, and not from the beginning.
Then, when a cart leaves the ramps, it will emerge after one tick in the middle of the next regular tile, so it's entry coordinate is "50001-speed". That effectively means, that if we are going with 270.000 speed and exit the ramps the first regular tile that we enter will be 320.000 distance units long, and will start 2z levels above. That's dwarven relativity for you.
Additionally, there's a speed penalty of 4900 when exiting a long track ramp at high speeds, so you can only go with max speed on ramps, when entering a straight track you'll be ''only" travelling with 265000. The exact treshold of this penalty is to be tested.
All that's left to determine is how a minecart behaves on multiple ramps: distance unit calculations are totally different on them. What I could determine is that some kind of skipping over ramps is happening in the game, it looks like after accelerating past 160.000 speed the cart skips over every third ramp. This skipping behaviour also happens on regular tiles at high speed, meaning that you need to place your trackstops accordingly, otherwise the cart just flies past it. How skipping is determined, what's the underlying logic? Still to be resolved.
Here be some data dump from the game:
Explanation for the 4th line:
016: tile identifier
89960: distance units at exit point
29980: distance units travelled in a tick
2998: minecart speed at exit point, a zero is missing at the end...
-0.001: tile friction
59000153000: some id and shit, 153 means we are on z level 153, the 000 after 153 seems to indicate we are on a straight track without z level change in this tick, note the -100 at the end of lines of the ramps. A corner will also show -100 at the end, when skipping over a tile we see -200, so it may be a derail check indicator instead. The others are still a mystery.
So if you try to read this data:
016: medium speed roller - first line sets speed to roller speed, then comes 3 ticks while we travel on the roller, first 2 ticks are frictionless (until we leave the middle of the tile)
017-018: regular tracks
019-025: down ramps, last tick accelerates to 103270 speed
As you can see, distance calculations are fairly straightforward on straight tracks, we change tiles when the next tick would end on the next tile, the entry point of the next tile is the leftover distance. I have tons of data to confirm that this is true.
The important thing to notice is at line 11(last tick of tile 18):
if the next tile were a regular tile we would be at position 93800, but a ramp is coming, so we have downramp friction, and the distance calculations switch to ramp distance calculations, so the position is 884930. Also the distance units switch to something new, we read 246130. On the next tick we enter the first real ramp section, and the distance unit calculation is : 884930+246130=1165630 - so somehow it makes sense.
(Sometimes they don't add up, but I think that's something to do with the script, as it's a bit buggy, some ticks it cannot read at all, sometimes a zero is missing from a number.
Unfortunately I cannot fix it, but the read errors are easy to spot.)
I made some analysis of the distance units on the ramps, and the for the majority of the travel they increase with 34570/tick (280700-246130= 34570 But Whyyyyyy?). That's about all I could deduce.
I need some fresh ideas to continue.
Snaake, please tell me that you are reading this and have an idea!