Introduction
An .FFE file holds force feedback effects: the pushes, rumbles and
springs that a force feedback joystick or steering wheel can play. The files are made by
the Force Editor (FEdit.exe) that came with Microsoft’s
DirectX 7 SDK, and a program loads
them with IDirectInputDevice7::EnumEffectsInFile, which hands back one
DIFILEEFFECT for each effect in the file. The SDK’s Media folder has 110
of them, named for what they feel like: chainsaw.ffe,
land2.ffe, lsaber.ffe, helia.ffe.
Each effect is the contents of a DirectInput DIEFFECT structure (how long it
lasts, how strong, in which direction, with what envelope) plus the GUID of its type and
that type’s parameters: a constant force, a ramp, a sine, square, triangle or sawtooth
wave, a spring, damper, inertia or friction, or a custom force. These pages describe the
layout of the file and the meaning of every number. The explorer shows every effect and
draws its force over time.
Microsoft documented the effects, not the file: the layout here was worked out from
the 113 different files of the SDK found on this Mac and checked against the structures of
dinput.h. It agrees in every point with the one other published account,
E. Vanderstuyft’s 2014 reverse engineering for Wine, which was checked against 190
files (the SDK’s, other collections found on the internet, and some made with Force Editor).
Structure
The file is a RIFF file of form type FORC. The RIFF size is 0, so a
reader has to go on to the end of the file. After the form type there is a 16-byte
GUID, then one list of type efct for each effect. A file with no effects
is just those 28 bytes. Numbers are little-endian.
0x00RIFF headerRIFF, a size that is 0,FORCand a GUID280x1CEffect 1 aLISTof typeefct8 + size…Effect 2, 3 … one list each, to the end of the file
Each effect list holds a name, a DIEFFECT whose pointers have been replaced
by flags, the effect type’s GUID, a number and then up to four data
chunks.
+0x00List headerLIST, the size andefct12+0x0CName a zero-ended string in a 64-byte buffer64+0x4CDIEFFECT duration, gain, trigger, axes, envelope, parameters and start delay56+0x84Effect type the GUID:GUID_Sineand the others16+0x94A number 1 in every file seen4+0x98Axes adatachunk: the axes the effect acts on8 + 4 × axes…Direction adatachunk: one number for each axis8 + 4 × axes…Envelope adatachunk with a DIENVELOPE; only when the effect has one28…Parameters adatachunk with the effect type’s own numbers8 + size
LIST chunk.The pages in this reference: the RIFF container, the effect list byte by byte with a worked example, the effect types and their parameters, and how the force curves are drawn.
What the files hold
The 113 different files on this Mac hold 262 effects between them, all from the DirectX 7 SDK. Every one acts on two axes (X and Y, given as offsets in the joystick’s data format), in polar coordinates, at full gain.
| Effect type | Effects |
|---|---|
| Sine wave | 113 |
| Square wave | 43 |
| Ramp force | 41 |
| Triangle wave | 18 |
| Constant force | 16 |
| Sawtooth up wave | 14 |
| Sawtooth down wave | 11 |
| Friction | 5 |
| Spring | 1 |
| Damper, inertia, custom force, other GUIDs | 0 |
75 of the effects have an envelope, 131 have a start delay, 23 are tied to a trigger button and 5 last until stopped.
Telling it apart
A force feedback effect file starts with RIFF, four size bytes and
FORC. The explorer takes a file for one only when every effect in it reads
right: the list sizes, a DIEFFECT size of 56, the flags in the pointer
fields and the sizes of the data chunks. Any other file with the extension .ffe,
whatever program made it, opens as bytes.
Not described
Microsoft never published this file layout. These pages are worked out from 113 different files of the DirectX 7 SDK and from dinput.h, so some things are missing or only inferred.
Known, not yet covered
- Reference: damper and inertia effects, and effects with other than two axes, offsets, polar coordinates or full gain. Their structures are in
dinput.hof the DirectX 7 SDK, but no real file has them, so the pages follow the header and nothing was checked against a file (effect types). - Reference: how a device plays waves, envelopes and conditions. The DirectInput documentation describes it, but the pages do not repeat it and no force feedback device was available to test (force curves).
- Viewer: the direction is shown as a number and not drawn, the sample period and trigger button are not drawn, and an envelope is applied to constant, ramp and wave effects only. Damper and inertia are read from the
dinput.hlayout and drawn without a real file to check them. - Viewer: it only reads; it cannot change or save a file.
Unknown
- Reference and viewer: the number after each effect’s GUID. It is 1 in all 262 effects seen and no public source says what it means; the viewer shows it as a plain value (effect list).
- Reference and viewer: the file GUID after
FORC. It is the same in every file and no public source says what it is for; the viewer shows it as a GUID (RIFF container). - Reference and viewer: how a file stores custom force samples. No file or source settles it, so the layout is a guess; the viewer draws samples only when the sizes fit that guess and otherwise shows bytes (effect types).
- Reference and viewer: the parameters of non-standard effect GUIDs, which a device maker can define. None is in the files seen; the viewer shows the parameters as bytes with no picture.
- Reference and viewer: other programs’
.ffefiles. None was available; the viewer opens a file that is not RIFF FORC as bytes.
Links
Software
- Force Editor (FEdit) – Microsoft’s editor for force feedback effects, in the DirectX 7 SDK (Windows)
- FFFileRead – the SDK’s sample that reads an .FFE file and plays its effects (Windows, C++)
Reference
- DirectInput documentation – DIEFFECT, DIENVELOPE, DIPERIODIC, DICONDITION and EnumEffectsInFile, in the DirectX 7 SDK and its
dinput.h - DIFILEEFFECT structure – Microsoft’s description of what
EnumEffectsInFilereturns for each effect: effect GUID, DIEFFECT and friendly name; it does not describe the file itself - FFE_RevEng – E. Vanderstuyft’s 2014 Python reader that checks the layout against 190 files, posted to the wine-devel list as “FFE (force feedback) file format reverse engineered” (Python, GPL v3)