[tutorial] Bitmap Injection Guide

Post your tutorials here, and if decided so, they will be moved to the 'Tutorials' forum.
Post Reply
User avatar
JacksonCougar
Huurcat
Posts: 2460
Joined: Thu Dec 06, 2007 11:30 pm
Location: Somewhere in Canada

[tutorial] Bitmap Injection Guide

Post by JacksonCougar »

Halo 2 Bitmap Injection Guidel
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:
  1. Select a bitmap format for your custom image using the Entity meta-editor. Save.
  2. Select a bitmap usage for your custom image using the Entity meta-editor. Save.
  3. Input the width and height values of your custom bitmap using the Entity meta-editor. Save.
  4. Inject a bitmap—one that matches the specifications you made above—into your edited tag.
  5. Select Parsed in the Save Meta Options
  6. Save your tag into a new directory using the Save Meta button
Now you have a custom tag that you can build into any map and inject a bitmap with those specific properties! If you wish to give your bitmap a unique name—it is required to have a different name than any other tag currently in a map-file in order for entity to build it in—you may edit the name by doing the following:
  1. Go to the directory where you saved your bitmap
  2. Find a file with the name of the original bitmap and which ends with the extensions .bitm.xml (Windows may hide the .xml extension)
  3. Edit the file in a plaintext editor like notepad
  4. 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
If you are following this guide, I would like to point out that I always use the original Iron_Forge plugins for saving and building-in the bitmap tags.
User avatar
NotZachary82
Posts: 1846
Joined: Thu Dec 20, 2007 8:39 pm

Re: [tutorial] Bitmap Injection Guide

Post by NotZachary82 »

That was a nice read. You mentioned a few things I didn't know about bitmap editing; I didn't know you could edit the format without it causing problems.

On another note, would the XML editing work for renaming other tags? :p Heheh.
User avatar
JacksonCougar
Huurcat
Posts: 2460
Joined: Thu Dec 06, 2007 11:30 pm
Location: Somewhere in Canada

Re: [tutorial] Bitmap Injection Guide

Post by JacksonCougar »

It causes issues: I have to revise a few things: like you have to inject the bitmap before selecting a new tag or Entity will error out while loading the tag and you'll not be able to finish the guide.
User avatar
socrates
Posts: 565
Joined: Tue May 27, 2008 9:22 pm
Location: Oklahoma

Re: [tutorial] Bitmap Injection Guide

Post by socrates »

NotZachary82 wrote:On another note, would the XML editing work for renaming other tags? :p Heheh.
Yes. I believe there is a simpler way..but yes that works for anytag..just save the tag, edit .xml and import into map
User avatar
troymac1ure
Keeper of Entity
Posts: 1282
Joined: Sat Aug 09, 2008 4:16 am
Location: British Columbia, Canada, eh
Contact:

Re: [tutorial] Bitmap Injection Guide

Post by troymac1ure »

*Noted*

The new entity now automatically adjusts the tag name to the filename (so you can change it there) and also displays a dialog box if you want it something other than the filename. Should work with all Meta Save tags, not just Bitmaps.

This version should be released soon. (2.1.6 as things go)
Post Reply