A compile.bat if anyone wants one (Now posted!)


(MadJack) #1

Alright… Since there seems the be lots of people using custom .bat files to compile and given some people have problems with the compiles I decided to make a BIG .bat file asking you choices of kind of compiles. BSP, VIS and Light. The choices are the same as those in Radiant.

You can either chose to have the output saved in a txt file or on the screen. At the end it’ll ask to open those log files for you. You can either start a compile form a DOS window already opened by putting compile.bat mymap.map or drag/drop the map file on it in windows explorer.

Now this bat file is over 5 KB and I don’t think it’d be a good idea to post it like that here… I think it’d be very rude hehe so maybe I could upload it somewhere since I don’t really have any website to post it to.

If you want to use it, open the file after getting it and modify the FIRST THREE lines to reflect your installation.

It worked pretty good here.

Last note: AFAIK, it should only work on WinXP. I wouldn’t bet much on Win9x…

So if anyone wants to host it… reply here :slight_smile:


(MadJack) #2

If anyone wants it real bad contact me while I find a home for it.


(Victorianetza) #3

i will host it :slight_smile: just give it to me :smiley:


(shazmax) #4

Send it to Victorianetza and I’ll download it from there. I’d be interested in seeing how it would compile vs using the standard gtkradiant compile.


(Ifurita) #5

i’d just post it


(MadJack) #6

5K iffy? That’s a bit harsh :smiley:

I still have one tiny bit to fix (.log file gets written in \windows\ dir instead of \maps) Easy to fix but I just don’t have the time right now… I’ll probably send it to Victorianetza later today or tomorrow.


(Ifurita) #7

I don’t think so, people have posted long files before. My game autoexec is 13Kb and I’ve posted that before. The testserver config I posted was 4 and no one had problems with that. Just copy it in with the CODE tags around it


(MadJack) #8

Alright then…

Here’s the compile.bat file. You can either use “compile.bat mymap.map” from a DOS window or drag & drop the map file on the .bat file.

Don’t forget, I’m not sure at ALL if it’ll run under Win98/95/NT/2000. It sure runs on XP though.

Please contact me if you meet any bugs/problems or if you improve it.

Thanks :smiley:

Drop the following in a txt file which you will rename compile.bat or any name you wish as long as it ends with .bat


ECHO off
REM ------------------------------------------------------------------
REM ---- Author: Dany "MadJack" Rioux	(danyrioux at vfemail.net)
REM ---- Date: April 14th 2004
REM ---- Subject: Automation to compile .map files (ET only!) asking
REM ---- questions etc... Try it! :D
REM ---- 
REM ---- Please if you modify it tell me so I can update the
REM ---- one I have locally.
REM ---- 
REM ---- Happy mapping!
REM ---- 
REM ---- Don't forget: You don't know what you have until you lose it.
REM ------------------------------------------------------------------

cls
REM ------------------------------------------------------------------
REM ---- Edit the first TWO lines to reflect your installation!!!
REM ------------------------------------------------------------------

set ET_PATH="C:/Program Files/Wolfenstein - Enemy Territory/"
set Q3MAP_PATH="C:/Program Files/Wolfenstein - Enemy Territory/etmain/maps/q3map2/q3map2.exe"

REM ------------------------------------------------------------------
REM ---- Leave the rest alone if you are not sure of what you are doing
REM ------------------------------------------------------------------

set MAP="%~dp1%~nx1"

set GEN_OPTIONS=-fs_basepath %ET_PATH% -game et

REM ------------------------------------------------------------------
REM ---- Setting the vars up -----------------------------------------
REM ------------------------------------------------------------------

set light1=-light -fast -filter -thresh .5 -super 2
set light2=-light -fast -samples 2 -filter
set light3=-light -fast -filter -samples 2
set light4=-light -fast -filter -samples 2 -bounce 8
set light5=-light -fast -filter -samples 2 -bounce 8 -patchshadows
set light6=-light -fast -filter -patchshadows -thresh .5 -super 3
set light7=-light -sunonly

set BSP1=-meta
set BSP2=-debugportals -debugsurfaces
set BSP3=-meta -patchmeta

set vis1=-vis -saveprt
set vis2=-vis -fast -saveprt

set empty=
set LogFileName=empty

REM ------------------------------------------------------------------
REM ---- Getting inputs for BSP --------------------------------------
REM ------------------------------------------------------------------

:BSP_compile
cls
ECHO.
ECHO Please choose the number reflecting the BSP compile you want.
ECHO.
ECHO 1	%BSP1%
ECHO 2	%BSP2%
ECHO 3	%BSP3%
ECHO 4	No BSP compile.
ECHO.

