EGI 4.0a
![]() |
EGI is a tool to create and play back frame based animation sequences (pre-compiled movies). These sequences can be embedded into a (multimedia) application that runs under Microsoft Windows (version 3.1x, Windows 95/98/ME or Windows 2000/XP and later). See what's new in version 4.0. EGI consists of an animation compiler, a decompiler and players (for 16-bit Microsoft Windows and for Win32). The compiler generates a superset of the standard FLIC format (FLI/FLC). The players have a DLL and an MCI interface and can be used with any program/environment that can call a DLL or issue MCI commands. Examples (with source) are included. |
Why animations?
If a picture can be worth a thousand words, and animation can be worth a thousand pictures. Whereas a picture shows a static situation, seeing a device or a situation in motion usually helps "getting the picture". Animations have advantages over video as well: apart from being able to put things in animation that do not (yet) exists, an animation emphasizes the basic shapes and removes noise, thus making the image flow clearer than a video.
Animations are ubiquitous in entertainment, computer presentations and computer games. They are also useful in standard computer applications. Motion attracts the attention and it is less intrusive than sound (beeps). As such, animations serve to notify the user of an event in a gentle manner. A friendly user interface in your application can attract users and make their experience more enjoyable.
Any time a program has to perform a long operation, it has been customary to present the user with an hourglass cursor and a progress bar. When you use animations in your application to indicate the progress and the status of a process, any progress dialog can become more eye catching and more informative. The EGI library allows animations to be used anywhere, such as program wizards, splash screens or even out of the application window and over the desktop.
How it works
The compiler takes a series of pictures as input (in the BMP, PCX, TGA, Pro Motion "SPR" formats, and others) plus a script file that relates the pictures to each other. The output consists of a single file with the animation sequences (there can be multiple sequences per generated output file). The format of the output file is a superset of the FLIC format that is used by Autodesk Animator and related products. If desired, the EGI compiler can create FLIC files that are fully compatible with Autodesk Animator.
The EGI players are dynamically loaded libraries (DLLs) that take a compiled animation file as input and display the frames at the screen location and the speed as specified by an application. Both files created by Autodesk Animator (or related products) and files created by EGI are accepted. There are separate players for 16-bit and 32-bit Microsoft Windows environments. The players offer a rich API by means of which they are easily integrated with C/C++, Delphi, Visual Basic or other programming languages.
For avatars and self-contained animations, a packager binds the animation (FLIC file) and a player utility into a single executable program. All required files are contained in that single program (i.e., no auxiliary DLLs or ActiveX controls are needed). As the animation can be scripted with the the "pawn" language, such self-contained animations mey be highly dynamic and even interactive.
The decompiler is provided to aid converting existing FLIC files to the enhanced format that is used by EGI. Through this enhanced format, features like segmentation and transparency are achieved.
Users of Pro Motion (by Cosmigo) can also use a plug-in to directly create an extended FLIC file from this animation paint program.
EGI compiler and player screen shot
In addition to the features of a standard FLIC player, EGI provides:
- 16-bit and 32-bit implementations; runs in Microsoft Windows 3.1, Microsoft Windows 95/98/ME and Windows 2000/XP/Vista and later (using threads and DIB sections). There is limited support for Win32s.
- EGI can be integrated with a sprite library with little effort (especially with our own AniSprite library). This will allow you to make a FLIC animation of a walking puppet, and then to move that puppet across the screen like a sprite. If you do not need the advanced features of a sprite library, such as collision detection and alpha blending, EGI can also do this on its own.
- A run-time script that controls the animation can be embedded in the FLIC file. This run-time script is written in the "pawn" language, a C-like language.
- Segmented animations, using anchor images (or pedal-point images). This feature allows you to combine several small animations to a single, complex (and possibly interactive) animation. You can also make "meta-animations" in which you chain several smaller animations together. Segments can be linked at compile time or (dynamically) at run time.
- Doing complex transitions between the segments (for example when animating from pose to pose in a fluent way) is made simple and almost automatic by adding a transition "path map" to the animation.
- Synchronize animations with sound or other events. Options for "hard" and "soft" synchronization are supported.
- Better compression with a last pass using Huffman coding and the Burrows-Wheeler Transform. The modified (and optimized) algorithm that EGI uses takes little CPU time to expand the data to the original size.
- An animation file can include digitized audio ("WAVE" files). The EGI compiler can resample/convert the audio files to a different sampling frequency or a different format.
- Support for transparent animations. Support for transparency masks with multiple levels, for example, for soft shadows. Regional windows (with pre-compiled regions) for transparent animations on the Windows desktop are supported as well.
- EGI supports graphic and text overlays. The overlays are merged into each decoded frame. Overlays can come from external (image) files, or be embedded in the animation
- The animation can be compiled to a self-contained executable program. With the help of an automation script, plus all other features of EGI animations, you can create a dynamic animation, or a desktop "agent"/avatar.
- EGI supports 16-bit "HiColor" FLIC files as well as the standard 256-colour FLIC files.
- Palettes are optionally remapped to an "identity palette", which allows faster animation in Microsoft Windows. The animation can also adapt to the current foreground palette (even dynamically) or to an explicit palette.
- Support for password protected animation files.
- The EGI players support real-time scaling of the image to any size. This is useful, for example, to adjust the aspect ratio of a FLIC file (resolution 320 x 200 with an aspect ratio of 6:5) to display correctly in 640 x 480, 800 x 600 and 1024 x 768 resolutions. EGI supports several (novel) scaling algorithms, which allows you to balance quality versus playback performance.
- An animation can be loaded from a separate file, from a compound file, or from memory. An animation can play from file or from memory.
- Support for (enriched) FLIC animations in help files in the "WinHelp" format, either 16-bit or 32-bit.
- The EGI compiler can share an include file with a C/C++ compiler for its symbolic constants. This helps embedding the animation into an application in C/C++, because all tools automatically use the same constants/settings. The EGI compiler can also generate a C/C++ header file with file offsets to specific frames in the animation.
- The compiler supports images in the formats: PCX, BMP (Microsoft Windows bitmap format), TGA and SPR (an animation file format used in "Pro Motion" by Cosmigo), plus Ulead "UIS" files and Adobe "Filmstrip" files.
- A "decompiler" allows you to extract images (and a script file) from an existing FLIC file (both the .FLI and .FLC types are supported). You can feed these images back into the EGI compiler.
- The 32-bit player can decode the frames in a DirectDraw surface. Once that is done, you can blit the (secondary) surface to the primary surface, or flip surfaces.
- High-performance: critical routines are hand-optimized in assembler.
- Interfaces for: C, C++, Delphi, Visual Basic and MacroMedia Authorware, plus MCI drivers.
- Full source code of the compiler, the decompiler and the players is available, with the exception of the licensed component "ddoc Print & Preview" and the "GraphPlace" utility.

