new bug leads to performance, and another delay #TrainsInMotion #Traincraft (1.7.10 rewrite)

Well today's update has taken all day for a single thing. Rather than the usual update log this one takes some explaining.

I've been noticing that trains and rollingstock tended to load in backwards.
Never really thought much of it until I realized it was breaking linking.
In the process of fixing it I realized the issue was the entire way I manage positions, it doesn't reliably transfer from client to server due to the asynchronous nature of packets.

So I ended up throwing out the entire variable that managed the bogie positions and instead doing it dynamically through the rotation.

Long run this means less RAM use by about 72 bytes per train/rollingstock on average. Although in the case of TC it will actually be 48 bytes without exception.
Given how long people tend to make trains, that could be upwards of 1KB just for one linked set of trains and rollingstock.
Sound great, but the trade-off is the re-calculation, rather than being spoon-fed the data pre-processed by client, server has to figure out positions for itself, so there is a bit more CPU use during the spawn of them, either from chunkload or when spawning from an item.
A reasonable trade I'd say.

I also reduced the lifespan of smoke and steam particles, it seemed like they just never died.

This delay has made it impossible to have alpha launch before the weekend. Which is bothersome because I only had a couple small things left to do.
Since this is out of the way however, assuming linking actually works when I test it tomorrow, I should be able to finish the alpha release tomorrow.

Comments