The result of a blogging accident

old page

NOTICE: This page has moved to http://igaeditor.sourceforge.net

Please update your bookmarks and links. This old page is kept for archival reasons.

Thanks to some help from the folks at the Total Battlefield 2142 Forums I’ve been working on an ad cache editing software. At the moment, it’s in alpha stage, and only lets you import and export the image files (which is what most people seem to care about first). :)

The latest version is 0.1.3.

How to use this program

Battlefield 2142

This guide is partially sporked from Vreki’s Howto. My program seems to have gotten lots of popularity around the place! :)

Battlefield 2142 stores it’s advertising in a file called icontent.cache. This is in your My Documents folder (which will be called something else if you don’t have an English-language version of Windows), under Battlefield 2142. If you’re using the demo version, it will be under the Battlefield 2142 Demo folder.

You’ll need to download the latest version of the software from this page. It will need the Microsoft .NET Runtime 2.0, which most people should have. If you don’t have it already, you can download it from Microsoft’s website. There are seperate versions for x86, x64 (amd64 and em64t) and ia64. You’ll need to get the one that matches your Windows version - you should only use the 64-bit versions if you have a 64-bit computer AND are running a 64-bit version of Windows. Most people will want the x86 version.

However, the cache will be updated by the ad servers if you don’t block them. You can block them with ipseccmd, which is in the full installation of Windows XP SP2 support tools. Remember to do a full installation - the standard one will not install ipseccmd.

Use this batch file to block the ads:

cd "%ProgramFiles%\Support Tools"
ipseccmd -w REG -p "IGA-B-Gone" -r "Block Outbound connections to IGA servers" -f 0= -n BLOCK -x
ipseccmd -w REG -p "IGA-B-Gone" -r "Block Outbound connections to IGA servers" -f 0= -n BLOCK -x
net stop policyagent
net start policyagent

And this to unblock them:

cd "%ProgramFiles%\Support Tools"
ipseccmd -w REG -p "IGA-B-Gone" -r "Block Outbound connections to IGA servers" -f 0= -n BLOCK -y
ipseccmd -w REG -p "IGA-B-Gone" -r "Block Outbound connections to IGA servers" -f 0= -n BLOCK -y
net stop policyagent
net start policyagent

If you don’t want to use ipseccmd, you can block the IP ranges - and - using your favourite firewall software/hardware.

Trackmania Nations

Trackmania Nations stores it’s ads in icontent.cache, which is located in your Trackmania Nations installation folder. It uses an older version of IGA’s engine.

It is reported that in this older version of the IGA system, that making the file read only will prevent Trackmania from updating it.

Editing ads

Static Images (DDS)

The images are in DDS (Direct Draw Surface) format, which you can view and edit using the free graphic tool: The Gimp. You will need the DDS plugin for Gimp too. NVidia also publish a free Adobe Photoshop plugin and a thumbnailer for Windows Explorer. The Explorer DDS thumbnailer is quite useful when dealing with multiple images.

If you want to replace the images, you should first flatten your image, make sure you are using 24-bit RGB colour, then when saving, enable “Generate Mipmaps” and use DXT1 compression only. Saving to DDS format will result in some quality loss, I recommend you save any original works (unflattened) in a more “normal” image format first, like XCF (Gimp), PSD (Photoshop) or PNG (if you don’t have any layers) so that a high quality original is kept. This program has very limited checking of the files, it will not attempt to correct you if the image has the wrong dimensions. It will, however, attempt to correct you if the filesize is wrong, as this will catch the most common import problems.

Video Ads (BINK/BIK)

Video ads are in Bink Video format. I don’t know if all games support them, but I know that Trackmania Nations does, and BF2142 is likely to.

To create BINK advertisements, you should have an existing video file, in the correct size (eg: 256x128).

The next step is to transcode it to BINK/BIK format. Download the free “RAD video tools” package and install it. Run the software, and you will get a file list. Select the AVI or MOV file you wish to transcode, and click “Bink It!”.

Select the location where you wish to save the video, and select transcoding options. If the video is not 256x128, use the crop and scale functions to correct the size.

For example, for a video sized 480x360, to size it to 256x128, as the aspect ratio is wider (2.0:1) on the destination than the source (1.33:1), you will need to first scale it to 256x((256/480)*360) pixels (256x192), then crop it starting from 0x((192-128)/2) (0x32), with a size of 256x128. This will, of course, chop the top and bottom of the image of the video.

The result is a BINK video you can insert. First check that the “Video Ad” option is enabled for the ad you’re replacing, and then import it. Remember to change the file type filter to allow you to import it.

If you want to view BINK video ads from your cache, export it, and you can just double click to open it if you have the RAD Video Tools installed.

Download the program

Not all the buttons work, not everything is all “wired up”... so it’s just a work in progress. For further developments, see this forum thread, it also explains all about the advertising servers for the Battlefield 2142 software.

  • Ad Cache Editor 0.1.3: Fourth alpha version. Adds support for Trackmania Nations, and handles application IDs properly. Also adds support for BIK video files (in TMN only), a new image size (in TMN only), and update checker.
  • Ad Cache Editor 0.1.2: Third alpha version. Various bugfixes, and “adpack” support.

Standard Adpacks:

Once I’ve finished writing this program (and it becomes “stable”), source code will be released. It uses System.Data.SQLite.dll, which is in the public domain. It also uses SharpZipLib, which uses a modified GPL license. You can download my version of the library here.

It goes without saying that you use this software at your own risk, and it may be a violation of the BF2142 EULA to use it.