Game Development Community

SetTransform() not working

by Swaroop Reddy · in RTS Starter Kit · 10/11/2007 (9:41 am) · 2 replies

SetTransform() does not set it to the correct value FREQUENTLY from the server side to the client side. I have been tracking the x y locations of buildings. The values appear to be rounded to a floor value at times. At times there is no explanation that I can see. Z location is of course calculated based on terrain.

x value on server is 38.85, on client 38.8
y value on server is 38.8, on client 38.7!!! - What kind of rounding is this

setTransform(38.85 38.8 0 0 0 1 0)
getTransform
Server Side object shows - 38.85 38.8 246.454 1 0 0 0
Client Side object shows - 38.8 38.7 246.452 1 0 0 0


An other Example

setTransform(39.325 39.375 0 1 0 0 0)
getTransform
Server Side object shows - 39.325 39.375 246.461 1 0 0 0
Client Side object shows - 39.3 39.3 246.46 1 0 0 0

Surely someone knows how to fix this.

#1
10/11/2007 (11:47 am)
Mhhh Im afraid is comming that way from the float value of C++. Thats a classic problem of the float type.
Nevertheless the diffs are really minor, do you really need that level of precision?
#2
10/11/2007 (12:28 pm)
The game that I am working on is a tile based tactical game and I need the precision. I can propably work around it if the precision is only off by one tenth of a unit. I was concerned about rounding 246 to a 245 etc where the numbers are off by a whole unit. NOVACK - DO YOU SEE THAT AS A POSSIBILITY?

Thanks