Compiling time explained for changing the lightmaps scale V 1.00 Requires knowledge about lightmap (scales) and mathematics!
I don't know wheather you ever wondered how changing the lightmap scale would affect the compiling time of VRAD exactly; properly you just knew that "as lower the scale is as longer it takes" before. I'm going to explain now it more detailed so you can calculate the compiling time.
Formula:
Calculating the VRAD compile time:
tn = to * sf²
Calculating the sf factor in the formula:
sf = sfo / sfn
Both put togehter in one formula:
-> tn = to*(sfo/sfn)²
Explanation:
First about the variables used:
| tn | new compile time |
| to | old compile time |
| sf | factor of change in the light map scale |
| sfo | old lightmap scale factor |
| sfn | new lightmap scale factor |
First of all, it is possible that the result of the formula is differnt from the real compile time because there are other processes in the background using CPU or the old compile times are inaccurate (they are rounded, so 0.5 seconds would be 1 second.). And the formula only works if you change the lightmapscale of everything in the map, but - of course - the same formula works for parts of the map too (I'll explain that later in the tutorial).
Anyway now about the formula. You need to compile the map first on your old settings and keep the lightmap scale factor in mind otherwise you are not able to calculate the new compile time. First you divide the old light map scale (sfo) through the new light map scale (sfn), than you simly muliply the value you get (sf) with it self (sf² means [sf * sf]). Once you done that just multiply your old compile time with sf² and you will get the new compile time. You can find examples at the bottom of the tutorial. Anyway watch out you always use seconds not minutes to calculate the new time because they might be a (very) big differnce. And please keep in mind that 5,50 minutes are not 5 minutes and 50 seconds; it is 5 minuntes and 30 seconds. Example for that problem you can find at the bottom too.
Some might be wondering now why they need to do it that way, it's quite easy explained. You need the old compile time and light scale as a refernce for the new ones. The new lightmap is required because the differnce between the new and old lightmap is related to the difference between old and new compile time. I give a example for that relation:
Old compile time was: 20 sec New compile time is: 80 sec Old lightmap scale was: 16 New lightmap scale is: 8
Old compile time was: 20 sec New compile time is: 320 sec Old lightmap scale was: 16 New lightmap scale is: 4
You learn im maths (and use it a lot in physics Oo) how to get a formula out of this...
You might still do not know why you need to multiply sf with it self; the simple answer is "2D". The lightmap is applied to a face which has 2 variables, width and length. The light map is a square so you can imagine there are a lot of little quare the lightmap is applied on the face. If you reduce the scale by the half you will reduce the length of each side by half so the square would get 2 * 2 times smaller than the orignal one. It's the same if you reduce the scale by a fourth: 4 * 4 times smaller squares. And the Compile time is releated to the size of the squares in the first place, so a 4 times smaller lightmap scale would be a increase in the compile time by 16 times.
Last but not least, the compile time may be differnt from what you calculated because the programms running in the background may take more or less CPU and so the programm can't compile with the same CPU power as before. In addition, the calculation formula only works if you change the lightmap scale of everything, but the rule the formula is based on works for anychange. So keep in mind that a reduction of the lightmap scale from 16 to 1 increases the compile time for the part of the map by 256 times.
Expamples:
1st
Old Compile time was: 20 seconds Old Scale Factor for everything was: 64 New Scale Factor for everything is: 16
so the new compile time would be: x=20 sec * (64/16)² x=20 sec * 4² x=20 sec * 16 x=320 sec
If you want to know the amount of minutes spent, just do this: x=320 sec / 60 x=5, 3.. min
You properly don't like the ,33333... now so you just change it back: x=0,33333. x= 1/3
y=60sec * 1/3 y=60sec/3 y=20 sec
So it would be 5 minutes and 20 seconds.
2nd
Another example: Old Compile time: 20 minutes, 10 seconds Old Scale Factor: 16 New Scale Factor: 32
New compile time: x= (2060+10)(16/32)² x= 1210 * (0,5)² x= 1210 * 0,25 x= 302,5
Means 5 minuntes and 3 seconds.
Version Histroy:
V 1.00 - release




