• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

While loop for reals

Status
Not open for further replies.
Level 3
Joined
Apr 28, 2010
Messages
48
sounds like a hipster thing to say but,...

Does it call every real number in the while, or the other trigger, for each real? OR, does it round to an integer.

I can't imagine blizzard would let people mess with infinite numbers.
 

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,290
There will obviously be an incriment setting for it, as you would otherwise have near meaningless values.

SC2 uses floats, their precision I do not know. They however definatly do have a precision so there is no infinite number of reals. Additionally the range of numbers supported by floats vary with there being huge incriments at large numbers.
 
Level 11
Joined
Aug 1, 2009
Messages
963
The real value for loop should have an increment setting. It increases the variable by the increment until it is greater than the exit condition.

Blizzard doesn't prevent you from using infinite loops, if that's what you are asking. If you want to crash your map and make it freeze, your choice.
 
Level 5
Joined
Jul 10, 2010
Messages
124
real numbers associated with game time are rounded to the nearest multiple of 0.0625

some reals in the data editor are also rounded to 1/16 or 1/32 increments as well. you can see some values when you enter 1000, it rounds it to like 999.94
 

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,290
I would imagine they used floats as those are what direct X and such interfaces use and also modern hardware actually supports physical structures to speed up their computation.

They might use binary decimalls as well, which would explain the funny incriment (caused by maths applied) but only a reverse engineering of the actual game would reveal that (which violates TOU).
 
Level 11
Joined
Aug 1, 2009
Messages
963
Floats? I thought they used fixed-point variables. At least that's what they are called...
Fixed point suggests integers.

I'm pretty sure they use 32 bit floats for "fixed" variables. I mean forcing us to use 64 bit variables would be kind of silly, and the memory allocation problem (the 2^21 bit limit) seems to be the same regardless of if you are using int vs fixed, so it suggests they use the same storage capacity ie 4 bytes.
 
Status
Not open for further replies.
Top