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.
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.
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