Engie File Converter

From ModdingWiki
Jump to: navigation, search

The Engie File Converter is a game formats conversion tool created by Nyerguds.

Platform and license

The program is written in C# on the .Net framework v3.5. All code in the editor that was specifically written for the editor is released under the WTF Public License, meaning it can be used without restriction. A few components taken from online resources, as well as an ini reader originally written by Nyerguds for another project, have similarly permissive licenses, mentioned in the tool's readme and/or the actual source code files.

Development history

The tool started out as the C&C64 Image Viewer, a small tool to view and identify images in the .IMG format extracted from the Nintendo '64 version of Command & Conquer. When it was expanded to support viewing the game's tilesets, a rudimentary system was added to view multiple frames inside one file, and with the addition of saving features, the tool changed to v1.0 of the C&C64 File Converter.

When Nyerguds started cooperating with the people at the OldGamesItalia community, and decided to help with the graphics formats in the Sierra/Dynamix adventure games, the tool was the obvious platform to add this into, since it already contained all the basics for opening, viewing and saving images, with support for the use of externally-loaded colour palettes. As cooperation continued, the tool got better support for handling frame-based files, and grew into a graphics and sprites converter with support for many other games.

At v1.3, the name of the tool was changed again, to reflect the fact that the newer functions and formats in it were no longer related to C&C64. The originally intended name was Nyerguds's Game File Converter, or NGFC. This eventually mutated into the actual new name, Engie File Converter. The icon replacing the old green-and-black Nintendo 64 logo is the Engineer unit icon from a beta screenshot of Command & Conquer Gold, in which the whole UI looked like a higher resolution version of the DOS game, with simpler cleaner build icons instead of the final game's small scene renders. The version numbering was not reset, meaning the first version of Engie File Converter is v1.3.


The tool is distributed as a simple .zip file to be unpacked in a new folder. Once unpacked, the included .exe file runs the program.

The general usage is simple: open a file, either through the menus or via drag and drop, and a graphical representation of the file will appear. This can then be copied to the clipboard or saved in any supported formats that are compatible with it (e.g. with the same colour depth).

If the file is comprised of frames, the frame changer at the bottom will be unlocked, and the user can look through the frames, and save them as other image formats. In this frames view, frame "-1" will represent the entire frameset, and will be the only entry that will allow saving the entire frameset to other frame-based formats. If the file type does not warrant the generation of an overall single-image representation, this "-1" frame will be empty, but on some formats, a preview of the combined frames will be generated.

Framesets can also be exported as a set of single image files, and when opening any file that ends on a number, the program will check whether it belongs to a range of numbered frames, and will offer to open it as frameset, to allow converting it back to frame-based file formats.

The tool can view indexed formats that do not contain their own colour palette, using the same system Nyerguds previously implemented in the Westwood Font Editor, which offers a variety of generated palettes for every type of indexed image colour depth, plus added 4-bit and 8-bit palettes read from palette files in the classic 6-bit VGA format. Some file formats that typically come bundled with their own palette file will automatically look for that file and treat it as inbuilt palette.

Some file types can automatically load missing information from other files in the folder, including certain paletteless images and animations reading palettes with the same name, C&C maps reading extra info from an accompanying .ini file, and animations that lack an initial state reading the missing information from previous files in the sequence they belong to.

Additional functions

