Search
Username:
Password:

Register or Reset Password

SUBMISSIONS
Counter Strike
   New Maps
   New Tutorials
   New Skins
   New GUI's
   New Sounds
   New Threads
Other
   Media
   Gamers
   Clans
   Studios
Compile time for lightmaps V 1.00
Difficulty: Advanced
Category: CS:S > MappingAuthor(s): Omega_K2

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= (20*60+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
Added: 11 months agoTags: light, map, mapping, lightmaps, compile, compiling, vrad, cstrad, omega, k2, omega_k2, time, duration
Feedback (7)
Omega_K2 .
It's me, Mario :PY2M
Posted 17 days ago
Unless its a Turion X2 it isn't possible.
- It's me, Mario :P
Whisky .
God's seen campy bean.Y2M
Posted 17 days ago
Posted by Omega_K2

Posted by Whisky

Well i got this problem, i have made a map env_spot and env_light and cubemaps, but the compiling time takes more than one houre and 30 seconds! os there ANY way to keep detail but faster compiling time?

If you want to keep detail you'll have to try third party compiler. If you have a dual core or quad core processor and the compiler says "1Thread" you could add the compile options (advanced/expert mode) -threads 2 (Dual core) or -threads 4 (Quad core).

Also if you test some stuff use the Fast compile mode. Saves a lot of time.


Thanks, i got AMD Turion Btw, and i used fats compiling :) but the walls (combine texture form half-life) look a bit to bright and shiny :( could i use turion to compile with treath 2?
Omega_K2 .
It's me, Mario :PY2M
Posted 18 days ago
Posted by Whisky

Well i got this problem, i have made a map env_spot and env_light and cubemaps, but the compiling time takes more than one houre and 30 seconds! os there ANY way to keep detail but faster compiling time?

If you want to keep detail you'll have to try third party compiler. If you have a dual core or quad core processor and the compiler says "1Thread" you could add the compile options (advanced/expert mode) -threads 2 (Dual core) or -threads 4 (Quad core).

Also if you test some stuff use the Fast compile mode. Saves a lot of time.
- It's me, Mario :P
Whisky .
God's seen campy bean.Y2M
Posted 19 days ago
Well i got this problem, i have made a map env_spot and env_light and cubemaps, but the compiling time takes more than one houre and 30 seconds! os there ANY way to keep detail but faster compiling time?
Ironmad .
Eat PizzaY2M
Posted 9 months ago
Any preent screens?
dont even know what this is
Jomann .
BananiteY2M
Posted 11 months ago
Im glad your a math wizard cuz i sure aint
- Bananite
Omega_K2 .
It's me, Mario :PY2M
Posted 11 months ago
My first tutorial in English (I've written some in German some time ago). I am sorry about bad grammar, spelling or word usage because I am still learing English in school, lol.
- It's me, Mario :P
Add Feedback
Provide constructive feedback. What is "constructive"?
You cannot post yet!
Get involved on FPSB by posting your thoughts. Give authors your feedback to help them develop.

To post in this submission register or login.
Assessment
The community's verdict.
No assessments made... please vote!
You cannot assess yet!
Moderating FPSB is in your hands - when you assess a submission your vote determines its success or failure.

To vote on this submission register or login.
Stamps
This Tutorial in a nutshell...
No stamps recorded
You cannot stamp yet!
Stamps let you apply characteristics to submissions to help others understand them.

To stamp this submission register or login.

Brought to you by...
Official Zombiemod Studio
Maps, Skins, Scripts, and More!
Membership: Invite Only
Primary Skills: Coding/Scripting, Graphic Design, Mapping, Sound Effects & Music, Texturing, Server Administration
Inception: 11 months ago
Vote for Studio
Like this tut? Vote Official Zombiemod Studio for one or more monthly awards.
You must login or register to access this!
Related Tutorials