A short informative guide aimed at helping users inject valid bitmaps into their modified map files
By JacksonCougar
Preamble: this guide assumes that you know how to create a texture in Photoshop, and that you know how to export from Photoshop into a .DDS bitmap format. This guide further assumes that you are using Entity to inject your bitmaps with.
Beginning: the most important two things that you must always check when injecting a bitmap into any map-file using Entity are the original bitmap dimensions, and the original bitmap format. Entity cannot inject a larger bitmap into a smaller bitmap—in regard to dimensions—because Entity is incapable of adding extra data into a map-file while injecting a bitmap. While Entity may be able to inject a smaller bitmap into a larger bitmap—again in regard to dimensions—it is highly unfavorable to do this because it will create a hole in the map-file which entity will be unable to repair, and may lead to you map becoming irreparably corrupt during further modification. The second important factor when injecting a bitmap back into the map-file is the original bitmap format. Entity is incapable of updating the format of the bitmap in the map-file bitmap meta due to a shortcoming in the injection code, as well as the problem this would pose to being unable to control the data-size of the injected bitmap: that is to say that if a user were to inject a higher bits-per-pixel image format of equal dimensions into a bitmap of a lower bits-per-pixel format, the resulting data would not be the same size despite the dimensions of the images being the same!
Continuing on: the next important factor when injecting a bitmap using Entity is the mip-map count of your .DDS bitmap. Entity will not be able to update the mip-map count of a bitmap in the map-file because of the previously mentioned restriction on the data-size of the bitmap. Therefore it is important to set the proper mip-map count in your bitmaps while exporting them from Photoshop or else entity may corrupt data past the intended bitmap data! The next big restriction in Entity is the fact that it is unable to inject into the LOD 2 or 3 bitmap locations. Instead of injecting your new bitmap into those LOD locations, it will keep the original data!
The best solution: if you are determined to use Entity to inject bitmaps—and to be honest there really is not a good alternative at the moment—then I would strongly suggest this following method to you: build your own custom tags to inject your bitmaps into. In order to go about this you will want to do several things:
- Select a bitmap format for your custom image using the Entity meta-editor. Save.
- Select a bitmap usage for your custom image using the Entity meta-editor. Save.
- Input the width and height values of your custom bitmap using the Entity meta-editor. Save.
- Inject a bitmap—one that matches the specifications you made above—into your edited tag.
- Select Parsed in the Save Meta Options
- Save your tag into a new directory using the Save Meta button
- Go to the directory where you saved your bitmap
- Find a file with the name of the original bitmap and which ends with the extensions .bitm.xml (Windows may hide the .xml extension)
- Edit the file in a plaintext editor like notepad
- Find the line in the file where there is an entry for TagName=”[…]” and replace the existing text with a new tag name of your choosing