Besides the main purpose of converting files, the tool has a number of functions implemented for specific file types. These functions are:

  • For framesets: from v1.3 onwards, two tools were added to allow a loaded frameset to be combined into a single image, and to split a single image into frames. This allows easier editing of sprite sheets as a single large image. The frames-to-image feature allows frames to be enlarged in the process. Starting from v1.3.1, the image-to-frames one allows cropping on a specified colour to allow frames of unequal sizes, and conversion of high-colour images to a chosen palette.
  • For Tiberian Sun SHP files: shadow splitting / combining. Unlike in the older C&C games, in Tiberian Sun and Red Alert 2, graphics have the areas that should be processed with a shadow filter as additional frames behind the main frames. This is rather unwieldy for actually editing graphics, though, so two functions are provided for this; one to combine the shadow before converting to frames, and one to split it off before saving as Tiberian Sun SHP file. For the sake of compatibility with older SHP formats and other tools, the combining function will change the shadow colour pixels from colour index 1 to colour index 4, and the shadow splitting one will likewise look for colour index 4 pixels, and split them off as index 1 shadow.
  • For Visage Animation Format, though usable for cutscene animations in general: pasting a still image on a range of frames at specified coordinates. This can be used to easily clear existing text from static-background cutscenes, and to paste text onto cutscenes. If the original frames are paletted, this palette is always preserved, even if the pasted image is high-colour.
  • For Nintendo 64 maps: height map generation. This follows a few steps. The map is first converted to a bare terrain heights image based on the cliffs, which must be edited by the user to create a plateaus image. The converter can then use the original game map to apply additional terrain height details to the plateaus image, like the slopes of rock ridges and river beds, to create the final 64x64 height map. And finally, this needs to be converted to a 65x65 height map. A tutorial for the process was posted here.

Supported types

As of version 1.4.1, the converter supports the following types:

  • Standard image types: PNG, BMP, JPEG, GIF. Anything else that is natively supported in the .Net framework (like certain types of TIFF) can also be opened, but not saved.
  • Windows icons, with specific support for viewing the different images in the file (which the .Net framework does not do natively).
  • Simple 768-byte VGA palettes in both 6-bit and 8-bit formats. The 6-bit type is used in a load of Westwood games; the 8-bit type is used by C&C64.
  • The image and tileset formats used in the Nintendo 64 version of Command & Conquer, though only the image format has save support.
  • The PC and N64 map format of Command & Conquer, with the ability to convert between the formats.
  • The Command & Conquer Tileset Format, an uncompressed tileset format representing a rectangular shape of terrain cells, with indication of unused cells in the grid.
  • Westwood Animation (WSA) format (which uses their own XOR Delta compression), with support for four known versions, and the choice to embed palettes on saving. Used in a load of Westwood games.
  • Westwood CPS Format, with loading and saving support for all compression formats, and the choice to embed palettes. Used in a load of Westwood games.
  • Westwood Dune II SHP Format / Lands of Lore SHP Format, with support for remappable frames.
  • Westwood Command & Conquer 1 / Red Alert 1 SHP Format.
  • Westwood Tiberian Sun SHP Format.
  • The LCW image type from Blade Runner, a simple implementation of an LCW-compressed 16-bit image.
  • The Westwood Palette Stretch Table format, a 64K file containing the best in-between colour for all possible colour pairs on a specific 256-colour palette. They are used to quickly upscale 8-bit images, mostly WSA animations and CPS images.
  • Elvira: Mistress of the Dark item icons and VGA format (HorrorSoft Elvira 1 / Elvira 2 / Waxworks)
  • Dynamix BMP and SCR format, with compression support for RLE, LZW (reading only) and LZSS (reading only, though writing code is available and could be added later), and the Dynamix 8-bit palettes. Used in loads of Sierra/Dynamix games.
  • Kings of the Beach PAK Format, a planar RLE-compressed image type with the ability to save a partial file.
  • KORT Image format, a headerless image that is always 320x200, and of which the data is RLE compressed in simple Value/Length pairs.
  • KORT BMP Format, an uncompressed tileset format.
  • Mythos Visage Format, with full compression loading and saving support.
  • Mythos Visage Animation Format, with support for compression and for optimising data into chunks on save.
  • Westwood Font Format v3 (Dune II, Lands of Lore 1/2/3, Legend of Kyrandia 1/2/3, Command & Conquer, Red Alert)
  • Westwood Font Format v4 (Tiberian Sun)
  • Dune 2000 Font