- Joined
- Sep 25, 2007
- Messages
- 1,258
UNDERSTAND THE NUMBERS OF
WCIII
Hello! WCIII
This ‘tutorial’, thesis or whatever you could call it, lectures about a couple of
things:
Range,
Colour,
How to recalculate numbers in the editor.
Introduction:
Last night, I had a revelation! … Of sorts.
I lay thinking about the numbers of Warcraft III, which had puzzled me,
before I got to this stage in my education.
A long time ago, I tried to do a ‘reverse TD’ where, the towers moved
through the maze, and units shot at them. You know, upside down world.
But, I just couldn’t seem to get the distance the towers moved, right.
I tried measuring one grid square off the World editor, by holding the cursor
over the lines.
Of course it didn’t go. I got the distance to be ‘round 120. The TD failed utterly.
Some months later, I thought back on this project, and eager to know about
what I’d done wrong, I went about a cleverer way, to measure the distance.
Using the system below, I accurately measured distances and such:
If you set up a trigger as so:
-
Distance
-
Events
-
Time - Every 2.00 seconds of game time
-
-
Conditions
-
Actions
-
Game - Display to (All players) the text: (String((Distance between (Center of Region 1 <gen>) and (Center of Region 2 <gen>))))
-
-
128.000, which is the accurate distance.
It really helped me understand the game better.
Since I very quickly realized that this also was the distance used as ‘range’
in-game.
It also became clear to me, that this was a part of the binary counting
system.
The Binary numeral system
For all of you, not knowing what this system is, here’s a quick reminder.
All the 0101011101001000 – numbers that we have gotten to know as what’s
behind the computer – is binary counting.
Here’s a link to Wikipedia: http://en.wikipedia.org/wiki/Binary_numeral_system
But, if you want to just have a quick introduction to it, it’s a system, where
each 1 is ‘on’ and each 0 is ‘off’ Let’s try to count to 10, BINARY STYLE!
1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010
Which, translated will be (in the decimal system):
1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
There IS a system to all this nonsense.
To say it easily, every number in the binary system, has a value equal to the
previous number times 2.
And the first number is 1.
Meaning, that this is the actual numbers: 1 means 1, 10 means 2, 100 means
4, 1000 means 8, 10000 means 16, 100000 means 32, 1000000 means 64,
10000000 means 128. (Remember this one :3?)
Then you can combine them to create other numbers. 18, for instance, is a
mix of 2 and 16: 10010.
If you didn’t understand my explanation, you could try counting binary on
your hands. But I’m not going to devote any more time to explaining this
system, try the wiki link, possibly.
To wrap up all this binary nonsense, I did it to help you get an understanding
of why and how the game has been put together.
Also, it should help you in-game to estimate, e.g. exactly how long 400 range
really is. (3 and 1/8 of a square)
This gives you a deeper understanding of the game, and you can make better
estimates to how to put your own maps together.
I know that I’ve learned from it, so why shouldn't you?
Colour – the codes explained easily.
Note: The Title should perhaps have been ... 'as easy as i could'
So! Have you ever wondered why the hell yellow is also known as |cffffcc00
x|r ? (The x being your text) Whilst unit colours have been in a range of 0 to
255? And floating text triggers specifies the colour in percentages?
They’re clearly not based on the same system.
Or are they?
Well, I can tell you, that with a bit of calculation, they are! Let’s begin with
the text code. It’s setup is quite like this:
|cffxxyyzz{insert text here}|r. It looks odd, since I’ve replaced six of the
digits here with something else.
So! Here’s the trick: The x’s code for red, the y’s
code for green, and the z’s
code for blue.
And, instead of these xyz’s, you can put one of these numbers/characters:
0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f. Leaving you with 16 options, per x, y, or z.
This system is known as the hexadecimal system.
Here’s the wiki link, if you want to know more:
http://en.wikipedia.org/wiki/Hexadecimal
It is also known as Hex code.
I won’t explain it as I did with binary, but go to the link, if you really want to
learn about it, instead, I’m going to show you it’s use in colour codes.
It’s actually quite simple. In WCIII (VERY simplified!) 0,1,2,3,4,5,6,7,8,9
,a,b,c,d,e,f. Means 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15. And, when we
set something like this into the colour-codes like, |cffFF0000|r It turns out
as red as it can get.
It’s the first digit times the other (basically).
--- Taken From Ap0calypse ---
(A, B, C, D, E, F
10, 11, 12, 13, 14, 15)
You need to multiply the first character with 16 (G) + the second character.
FF
FF = F * 16 + F
FF = 15 * 16 + 15
FF = 255
--- Taken From Ap0calypse ---
And that’s where we know the unit codes from!
They range from 0 to 255, Which is the exact same as the text codes,
although less ‘code-y’.
Now it is possible to see a connection.
And, you know, to recalculate that number to percentage is easy.
But for those of you not knowing it, you just divide 255 by 100, and then
multiply by how many percentages you want.
It leaves you with how much you need to type into the unit colour-codes.
If you want an easy way to change it to text code, take the square root of
the result, and use find the nearest number from 0-9, A-F. And use that
twice after one another.
It will give you a, maybe a bit, crude result, but I would say that it would do.
Epilogue
I certainly hope that my hours of work will get used for a better
understanding of the numbers of WCIII, and get all readers to a higher level
of map-creating, and understanding.
˜The_Clam (Also Gamecrafter_DK)
Thanks to:
Maskedpoptart, who did a little more on the numbers, link to his post here: It is number 12, if you want to scroll down yourself.
ap0calypse
http://www.hiveworkshop.com/forums/.../understand-numbers-wciii-148770/#post1387918
Attachments
Last edited: