Page 3 of 13
Re: Shadow calculation and lightmaps explained
Posted: 08 Feb 2013, 15:40
by Zell
Hi. I finally got to computing shadows - it takes 3-5 minutes per map on high settings on my current setup.
Unfortunately 2 maps which are used in competitions today - Ironfist Spitfire and by Tatar - have passwords on them so I cannot go into the editor to calculate shadows...
Is there a way I can do this without having to create a .bat file?
Re: Shadow calculation and lightmaps explained
Posted: 08 Feb 2013, 16:22
by niarfman
Indeed, use the ingame script instead of the editor (see the first post of this thread)
Re: Shadow calculation and lightmaps explained
Posted: 08 Feb 2013, 17:24
by Zell
Ok thanks.
Just a heads up to everyone:
"C:\Program Files (x86)\ManiaPlanet\ManiaPlanetLauncher.exe" /LmQuality=Ultra did nothing.
But
"C:\Program Files (x86)\ManiaPlanet\ManiaPlanetLauncher.exe" /computeallshadows /useronly /collections=Storm /LmQuality=Ultra opened maniaplanet in windowed mode and started computing shadows automatically.
It's much easier to do it this way, rather than one by one..

Re: Shadow calculation and lightmaps explained
Posted: 18 Feb 2013, 10:41
by niarfman
Hi !
Is it possible to enhance this script by adding an argument allowing to choose the folder to compute ?
For now we need to move the maps which we doesn't want to compute in an other folder. And some maps which are not in the Maps folder will also be compute. When using Ultra Quality, the needed time for each map is around 15-20 minutes on my computer (i7 2600k + Radeon 7950). Be able to compute ONLY desired maps will save me a lot of time ^^.
Thanks by advance
Re: Shadow calculation and lightmaps explained
Posted: 18 Feb 2013, 22:06
by TMarc
niarfman wrote:Hi !
Is it possible to enhance this script by adding an argument allowing to choose the folder to compute ?
For now we need to move the maps which we doesn't want to compute in an other folder. And some maps which are not in the Maps folder will also be compute. When using Ultra Quality, the needed time for each map is around 15-20 minutes on my computer (i7 2600k + Radeon 7950). Be able to compute ONLY desired maps will save me a lot of time ^^.
Thanks by advance
As far as I know, there is no possibility to calculate the shadows of only a selected map by a commandline option.
You could use a batch to process only a list of files, but this means it would have to move away all the other files.
Doing it in a batch could be dangerous if there are issues, so a backup is always good.
It could be done like this:
C:\Users\MyUserName\Documents\ManiaPlanet\Maps\maplist.txt:
Code: Select all
Map1.Map.Gbx
Elite\Map_01.Map.Gbx
Storm\Map_03.Map.Gbx
batchproc.bat:
Code: Select all
rem create a backup
xcopy /s /e C:\Users\MyUserName\Documents\ManiaPlanet\Maps c:\Users\MyUserName\Documents\ManiaPlanetBackup
rem delete all maps
del /s /q /f C:\Users\MyUserName\Documents\ManiaPlanet\Maps\*.*
rem copy the maps to calculate back, quotes in case of blanks in file names
for /f "tokens=*" %i in (maplist.txt) do xcopy /s /e "C:\Users\MyUserName\Documents\ManiaPlanetBackup\Maps\%i" "C:\Users\MyUserName\Documents\ManiaPlanet\Maps\%i"
rem start shadow calculation
"C:\Program Files (x86)\ManiaPlanet\ManiaPlanetLauncher.exe" /computeallshadows /useronly /collections=Storm /LmQuality=Ultra
rem copy backup files back, ignore newer ones with /d option
xcopy /d /s "c:\Users\MyUserName\Documents\ManiaPlanetBackup\Maps\*.*" "C:\Users\MyUserName\Documents\ManiaPlanet\Maps"
Attention, in the backup there will be still the older and not recalculated maps!
If you want to copy the newer files back, you can do it as well, but I recommend to do that in a second batch, after you have checked all the calculated maps are good.
backupupdate.bat:
Code: Select all
rem create a backup (or update the backup with newer files only)
xcopy /d /s /e C:\Users\MyUserName\Documents\ManiaPlanet\Maps c:\Users\MyUserName\Documents\ManiaPlanetBackup
Re: Shadow calculation and lightmaps explained
Posted: 18 Feb 2013, 23:15
by niarfman
Thanks for your answer, Tmarc.
Indeed, it's a workaround, but it's a big stuff for few things ^^
and it still compute hidden maps not in the folder but in compressed files.
My question was especially for LuckyBoy who is the one working on this good feature. An idea to enhance it

Re: Shadow calculation and lightmaps explained
Posted: 22 Feb 2013, 23:42
by TMarc
[b][color=#FF8000]LuckyBoy[/color][/b] wrote:eyebo wrote:zarexz wrote:Shadows also seem to get lost after cleaning your cache but I can't put my finger on it yet.
High and Ultra shadows are always saved in your cache. So these will disappear if you clear your cache. Only default quality shadows are saved in map files. This is apparently desired functionality, from what communications I've had with Nadeo about it. The higher quality shadows in the cache still provide more calculations for the default shadows saved in the map file. So quality is still increased by calculating them. But this would explain why the shadows might disappear after cleaning your cache.
To make things a bit clearer, computed shadows with at least "Fast Quality" are saved as separate files in your cache folder (also used by p2p downloads), if the current map is "bound to a file" (this is the case when you just load a map from a file, but not when you've edited a loaded map and not saved it yet).
Fortunately, if you load a map, edit it, compute shadows, and then save, the locals cache will be saved at the map save point (because they're up-to-date).
Indeed if you clean your cache, you'll loose all your local shadow caches, but the embedded caches in the map won't be lost. This mean you'll still be able to play with the maps on multiplayer, but in the map editor, the compute dialog will display that nothing has been computed (this dialog ignores the embedded cache).
Thanks
Re: Shadow calculation and lightmaps explained
Posted: 27 Feb 2013, 23:25
by niarfman
Stadium² is out now
I am computing old Stadium² Forever Maps to test them on Stadium² but the ingame script does nothing whith "/collections=TMStadium". But the maps can be computed by removing "collections" option.
Do someone find the correct keyword ?
And what is about the possibility to specify a specific folder to compute ... ?
Re: Shadow calculation and lightmaps explained
Posted: 27 Feb 2013, 23:30
by jonthekiller
It's /collections=Stadium
For the folder I don't know.
Re: Shadow calculation and lightmaps explained
Posted: 28 Feb 2013, 00:35
by niarfman
Nice thanks, it's working fine
