Map property values

For all the help you need with Armagetron!
Post Reply
User avatar
sinewav
Graphic Artist
Posts: 6472
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Map property values

Post by sinewav »

Is there a limit to the numeric values in map properties?

For example, are these OK...?

<Wall height="99999999999"/>
<Wall height=".0000000001"/>

Thanks.
User avatar
Z-Man
God & Project Admin
Posts: 11710
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Map property values

Post by Z-Man »

Electric Turtle wrote:Is there a limit to the numeric values in map properties?
Yes, the limits in range and accuracy are those of standard single precision floating point numbers. The precision is around 1 in 10^6, the range is from -10^32 to +10^32.
Electric Turtle wrote:For example, are these OK...?

<Wall height="99999999999"/>
<Wall height=".0000000001"/>
Yes.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Re: Map property values

Post by Jonathan »

Z-Man wrote:
Electric Turtle wrote:Is there a limit to the numeric values in map properties?
Yes, the limits in range and accuracy are those of standard single precision floating point numbers. The precision is around 1 in 10^6, the range is from -10^32 to +10^32.
Precision is better than 1 in 10^7 (scaled by the magnitude of the number), at least before accumulating rounding errors. Range is over ±10^38. Not that it matters for a typical map. :)

P.S. Thanks in advance for nitpicking this nitpick by mentioning denormals and everything else there is to know about floating point.
ˌɑrməˈɡɛˌtrɑn
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

what would happen if you maxed out a variable's type in an occasion like that? server crash?
Image
Image
Image
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

I think you'll get some weirdish physics and graphics at most.
ˌɑrməˈɡɛˌtrɑn
User avatar
sinewav
Graphic Artist
Posts: 6472
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Post by sinewav »

Jonathan wrote:I think you'll get some weirdish physics and graphics at most.
Maybe that's how you made your avatar?! :o
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Nope. ;) There's no floating point at all, besides normalization and gamma correction of the final integer samples.
ˌɑrməˈɡɛˌtrɑn
User avatar
sinewav
Graphic Artist
Posts: 6472
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Post by sinewav »

This might be interesting to note. I had a map with the property and value <Wall height=".0001"> work locally, but not on a 0.2.8+sty server. I changed the value to ".001" and it worked. I don't imagine this being a recurring problem in the future; I just thought I would mention it. Unfortunately, I don't have access to the log to get the error message, but I bet it could be easily recreated if anyone cares to look into it.
Post Reply