set /p BSP_input=

if %BSP_input% LSS 5 (
	goto gotBSP )
	ELSE (
		goto BSP_compile
	)

REM ------------------------------------------------------------------
REM ---- Getting inputs for light compile ----------------------------
REM ------------------------------------------------------------------

:light_compile
cls
ECHO.
ECHO Please choose the number reflecting the LIGHT compile you want.
ECHO.
ECHO 1	%light1%
ECHO 2	%light2%
ECHO 3	%light3%
ECHO 4	%light4%
ECHO 5	%light5%
ECHO 6	%light6%
ECHO 7	%light7%
ECHO 8	No LIGHT compile.
ECHO.

set /p LIGHT_input=

if %LIGHT_input% LSS 9 (
	goto gotlight )
	ELSE (
		goto light_compile
	)


REM ------------------------------------------------------------------
REM ---- Getting inputs for vis --------------------------------------
REM ------------------------------------------------------------------
:vis_compile

cls
ECHO.
ECHO Please choose the number reflecting the VIS compile you want.
ECHO.
echo 1	%vis1%
echo 2	%vis2%
Echo 3	No VIS compile.
Echo.

set /p VIS_input=

if %VIS_input% LSS 4 (
	goto gotvis )
	ELSE (
	goto vis_compile
	)

REM ------------------------------------------------------------------
REM ---- Getting inputs for Logging ----------------------------------
REM ------------------------------------------------------------------
:logging

cls
echo.
echo Do you want to log the output to files?
Echo.
echo 1	Yes
echo 2	No
echo.

set /p Logging_input=

if %Logging_input% LSS 3 (
	goto gotlogging )
	ELSE (
		goto logging
	)
	
REM ---------------------------------------------------------------------
REM ---- Routines to handle the user inputs -----------------------------
REM ---------------------------------------------------------------------

:gotBSP

if %BSP_input% EQU 4 set BSP=None
if %BSP_input% EQU 3 set BSP=%BSP3%
if %BSP_input% EQU 2 set BSP=%BSP2%
if %BSP_input% EQU 1 set BSP=%BSP1%
goto light_compile

:gotlight

if %LIGHT_input% EQU 8 set Light=None
if %LIGHT_input% EQU 7 set Light=%light7%
if %LIGHT_input% EQU 6 set Light=%light6%
if %LIGHT_input% EQU 5 set Light=%light5%
if %LIGHT_input% EQU 4 set Light=%light4%
if %LIGHT_input% EQU 3 set Light=%light3%
if %LIGHT_input% EQU 2 set Light=%light2%
if %LIGHT_input% EQU 1 set Light=%light1%
goto vis_compile

:gotvis

if %VIS_input% EQU 3 set VIS=None
if %VIS_input% EQU 2 set VIS=%vis2%
if %VIS_input% EQU 1 set VIS=%vis1%
goto logging

:gotlogging
if %Logging_input% EQU 1 (
		set LogFileName=compiled.txt 
		Echo Log files will be called
		Echo.
		Echo BSP_compiled.txt
		Echo VIS_compiled.txt
		Echo and LIGHT_compiled.txt
		Echo.
		Echo They will be placed in: "%~dp1"
		Echo.
		Echo Starting compiling process...
		Echo.
		)

REM ---------------------------------------------------------------------
REM ---- Compiling with the options given -------------------------------
REM ---------------------------------------------------------------------

:runcompile

if %BSP_input% EQU 4 goto runcompilevis
if %LogFileName%==empty	%Q3MAP_PATH% %BSP% %GEN_OPTIONS% -v %MAP%
if not %LogFileName%==empty (
		echo. 
		echo Running BSP... 
		%Q3MAP_PATH% %BSP% %GEN_OPTIONS% -v %MAP% >"%~dp1BSP_compiled.txt"
	)
	
:runcompilevis

if %VIS_input% EQU 3 goto runcompilelight 
if %LogFileName%==empty %Q3MAP_PATH% %VIS% %GEN_OPTIONS% -v %MAP%	
if not %LogFileName%==empty (
		echo.
		Echo Running VIS...
		%Q3MAP_PATH% %VIS% %GEN_OPTIONS% -v %MAP% >"%~dp1VIS_compiled.txt"
	)

:runcompilelight

