Lightmapping a non-vanilla map in Battlecraft 1942?

Ask questions, discuss ideas, get answers

Lightmapping a non-vanilla map in Battlecraft 1942?

Postby Skull Kid » Fri Jul 03, 2020 8:09 pm

I have seemigly tried everything. I cannot get Battlecraft 1942 to lightmap or generate shadows on my own map "The Hill". It won't show any shadows in Battlecraft 1942 or in-game either. Any clues why this occurs?

Thanks in advance to anyone for help!
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 153
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: Lightmapping a non-vanilla map in Battlecraft 1942?

Postby duffman » Sun Jul 05, 2020 7:52 am

Every object that you want to cast a "shadow" needs to have a ".samples" file in:
C:\Program Files (x86)\EA GAMES\Battlefield 1942\StandardMesh\
or
C:\Program Files\EA GAMES\Battlefield 1942\StandardMesh\

And ofcoz the model should be in there as well.
Example:
afr_house1_ste_closed_m1.rs
afr_house1_ste_closed_m1.sm
afr_house1_ste_closed_m1.samples

The models needs to be "properly" done, but thats a different topic...

Assuming you are using bf1942, or bf1942_r to do raytracing, these files contain the parameters
for your map, default is probably fine, stuffing them up not so much..
terrainLightmap.con
objectsLightmap.con

But without the .samples files you dont get any shadows at at all..

Learn more about samplesmaker here:
http://www.cajunwolf.com/dev/sampmaker.php

When you do generate object or terrain shadows do you see a "console" doing some sort of processing, if you do then the problem is one of the above, if you see nothing at all or it seems to "crash" or start then quickly go away then you have different issue...
duffman
 
Posts: 48
Joined: Tue Apr 15, 2014 8:02 am

Re: Lightmapping a non-vanilla map in Battlecraft 1942?

Postby Skull Kid » Sun Jul 05, 2020 9:51 am

Yes, I do see a console window coming up when trying to generate shadows for my map, but once it is done, and then merges the shadows, I see no change on the actual map.

I also used the SamplesMaker by CoinCoin to generate shadows for the wanted objects to cast shadows, but no difference in Battlecraft 1942, despite lying in the Battlefield 1942 root folder, under StandardMesh.
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 153
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: Lightmapping a non-vanilla map in Battlecraft 1942?

Postby duffman » Mon Jul 06, 2020 3:30 am

yea that sounds a bit weird.

Check the folders under:
C:\Program Files (x86)\EA GAMES\Battlefield 1942\ShadowWork\bf1942\levels\YOUR_MAP

\ObjectLightmaps
Contains lightmap for each object in the map that was rendered and would/should
be added to RFA file.

and

\textures
Should contain your terrain textures unmerged, and the pure lightmapped as _lgt.tga files.

\textures\Merged
Contains the merged version of the 2 above and in dds format. These are the files that
should/would be added to the RFA file.

BC42 should add those files automatically to the RFA. But sounds to me like you need to check
there if there is something wrong with some of the files or missing etc. You should be able to
spot if some of the lightmaps are completely white/black etc.

At least should help you to pin point where the problem might be...
duffman
 
Posts: 48
Joined: Tue Apr 15, 2014 8:02 am

Re: Lightmapping a non-vanilla map in Battlecraft 1942?

Postby Skull Kid » Mon Jul 06, 2020 11:22 am

About the objects lightmaps, I'm not getting any object lightmaps when trying to generate them with Battlecraft 1942. It simply pops up a black "console" window with BF1942.exe and then crashes Battlecraft 1942. But generating shadows doesn't make Battlecraft 1942 crash, but doesn't show the shadows.

Anyway, the _lgt.tga is all white. Could this be the problem? I don't even have a merged folder in the map's .rfa archive.

EDIT: It seems that the Battlefield 1942 executable does indeed make the _lgt.tga files show like they should, but not Battlecraft 1942. Wonder why... :?
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 153
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: Lightmapping a non-vanilla map in Battlecraft 1942?

Postby duffman » Mon Jul 06, 2020 11:17 pm

Battlecraft doesnt actually do the raytracing aka shadows/light, it actually executes a shell command to battlefield to do the job.

When you select generate terrain shadows in battlefield and you select which "boxes" (surface area) to render it actually
just saves that into the textures/lmlist.dat as binary number which battlefield uses as a list of boxes to render.

Then it executes bf1942 with arguments to do the job, and thats the black screen that comes up..

Both the bf1942.exe and the debug executable bf1942_r.exe can be used to do the rendering.
I do all the rendering from batch scripts instead, gives you better control, and you can use battlecraft while
its rendering in background. This is pretty much what i use (replace the variable names):

cd /d "C:\Program Files\EA GAMES\Battlefield 1942\"
bf1942_r.exe +game %GAME_MOD_NAME% +workingFolder "ShadowWork\" +traceTerrainShadows "bf1942\levels\%BUILD_NAME%\" %BUILD_NAME%\lmList.dat "ShadowWork\bf1942\levels\%BUILD_NAME%\textures"

Better example maybe:
bf1942.exe +game DesertCombat +workingFolder "ShadowWork\" +traceTerrainShadows "bf1942\levels\dc_vernazza\" "ShadowWork\bf1942\levels\dc_vernazza\textures"

Which is exactly what BC42 runs in the background.

The only drawback with running it this way is that once battlfield has generated all the lightmaps they are not automatically
added to the RFA, you would have to do merge terrain lightmaps in BC42 afterwards..

The terrainLightmap.con is the settings used by battlefield for rendering, make sure you didnt put funny values in there, that
could cause it to crash or create everything black or white etc. This file is pretty much overwritten by BC42 with settings you have
set for light shadows etc. and if got those values messed up you could get black/white lighmaps or crash issue.
duffman
 
Posts: 48
Joined: Tue Apr 15, 2014 8:02 am

Re: Lightmapping a non-vanilla map in Battlecraft 1942?

Postby Skull Kid » Mon Jul 06, 2020 11:20 pm

Alright, thanks for that information duffman =)

I will make sure to look into this soon.
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 153
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: Lightmapping a non-vanilla map in Battlecraft 1942?

Postby Skull Kid » Thu Jul 09, 2020 3:31 pm

I've put this "lightmapping problem" to the side for a bit, and got the wrecks on my map showing up with collisions enabled, thanks to some .con scripting ;)
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 153
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden


Return to 1942 Modding Discussion

Who is online

Users browsing this forum: No registered users and 42 guests