Twelve hours on this bug. I've known it for a long long time. It was hardly reproducible, and it kept messing up segment loading. Some of you might have already noticed that the camera sometimes jumps or flickers, when the game is started or when some other times. This often times caused a full reload of all segments, since as the camera jumped to another point for one frame, the system thought that these segments were out of range and pushed them out of the 'segments-to-be-drawn'
I searched hours to nail it down to a single function, but that still kept me puzzling, why a multiplication with the same values would lead to different results sometimes. Turns out it was once again multithreading that got me. Retrieving the postition of the camera was not an atomic function, so if two thread were to request it at the same time, the result could get screwed up for one of them.
Phew... now I'm tired
Thanks for playing StarMade,
- schema
EDIT: Ah and I also upgraded the forums
I searched hours to nail it down to a single function, but that still kept me puzzling, why a multiplication with the same values would lead to different results sometimes. Turns out it was once again multithreading that got me. Retrieving the postition of the camera was not an atomic function, so if two thread were to request it at the same time, the result could get screwed up for one of them.
Phew... now I'm tired
Thanks for playing StarMade,
- schema
EDIT: Ah and I also upgraded the forums