Download
- Download EGI version 4.0 evaluation version (4,172 kBytes), including the manual in PDF format.
- Download the Pro Motion plug-in (24 kBytes) Note: You need the EGI compiler to use the plug-in. The EGI compiler is included in the evaluation version.
Articles
Technical information (notably the FLIC file format and animation techniques) is available online as well. See, for example:
- The Smallest FLIC animation player
- Getting started with programming the EGI player (using the EGI API). This application note implements the smallest functional animation player that uses EGI in C, C++, Delphi and Visual Basic.
- An EGI Player in C++
- Building a simple animation player with EGI in C++ (no MFC). It is not the tiniest animation player (for that see "The Smallest FLIC animation player"), but the EGIplay utility developed here is not a toy example either.
- Easy Transparent Animations with the EGI Player
- Playing animations with transparent areas is one of the key features of EGI. This paper extends the simple animation player in C++ to play animations with transparent areas.
- Embedding animations in Windows Help using EGI
- One feature of the Microsoft Windows Help system (WinHelp) is that it can be extended with "plug-in" DLLs. This paper describes how to embed standard or extended FLIC animations in a WinHelp .HLP file and how to invoke these animations.
- Using EGI with DirectDraw
- EGI can decode frames from a FLIC animation directly into a DirectDraw surface. This application note describes how to use this feature.
- Transparent animations on the desktop
- EGI can play animations transparently over the desktop, like an "agent" or an avatar. This application note describes how to prepare animations for this feature and how to set up the player. The usage and the internals are also explained, as well as the peculiarities of the "region" functions of Microsoft Windows, and their consequences.
- The FLIC file format
-
A detailed description of the animation file format for FLI/FLC
files. The FLIC file format was developed for Autodesk Animator, and
it is now supported by a wide range of animation software and
utilities.
The document also discusses many enhancements and extensions to the file format from EGI, DTA and Cosmigo, plus that it covers the FLH/FLT/FLX files in addition to the 256-colour FLIC files. - EGI compression schemes
- Details on the (lossless) compression schemes that are used by the animation compiler/player EGI: run length encoding (RLE), zero order Huffman and Burrows-Wheeler transform.
![]() |
Sisters (version 3): EGI + AniSprite + MIDIThe sisters Fanni and Tila are charming creatures that live in the world of fantasies. In their world of checkerboards and marble balls, they pass the time with seducing spectators to leave the world of reality and to enter theirs. Rivalry between sisters is not uncommon. But then again, this is only fantasy... Or is it? |
![]() |
More seriously, the Sisters demo (1,056 kBytes) shows the synchronization and transparency features of EGI, by playing four FLIC files (two of which have with multiple segments) over a fixed background. Wave files are played at appropriate events, the FLIC files are synchronized to a MIDI song and the two FLIC animations move over the background image and synchronize with each other under control of a C program. AniSprite takes care of flicker-free overlapping animations and for semi-transparent shadows.
All in all, it is worth looking at if you are considering more advanced animation (and possibly interactive animation) with EGI.
What happened to Zónya and N'thila? For the curious amongst us... follow this link.
If you wish to rebuild the animations, you need the evaluation version of EGI and the source pictures. If you wish to modify the demo and recompile it, you will need the evaluation versions of EGI and AniSprite (in addition to a C compiler that generates Microsoft Windows' applications).
Download
- Get the executable demo (902 kBytes), this excludes the "rotating marble ball" FLIC, which is quite large and not essential for the demo.
- Get the rotating marble ball animation (2,960 kBytes) that shows how FLIC animations with transparency can be layered on each other and still produce flicker-free animation.
- Get the demo source code (511 kBytes): the pictures, the scripts for the animations of Fanni and Tila and the C/C++ program. You need these only if you want to modify the "Sisters" demo or want to see in detail how it was done.
Components not included with the source code
- The GUI version of the EGI animation compiler uses the "ddoc Print & Preview" programmer's library to create the animation report. The product comes with the redistributable run-time components of that product (i.e. the DLLs and the executable program). When you purchase the source code of the EGI product, the source code of "ddoc Print & Preview" is not included.
- For the "continuation graph" in the animation report, EGI furthermore uses "GraphPlace": a simple and fast filter program that arranges a list of nodes and edges into a graph. It is written in ANSI C with a PostScript part. The EGI product does not come with the source code of the "GraphPlace" program, but it can be obtained from various sites. Contact J. van Eijndhoven (J.T.J.v.Eijndhoven@ele.tue.nl) for more information about GraphPlace.
New in version 4.0
- A new tool, the EGI packager, binds a FLIC animation to a self-contained executable file. The produced file is an .EXE file that contains everything to display the animation; it does not require additional DLLs, COM/ActiveX controls or other files. The packager supports every feature in the animation file that EGI supports, including run-time scripts. Due to the scripting ability, you can create state-dependent and interactive animations that you distribute as a single .EXE file.
- EGI supports a new compression scheme, called "frame shift" compression. Actually, this is a transformation that reduces the differences between two frames, so that the subsequent delta-frame compression stage has less data to compress. To activate frame shift compression, use the new frame_shift(n) command (see the manual). Frame shift compression is effective on animations with objects that move over a solid background or backgrounds that are panned (horizontally or vertically). Technical documentation on the frame shift compression is available on our web site.
- The Windows version of the compiler now produces an extended report, including a graph that shows how segments are linked (which segments may follow any other segment). This report can be printed or saved to disk (as a data file or as a self-contained .EXE file that allows you to view and print the report).
- For animations that play in the window created with FlicCreateWindow(),
there are the new event functions:
The functions @FlicRButtonDown(x,y) and @FlicRButtonUp(x,y) to react on clicks of the right mouse button. The @FlicStartDrag() function is invoked when the user starts moving the window and @FlicEndDrag() signifies the end of the "drag" operation.
@FlicRButtonDown(x,y) @FlicRButtonUp(x,y) @FlicStartDrag() @FlicEndDrag()
- EGI supports graphic overlays to be added to the animation frames. An overlay can be a DIB (device-independent bitmap), a DDB (a device-dependent bitmap, or HBITMAP type) or a text string. All overlays support a transparent colour. Overlays can be used for sub-titling animations, adding arrows to point out a particulare part of the animation, or adding facial expressions to an animated cartoon character that was created without a face (e.g. for lip-syncing). When an overlay is added, it is merged into every subsequent frame that is decoded. You can add multiple overlays over and animation.
- EGI can optionally write a "path map" to the animation. A path map is a table that contains the shortest route to go from the current segment to any of the other segments, in a smooth fashion. The path map contains these shortest route information for all segment combinations.
- Alpha channels in Targa image can now directly be converted to masks in the FLIC animation. The advantages are two-fold: firstly, there is no need for a "transparent" colour, which means that there is no need to mandate that any non-transparent part of the image cannot be of a particular colour; secondly, multiple transparency levels are supported, for example for soft edges. See the new command "alpha_channel" for details.
- HiColor graphics now also supports dithering, to increase the visual quality of True Colour (24-bpp RGB) source images that are reduced to HiColor (16-bpp RGB) animations.
- The "Script Guide" is vastly improved. Most notably, simple scripts, like those that were created with the Script Guide may be re-loaded into the Script Guide, so that you can keep working in the Script Guide for those animations that you once created with it. (Also note the name change: in earlier versions, the Script Guide was called the "New Script Guide"). Another major improvement is the addition of an image preview, which allows you to "run through" the animation before compiling it.
- A new notification message FN_SEGMENT, which is sent when a new segment starts playing (it may also occur when you "seek" backwards in the current segment). The notification is disabled by default; you must activate it by setting the flag FLIC_NOTIFY_SEGMENT in the FLIC_PARAM_SENDNOTIFY code of FlicSetParam(). For the embedded script, there is the new event function @FlicSegment(segmentnumber).
- Another new notification message is FN_WINMSG. It is sent by the window that FlicCreateWindow() creates, so you will only receive it when playing animations in the "EGI" window. The FN_WINMSG message notifies the parent window of the "EGI" window that the left or right mouse button is pressed or released on the animation.
- The new function FlicFindSegment() returns the numeric label of a segment whose name you pass in. Finding segments by name requires that the FLIC file be compiled with the new compiler. In a related way, the new code FLIC_DATA_LABEL for FlicGetData() returns the name of a frame label if one is available.
- The interface to MacroMedia's Authorware Professional has been improved. You can now play an animation in an Authorware layer. Transparency is supported as well.
- New function FlicSetAMXInstance() to set the module (or instance) handle of the DLL that hosts the "abstract machine" for the Small scripting engine. By default, EGI tries to dynamically load either AMX16.DLL or AMX32.DLL for the 16-bit and 32-bit versions of EPLAY respectively. If the abstract machine resides in a DLL with a different name, or if you need to load the DLL from an explicit path, you can load it yourself with the Windows SDK function LoadLibrary() and pass the module/instance handle to the EGI player with FlicSetAMXInstance().
- The player supports real-time "smooth scaling" for expanding or reducing animation frames. The option is set with a new code for FlicSetParam(): FLIC_PARAM_SCALEOPTION. Smooth scaling has a quality that is equivalent to that of bilinear interpolation (the result is not exactly the same as that of bilinear interpolation; we think that it is slightly better, as it is less blurred on most images). The smooth scaling algorithm used in EGI has been specifically designed for animation (meaning that it is pretty quick) and it is able to interpolate even 256-colour palette based animations —which FLIC files usually are)
- The standard animation window created with FlicCreateWindow() now supports "layered windows" with a "colour key" on Windows 2000 and Windows XP. This is an alternative for region masks. You can build an animation so that it uses layered windows in a Windows version that supports them and region masks otherwise. The new "parameter" FLIC_PARAM_TRANSPCOLOR and the new FLIC_COMMAND message code FC_TRANSPARENT are part of this new feature.
- The window created with FlicCreateWindow() can size itself to fit the FLIC animation automatically.
- The compiler now also saves a palette for a HiColor FLIC file in the first frame of the first launchable segment. This palette is optimized for the FLIC file and if you need to show the HiColor FLIC file on systems set to 256 colours, the FLIC file looks best if you select this palette.
- The compiler supports "Ulead Image Sequence" files from Ulead MediaStudio and VideoStudio, as well as Adobe "Filmstrip" files from Adobe Premiere and Adobe After Effects.
- The script wizard now supports the specification of the transparent colour in RGB, using a HTML syntax (e.g. #FF00FF for bright magenta).
- The compiler supports the Extended RIFF palette file format that PaletteMaker produces. This allows you to mark individual palette entries as "reserved" in PaletteMaker. When the EGI compiler quantizes/dithers images from RGB to the 256-colour palette, the "reserved" entries are excluded from the palette search. In other words, no pixel in the animation will use any palette entry that is flagged as "reserved". Those palette entries can subsequently be used for special purposes (e.g. palette animation) without harming the FLIC animation.
- Windows created by FlicCreateWindow() have support for a new option for the
FLIC_COMMAND message:
FC_IGNORECLOSE
ignore any WM_CLOSE message (by default: TRUE)
Previous versions of EGI always ignored WM_CLOSE messages, in order to support WinHelp animations. The current version makes this behaviour configurable. - The decompiler (DECOMP.EXE) now supports 16-bit FLC files on input (in the format that the EGI compiler uses) as well.
- For easier testing of embedded Small scripts, the EGI player utilities (EGIRUN.EXE and EGIRUN32.EXE) now have a "reload" menu option, which re-initializes the script (so all global variables are reset).
- The EGI compiler supports compressed Targa images (in addition to uncompressed TGA files). Only 24-bpp and 32-bpp Targa image files are supported.
- The MCI drivers now support self-registering. To register an MCI driver, use
REGSVR mciegi.drv (16-bit)
or
REGSVR32 mciegi32.dll (32-bit)
Note that if you install MCIEGI32.DLL under Windows 95/98/ME, it will actually set up the configuration for MCIEGI.DRV (MCI drivers are 16-bit in these versions of Windows). - Through better instruction scheduling and implementation optimizations, the performance of the Huffman and the "bwt" (Burrows-Wheeler Transform) decompression routines has increased.
- The MCI drivers did not support the "PUT" command correctly. In addition, the "PLAY" command would not update the entire screen if the "FROM" option was used ("PLAY xxx FROM nnn").
- The frame numbering of the MCI drivers starts at frame 0 for the first
frame in an animation. This was chosen in order to be compatible with
the MCI drivers for Video for Windows. However, Autodesks original MCI
driver, MCIAAP.DRV, started numbering frames at 1. To increase compatibility
with MCIAAP, EGI''`s MCI drivers now support the option to set the frame
base (0 or 1). This can be done in one of three ways:
- with an MCI command per animation:
set my_anim.flc frame base 1 - with an MCI command for all subsequent animations:
open Animation
set Animation frame base 1
("Animation" is the device name for the MCI driver, not a FLIC file) - with an option in SYSTEM.INI and/or the registry:
- for Windows 95/98/ME, in SYSTEM.INI, below the topic [mci], add:
Animation=$path$\bin\mciegi.drv framebase=1 - for Windows NT/2000, in the registry, below the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32 add:
Animation=$path$\mciegi32.dll framebase=1
- for Windows 95/98/ME, in SYSTEM.INI, below the topic [mci], add:
- with an MCI command per animation:
- In the EGI compiler, frame cropping did not work correctly on True Color images. This has now been corrected.
- A bug in the decoding was fixed in the 16-bit player (EPLAY.DLL). The 16-bit player would crash on some (rare) FLIC files. This bug could also pop up when using the MCI driver under Windows 95/98/ME because those versions of Microsoft Windows use 16-bit MCI drivers.
- A bug in the WinHelp support of the EGI player was fixed. When implementing the performance enhancements in version 3.2 (for very large FLIC files), the special requirements of the WinHelp file format were neglected (due to an oversight). This resulted in EGI no longer being able to play FLIC animations in 32-bit ".HLP" files; 16-bit ".HLP" files were not affected.