Extract Textures From A Map .bsp: Tips and Tricks for Customizing Maps
- lyamaycampdistu
- Aug 17, 2023
- 3 min read
Releasing reproductions, modifications, or approximations of another's work without permission nor credit may be considered rude to the author, is largely frowned upon, and is in fact copyright infringement, which may have legal consequences depending on the source of the map. There are methods of preventing maps from being fully decompiled (by obfuscating textures, entities, etc.), but these are rarely used because they can usually be worked around, and most people who decompile maps are doing so to learn from them rather than to steal.
The model being used for this process is show below, it has a combination of 'curved' ('arched' or 'vaulted' ceiling) and 'flat' (planar) surfaces that make up the physical structure of the object to be exported from Blender 3D as a *.map. It also has materials and corresponding textures applied to different sections of the mesh (in this case separate 'wall', 'floor', 'ceiling' and 'pillar' textures).
Extract Textures From A Map .bsp
Hammer is the official level editor used by Valve, which has been used on all Valve products dating from the original Half-Life. It has access to all of Left 4 Dead's textures and models and can accept custom textures and models as well. Hammer can read uncompiled maps and allow users to make their own custom maps, which are saved in .vmf format. Compiling tools are built into Hammer, making compiling maps easy, though time-consuming.
It is also possible to decompile .bsp map files back to .vmf files, that can be viewed and loaded by Hammer for educational purposes (the maps could be someone else's property, respect copyright!). The free public program BSPSource allows this operation. If the .bsp map file is inside a .vpk file you will need to open it with GCFScape, extract the .bsp file from the maps folder to any other place outside the .vpk and then it can be decompiled.
You will need the .map file for the map you wish to port to Source. I would recommend getting this from the original map maker if they still have it, or you can decompile the .bsp using the Q3Map2.exe included with GtkRadiant (this is less accurate than the original file).
Doom RPG renders textures in vertical strips, from left to right, just like old raycasters like Wolfenstein 3D and Doom. It would be convenient, then, to store the textures on their side, beginning with the left-most strip, so that each strip could be read sequentially, which is precisely how they're laid out. A naive rendering (each pixel in sequence from left-to-right, top-to-bottom) will produce a mirror image of the texture, rotated 90-degrees to the left.
Group 1 maps wall textures to color palettes. As each texture is used with different palettes, we end up with 51 records instead of 26. Each record is 8 bytes in length, being composed of two uInt32's. The first uInt32 indicates the wall texture (from wtexels.bin), the second indicates the palette (from palettes.bin). How, in both cases, is not obvious. To find the texture index, divide by 4096. To find the texture offset, divide by 2 and add 4. To find the palette index, divide by 16. To find the palette offset, add 4.
Group 3 contains 93 records. Each record consists of a single uInt16. This maps the wall texture id from the line segment portion of .bsp files to the wall textures in Group 1. For example, The wall texture assigned to the Portal (in reactor.bsp) is 34, but the wall texture is at index 24. The value at Group 3 index 34 is 24.
- If you are not interested in developing a whole mod, but only in having some custom models and textures, this is much easier to achieve, and you don't need to distribute any "mod pack" for ppl to be able to see your custom stuff apart from your .BSP map file itself, becasue all of that can be pack into the .BSP as I already told you. the way to go about that is this:
1. First of all, you need to extract the desired model from the file pak01_dir.VPK you have into your folder portal 2/portal2. You'll need GFCScape. With this program you'll be able to see inside the .VPKs and extract (right click > Extract) whatever file. You'll need these 5 files for the model personality_sphere.MDL:
So now you've got a hexed model that must be located in your folder models/npcs/arachnaphob_sphere/ so that your game can load it correctly, and this hexed model will read its textures from inside the folder materials/npcs/arachnaphob_sphere/, ok?
I am writing a Quake 1 .BSP import script with python and I want to extract the textures from the .BSP so that the mesh can be textured. However, the textures are paletized (instead of a color, only an index into a palette is stored for each pixel) and the palette is not contained in the .BSP. 2ff7e9595c
Comments