BF1942 Debugger Multifunctionality Tutorial

Lots of cool and useful tips to mod either serverside or clientside
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

BF1942 Debugger Multifunctionality Tutorial

Post by Senshi »

Creating Object Lightmaps, Terrain Lightmaps and Merging Lightmaps with the debugger
1.) Create a folder in your root BF42 folder named "ShadowWork".
2.) Here you have to set up folders with the regular game paths (so create a folder "levels", then create a folder with "Mapname", then with "Textures". (so it looks e.g. like "Battlefield 1942\ShadowWork\bf1942\levels\MAPNAME\textures\")
3.) Put your maps' texture files (Tx01x01.dds etc.) in "Textures" as well as objectlightmaps/terrainlightmaps.con in the map main folder.
4.) Now you have to convert all the dds files into tga so the debugger can work with them, it can't work directly with dds!

Now you can decide on how you want this. You can either create batch files (.bat) or simply use modified shortcuts. Procedure is the same really, so I'll go for shortcuts.
1.) Create a shortcut of the Bf1942_r.exe
2.) Now open its properties and change the "target" line like this:

Code: Select all

BF1942_r.exe" +game DesertCombat +workingFolder "ShadowWork\" +traceTerrainShadows "bf1942\levels\MAPNAME\" MAPNAME\lmList.dat "ShadowWork\bf1942\levels\MAPNAME\textures"
This line is for generating terrain lightmaps.

Now repeat repeat these two steps and use these codes for the other functions:
Generating Object Lightmaps:

Code: Select all

BF1942 +game DesertCombat +workingFolder "ShadowWork\" +traceObjectShadows "bf1942\levels\MAPNAME\"
Merging Lightmaps:

Code: Select all

BF1942 +game DesertCombat +workingFolder "ShadowWork\" +mergeTerrainShadows "bf1942\levels\MAPNAME\ 1.5 0.6"
There should appear a new subfolder called "merged" with the merged textures. Remember to convert them back to dds to decrease filesize when you pack your map up later.

Now you have 3 shortcuts which allow you to quickly generate lightmaps etc. for your maps without ever having to start BC42 :) . Obviously you always have to edit them for the correct MAPNAME, but that's a matter of seconds.

Creating .rfa with the debugger
There is a genuine reason why you should use the debugger for packing your .rfa files. It doesn't break them. Every other GUI tool out there destroys parts of .rfa files during packing up. Even the famed WinRFA has a flaw: If you compile your map data with it, it destroys the envmap.rcm and thus you will have NO Envmap effects on your map (the chrome shiny reflections on some weapons&vehicles).

And, it's simple and super fast too :) .

Initial setup:
The debugger only packs files that are in "Battlefield 1942 (your game root)\bf1942". Same rules as for lightmap generation apply, you have to set them up acording to the BF filepaths. So mapfiles go in "Battlefield 1942\bf1942\levels\MAPNAME\" . Same goes for every other rfa files, just put them in the correct folder :) .

Then simply create a shortcut to your bf1942_r.exe and add this to the "Target" line in its properties:

Code: Select all

+makeArchive Bf1942/Levels/MAPNAME 1 1
I think the commands are pretty self-explanatory, but ask if you have questions.

______________________________________________
I have all this awesome knowledge from "Apache Thunder" and only rewrote it to give it a tutorial form :) .
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: BF1942 Debugger Multifunctionality Tutorial

Post by Poow »

Senshi wrote:

Code: Select all

BF1942_r.exe" +game DesertCombat +workingFolder "ShadowWork\" +traceTerrainShadows "bf1942\levels\MAPNAME\" MAPNAME\lmList.dat "ShadowWork\bf1942\levels\MAPNAME\textures"
This line is for generating terrain lightmaps.
I get this error for the terrain:
http://www.abload.de/img/unbenanntj2dt.jpg
You’re entering a world of pain!
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: BF1942 Debugger Multifunctionality Tutorial

Post by Apache Thunder »