if %LIGHT_input% EQU 8 goto end (
if %LogFileName%==empty %Q3MAP_PATH% %LIGHT% %GEN_OPTIONS% -v %MAP%
if not %LogFileName%==empty (
		echo.
		Echo Running LIGHT...		
		%Q3MAP_PATH% %LIGHT% %GEN_OPTIONS% -v %MAP% >"%~dp1LIGHT_compiled.txt"
	)

:end

REM ---------------------------------------------------------------------
REM ---- That's it! We're done. Leave here. -----------------------------
REM ---------------------------------------------------------------------

Echo.
Echo Done! :D
Echo.

if %Logging_input% EQU 2 (
	pause 
	goto TheEnd
	)

Echo.
Echo If you want to open those Logs hit 1 and ENTER.
Echo.
Echo Any other key will close that window.

set /p OpenTxtFiles=

if %OpenTxtFiles% EQU 1 (
	"%~dp1BSP_compiled.txt"
	"%~dp1VIS_compiled.txt"
	"%~dp1light_compiled.txt"
	)

:TheEnd

EDIT: Fixed a little bug in VIS input checking routine.


(Ifurita) #9

Nice work. For those of use who are .bat illiterate, how does it know what map we want to compile? Where should my .map file go?


(MadJack) #10

As I say above, drag & drop the mymap.map file form the windows explorer on the .bat file or open a window prompt and go where you put the .bat file and then type:

batfilename.bat mymap.map

It’ll take the mymap.map, extract the whole path (even if you didn’t put any) and tell q3map2 to use that as a map… as far as bsp, it’ll make it where the .map file is I guess… LOL I didn’t test/check that :smiley:

The way I set it here is I put the .bat file in my <ET>/etmain/maps and it works. :smiley:

There are LOTS of other options to chose from and I had to stop myself cause there would be so much stuff I could do with that… :smiley: Anyway, if there are really nice options you all want it can easily be modified to put those.

Happy compiling :wink:


(shazmax) #11

Nice!


(MadJack) #12

I just realized that putting EDIT in the .bat post is not a good idea… So if I make changes, I’ll post it as a new reply.

I fixed a little bug where if you’d say None in VIS it’d try to run with None… Do I need to say it didn’t work? :smiley:


(shazmax) #13

Since we’re doing bat files.
Here’s what I use to view my maps for testing so I don’t have to set all the /sv_pure 0 options and such. Just copy this and put this in a text file, then rename where it says “yourmapname” to your map name without the quotes. Save it as a text file then rename it to a .bat file extension.

“C:\Program Files\Wolfenstein - Enemy Territory\ET.exe” +set g_gametype 2 +set developer 1 +set sv_pure 0 +devmap yourmapname


(MadJack) #14

Oh and thanks shazmax and Iffy :smiley:

warm and fuzzy feeling :wink: lol


(shazmax) #15

Oh and for placement I just put mine in the C:\Program Files\Wolfenstein - Enemy Territory directory. Should work for all windows systems.


(MadJack) #16

In the long/short run, it doesn’t really matter where you put it. Where the bsp ends up is a different story though. So make sure the compiled map gets in …/maps/ dir.


(Victorianetza) #17

tnx madjack :smiley: i just figured out how to solve the problem with the objectives: i used entity score with 10 and with 20 therefore i had problems with last man standing :banghead:


(MadJack) #18

No probs Victorienetza, my pleasure


(ratty redemption) #19

@MadJack, that`s a cool .bat file you wrote, but here is an extract of a thread in the q3amp2 forum, where ydnar was recommending someone changed some of the light compile switches.

Remove these switches:

-filter
-smooth
-super 2

and add these switches:

-fast
-samples 2

The reason is, -fast lighting is OK for final compiles, -smooth is the same as -samples 2, -super 2 requires 4x the memory and compile time with approximately the same benefit as -samples 2, and -filter disables -smooth or -samples 2 anyway, rendering it ineffective.

Also make sure you’re supplying a correct -fs_basepath argument.

edit:

and does anyone here use custom .proj files to compile?

I know most people like batch files but I`ve always used the menus in radiant, with custom bsp lines.

in the past this used to be done by editing radiant .qe4 files… works similar to a batch file but with the advantage it will compile the name of the current map loaded into radiant.

I`m not suggesting people stop using .bat files just pointing out there is another method available.


(MadJack) #20

Ratty, the thing with radiant’s compile switch is the limitations. patchmeta and a lot of other options are non-existant. I guess we could add some manually but I prefer .bat files because I really don’t like the connection radiant/q3map2… Yes I know I could disable it. I just feel more in control this way.

-smooth is not in any of the light options
-fast is in all of them, except one
-sample is in 4 out of 6.

I kept -super in 2 light compile because I know there are some people that like to use that option.

I would’ve love the idea of having each one of the options individually selectable but that would make even more spaghetti code. Batch files is not a pretty programming language :wink: if you can even call it that.

As for most switches I use above, I read ydnar’s comment on shaderlabs about them. For now, I think those are the best unless I get some request.

Oh and thanks :slight_smile: