Game Development Community

Generating lighting file from command line ?

by Orion Elenzil · in Torque Game Engine · 02/08/2006 (8:08 pm) · 7 replies

As part of our automated build process,
it would be nice to generate the .ml lighting file via command line.

right now i just added a command line flag which closes the app after lighting,
but that's kind of kludgy, opens a graphics window, isn't really a command-line solution.

any thoughts ?

thanks,
orion

#1
02/15/2006 (11:55 am)
That is a very good question... and one that I am interested in knowing the answer to as well! I suspect it would be quite tricky as I think the level needs to be loaded first, before lighting can happen. The dedicated server code wouldn't suffice either as that just loads the server objects and doesn't do any lighting at all...

It would certainly save on some valuable download size space...

Edited because I'm dumb and don't know how to form a proper sentence...
#2
02/16/2006 (12:49 pm)
Why would you want that? If you want to minimize rendering time on an already established level, you might want to turn off automatic mission relighting.

[EDIT] I just noticed that I already uttered this opinion in a TLK thread.
#3
02/16/2006 (12:59 pm)
Hi Dirk, thanks for replying.

I want this to be part of our automated build/release process.

That is, there's scripts (ant scripts) which get the latest version of code & assets from source control, build the engine, compile the .cs files into .dso's, strip out files we don't want the end-user to have (eg .cs), run the install-builder, and finally poops out a install executable and uploads it to a download site.

It's useful because it's automated, and therefore repeatable.

Lighting our mission currently takes 10+ minutes on a pretty speedy machine,
so we want to include the lighting file in the installer,
and so i'd like a nice command-line way of doing the lighting and then quitting.

As i mentioned, i added a command line flag which quits after lighting,
and that works well enough, but it's a bit kludgy and doesn't integrate well into the rest of the scripts.

@ stephane - i'm not sure i understand. pre-lighting the mission actually increases your download size, but it shortens the first-time startup of the app.
#4
02/16/2006 (1:30 pm)
Now I see what you are getting at. Actually, that's a great idea.

Maybe here's a hint: I noticed that on a freshly installed PC with an ATI graphics card, the TGE demo started, but there wasn't a window except for the DOS box. Of course I forgot to install the ATI drivers, so the TGE logfile was full of OpenGL errors. The funny part was that the demo actually was working without a graphic context. AFAIK it also created the lighting files.

So maybe one (bit dirty) way to accheive this would be to cut off the graphic output and force to quit the game right after it started.
#5
02/18/2006 (3:33 am)
@Orion: I'm talking about not including the .ml file in the download (could save a couple hundred kilobytes of downloading) but just building it when the game installs. So rather than have the user wait the minute or two while loading the level the first time, have them just wait a few minutes while installing...
#6
02/18/2006 (10:45 am)
Oh i see, right. good idea.

it may be possible to do the lighting w/o opening a window,
or alternatively,
just run the client in the last stage of install with interface stuff that says it's still installing.

if you're interested i can tell you where i have the client quit(); after lighting, but it wasn't tricky.
#7
02/18/2006 (7:41 pm)
Thanks Orion for the offer, but if I was going to do it, I would want to do it fairly cleanly and seamlessly... Opening the game isn't really an option.

I'm not all that worried about it, I mean I'm sure I can trim ~200k from the download size in other areas.

If you do get some kind of command line only option working, definitely let me know!

Take care,

Stephane