I do not understand that last sentence.
Are you using a deterministic simulation or not?
Cause if you do (most multiplayer games do it now-adays, its the only way to really avoid transfering all the games data <<BulletPositions/etc.>>)
you either go with the deterministic float approach. Why? Because:
http://stackoverflow.com/questions/2100 ... y-examples
Tl,DR : Floating Points on a PC are not only of finite precision, but also prone to plattform dependent (FPU) diffrent calculation methods and numeric errors.
STREFLOP handles this stuff by deactivating all the fancy, fast gimicks every CPU creator brings along, and bringing them all to behave according to the standard when rounding numbers, dividing, etc..
Now the alternative, if you decide to use Vanilla doubles (which are diffrent on diffrent hardware) would be to cut all digits out that are erroprone. Which means you have to find out which digits are errorprone - and there is a whole sience dedicated to that.
Means you have to calculate the condition of every operation you do:
http://en.wikipedia.org/wiki/Condition_number
Translates into Noobish:
If you have a unit, who gets a damage buff, every millisecond, with a little error in it. This errors mutliply up.
1.0001*1.0001=1.00020001
1.0001^1000=1.1051653926032326972401842401091
Meaning, if you forget to cull ones operations errors, it will grow, and invest your whole determinstic simulation.
Meaning, what starts out as a soldier walking just slightly out of line on one machine, means on that machine, he is not hit by an arrow, he survives the war, and returns home to his wife, only to find out that on all other deterministic-simulations, she was a widdow, married another guy called Schroedinger, and the have a child called Desync Bug!
Now if you have a badly conditioned operation, it will with certain numbers produce tremendous errors.
http://en.wikipedia.org/wiki/Floating_p ... y_problems
And again desync Bug dangers. Machines are just machines, and engineering is realizing, that the default handed to you as user is faulty to, and carefully working around it. Even the windows calculator produces errors if take a number, multiply it long enough with 0.9 and then divide it again with 0.9 back to its original value. Try it yourself, copy paste this code into :
http://www.tutorialspoint.com/execute_lua_online.php
Code: Select all
numberDiv=1
startNumber=1
itterator=1
divisor=0.9
while math.abs(numberDiv-startNumber) == 0 do
for i=1,itterator do
numberDiv=numberDiv*divisor
print(numberDiv)
end
for i=1,itterator do
numberDiv=numberDiv/divisor
print(numberDiv)
end
print("number divided "..numberDiv .. " should be "..startNumber .. " imprecission of" .. math.abs(numberDiv-startNumber))
itterator=itterator+1
end
print(itterator)
To be honest, the whole process with doubles will be only managable, if you automatize finding, calculating and eliminating the errors. And even then ... Getting Spring to sync was a hard fight. You will have to fight the same fight. Good luck, and if you have any questions, contact us in IRC #sy.
Many starters take the warnings, and horror-tales of engineering as a personal assault, or a attempt at discouraging them from making theire game. We dont. Quite to the contrary! Do it! But to succeed, you will have to go through the same stuff- and that is why we warn you. Its our way of cheering you on!
http://gafferongames.com/networking-for ... terminism/