Those are just a few of the harmless screwups from the DC coders (that if DC is the mod your doing this in). Just ignore that error (click retry to ignore further instances of that type of error). Obviously issues with sound files won't effect light map generation. :P

By the way, only the debugger complains about some errors while the retail exe will ignore them.

Also, I've never gotten the terrain merger to work properly. It would always result in smurfed terrain. I also could not merge the terrain without first converting the terrain textures to TGA and dropping them in with the lgt TGA files. Otherwise it would refuse to merge them. (it would just exit without saying a peep). When I mean "smurfed terrain", I mean the resulted files would be useless because they are either all red, purple, or some other horrid random color hue to them. I have always had to merge them manually. :( (as in use a separate program to do the merging of the textures one at a time. :( )
Last edited by Apache Thunder on Sat Dec 12, 2009 12:50 am, edited 4 times in total.
ImageImageImage
I have cameras in your head!
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: BF1942 Debugger Multifunctionality Tutorial

Post by Poow »

It is for DC ;)
Thanks!
You’re entering a world of pain!
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: BF1942 Debugger Multifunctionality Tutorial

Post by Poow »

This error appears for every custom object:
At least for every object I made, not the normal custom DC objects from other maps. I stopped the process some seconds later..
http://www.abload.de/img/unbenanntnsa8.jpg
You’re entering a world of pain!
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: BF1942 Debugger Multifunctionality Tutorial

Post by Senshi »

Hm, merging lightmaps worked fine for me. Of course I always had to convert to tga first, but then running the merger always gave nice and smooth merged files, no "smurfing" whatsoever...no idea what's causing this. Did you use the retail exe or the debugger for this? (I use debugger for everything ;) ).

Oh, and would you head over to http://bfmods.com/viewtopic.php?f=9&t=16 and give my question a look? :)
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: BF1942 Debugger Multifunctionality Tutorial

Post by Poow »

Senshi wrote:Did you use the retail exe or the debugger for this? (I use debugger for everything ;) ).
I use the "BF1942_r.exe" I don't know a different executable file in relation to the debugger :?


Maybe I just missed to generate a shadow mesh or something during the export in 3dsmax? (I though this goes only for PCO..)
http://www.abload.de/img/unbenanntwmi3.jpg

When I ignore the error messages everything looks good but I can't see any shadows in the tga files... Also don't get a "merged" subfolder after the last step :/

@ your question:
I'm too noobish to see something that gives a hint to me neither something where I can help you out with ;)
Or what exactly was your intention?
You’re entering a world of pain!
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: BF1942 Debugger Multifunctionality Tutorial

Post by Senshi »

Actually my whole topic was directed at Apache ;) .

Which progress exactly doesn't work? Generating object lightmaps? Terrain lightmaps? Or the merging of terrain lightmaps? You are pretty vague about this ;) .

If object lightmap generation doesn't work, the reason is simple: You need the .samples files for them so BF can do something with them.

And 3dsmax doesn't generate shadow meshes for your custom objects. You need to do that on your own (simply take a LOD03 or LOD04 of your object, copy it and rename it to shadow_OBJECTNAME), then export again with "Use Object names for export", voila, shadow mesh included.
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: BF1942 Debugger Multifunctionality Tutorial

Post by Poow »

Yea, I get an error while creating the object shadows.
When I import a normal bf1942 model to 3dsmax, there is no shadow mesh....
That's kinda strange.

I copied LOD03_maze_m1-1 to : shadow_maze_m1
Exported it.
When I import the model, there is the shadow_maze_m1 . Why isn't there a shadow mesh for all the other vanilla objects when I import the files?
You’re entering a world of pain!
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: BF1942 Debugger Multifunctionality Tutorial

Post by Senshi »

Because statics don't need it, they require the .samples files I spoke of, these have to be in your Battlefield 1942\Standardmesh folder. But I have no idea how to create samples (IIRC there was a tool for that somewhere), never did this myself.
Post Reply