
Unreal Level file content - reverse engineering
Unreal Level file content - reverse engineering
Has anyone tried to disassemble unr file to check where are actors, where's lightmap stuff etc.? I wonder if, for example, lightmaps could be replaced with externally calculated ones, having nice baked global illumination, smooth edges and stuff 

Re: Unreal Level file content - reverse engineering
Yes.Has anyone tried to disassemble unr file to check where are actors, where's lightmap stuff etc.?
No. Lightmaps aren't stored as ordinary textures, but as one-bit "hits/doesn't hit" data per each light. This also allows dynamic non-moving lights to have shadows. At best, you could fuzz the borders and hope they look good after Unreal smooths them.I wonder if, for example, lightmaps could be replaced with externally calculated ones, having nice baked global illumination, smooth edges
e-mail: ampoyrex at wp dot pl
Re: Unreal Level file content - reverse engineering
That's actually very interesting! So how are lightmaps generated? Engine bakes them in runtime before level shows up, just using masking data from file?
I've just peeked into map file in hex viewer. I guess I see which data portion is lightmap but it seems to display different values than $00/$FF from time to time. Isn't the mask 8bit grayscale by any chance? Unless one byte is just a combination of up to 8 lights on/off per texel.
I've just peeked into map file in hex viewer. I guess I see which data portion is lightmap but it seems to display different values than $00/$FF from time to time. Isn't the mask 8bit grayscale by any chance? Unless one byte is just a combination of up to 8 lights on/off per texel.
Re: Unreal Level file content - reverse engineering
You can observe when lightmaps are generated by doing something like "set light lightbrightness/hue/saturation <number>" and walking around until you see the changes. I think this happens after PreBeginPlay. You can also do "flush" to update all lightmaps. UsePrecache may also affect this somehow.
No, one byte stores 8 texels, although these masks are blurred on runtime, creating grayscale images.
No, one byte stores 8 texels, although these masks are blurred on runtime, creating grayscale images.
e-mail: ampoyrex at wp dot pl
Re: Unreal Level file content - reverse engineering
I know that 'flush' updates all lights but I didn't know the command for specific lights
Thanks, that was very insightful! Did you use this file research in any particular project? Is map format breakdown published anywhere? 


Re: Unreal Level file content - reverse engineering
Yes, some time ago, I wrote a program which after taking tons of shortcuts and cutting tons of corners could approximate the experience of playing Unreal maps.
Here's a partial specification of the format:
http://utgl.unrealadmin.org/UT_Package_ ... at_pdf.zip
But it doesn't mention level-related structures like the BSP tree or lightmaps. To get that, visit the other link and look into the source code.
Here's a partial specification of the format:
http://utgl.unrealadmin.org/UT_Package_ ... at_pdf.zip
But it doesn't mention level-related structures like the BSP tree or lightmaps. To get that, visit the other link and look into the source code.
e-mail: ampoyrex at wp dot pl
Re: Unreal Level file content - reverse engineering
Thanks a lot! <3