Closed BSzili closed 2 years ago
I wonder, wouldn't it be safe to always use those epsilons and not just for aos3.. (No, haven't yet tested myself.)
Since it reinforces the existing behavior it probably wouldn't break other platforms, but this whole thing is quite fragile, so I wouldn't want to risk it.
SV_RunThink
hexenwordl server doesn't need the same workaround?
Oddly it didn't. There are some differences in how host_frametime is handled there, so it worked with only the SV_Physics_Pusher fix.
Asked a friend about his opinion on making the solution available to all platforms.
Asked a friend about his opinion on making the solution available to all platforms.
He says, in essence:
The solution should be the same for all platforms. (Not all math processors of all cpus work the same way - even with the same C code, something crashing with x86 may not do so with ppc, and vice versa. But having the same code is best for debugging, even though the results are never 100% same.)
However: as time progresses, i.e. as the float/double time value increases, the epsilon incrementation won't happen, the floating point value will stay the same.
The second part of what he says is what I'm somewhat worried about.
If other platforms are not affected then it's probably better to keep this Amiga-only. The second part is no problem there, as the workaround only needed for the initial SV_Physics calls in SV_SpawnServer, where host_frametime is always initialized to a known value.
OK, will probably merge this as is tomorrow. Two questions until then:
-ffast-math
is causing an adverse effect resulting in the issue?I couldn't test with gcc2 for now, but disabling -ffast-math had no effect on it.
OK, this is in.
On Amiga there was a race condition in the order the entities get to think first when SV_SpawnServer is run. It was caused by the double to float conversion of host_frametime in SV_Physics_Pusher and later sv.time + host_frametime in SV_RunThink. Because of this some doors could be used or touched before their InitDoor function is executed causing a program error. I tried multiple ways to fix it, but it quickly became a game of whack-a-mole, so I ended up adding small constants to these checks to give them a bit of tolerance.