Force Editor

Force Editor

The Microsoft® Force Editor documentation contains the following topics:

  • About Force Editor
  • Force Editor Windows
  • Creating Effects
  • Deleting Effects
  • Setting Effect Properties
  • Playing Effects
  • Using Effect Files
Built on Tuesday, August 03, 1999


About Force Editor

Force Editor is a tool for designing and testing force-feedback effects in Microsoft® DirectInput®.

To use the application, you need to have at least one force-feedback device attached to the system. You can select from multiple devices by choosing Select Device from the File menu or by clicking the joystick icon on the toolbar.

The program requires the Microsoft Foundation Classes 4.2 library. This might not be available on a Microsoft® Windows® 95 system if you have not installed Microsoft® Visual C++® or another application that installs the necessary dynamic-link libraries (DLLs).

Effects can be designed singly or in groups, and can be tested in combination, with different start and stop times for each effect.

Effect parameters are saved in resource interchange file format (RIFF). Effect files can be opened in Force Editor for further development and can be used by applications, so there is no need to copy effect parameters into code or to update code as effects are redesigned.


Force Editor Windows

The top pane of the application window contains one or more timeline windows. Each timeline window can contain several effects, displayed as rectangular graphs extending over the time that the effect is to play.

By default, the timeline has a length of about 10 seconds. However, by using the Time Scale slider at the bottom of the pane you can change the amount of time shown in the window, which has the effect of lengthening or shortening the timeline. In addition, the timeline is automatically extended whenever you set the end time of a finite effect to a point outside the current extent of the timeline.

The bottom pane of the window provides feedback and error messages as DirectInput creates and plays effect.


Creating Effects

To create an effect:

  1. Click on the desired type of effect in the toolbar, or select Effect from the Insert menu, and choose the effect type from the list. A graph is created in the active timeline window, representing an effect of arbitrary duration and start time.
  2. Using the mouse, move and resize the rectangle to give it the desired start point and stop point.

As you move or extend the rectangle to the right, the timeline automatically lengthens as necessary.

You can create any number of effects in a timeline window. However, the number that can be downloaded at any one time is limited by the device.

Select an effect for editing, playing, or deletion by clicking on its graph. You can select multiple effects by using the SHIFT key.

When effects are downloaded to the device, they are given priority from top to bottom. Change the vertical order of effects by dragging them.


Deleting Effects

To delete effects:

  1. Select one or more effects.
  2. Choose Delete from the Edit menu.

    Or

    Press the DEL key.

    Or

    Right-click on a selected effect, and choose Delete from the context menu.


Setting Effect Properties

Properties for an effect are set on a property sheet. Only one property sheet can be open at a time. It always represents the last effect selected in the timeline window.

To set properties for an effect:

  1. Right-click on the effect graph in the timeline window, and select Properties from the context menu.

    Or

    Select the effect graph, and choose Properties from the Edit menu.

    Or

    If the property sheet is already open, click on the effect whose properties you want to change.

  2. Select the page for the property you want to change, and adjust the values. New values are applied immediately. However, in the case of a text box, you must move the input focus elsewhere, or press ENTER for the new value to take effect.

Information about specific property sheet pages is contained in the following topics:

  • Common Properties
  • Force Properties
  • Condition Properties

For general information on effect properties, see the documentation for DirectInput.

Note Force Editor lets you change all properties of an effect, even those that are not supported on the device that you are using.


Common Properties

The property sheet has the following pages for all effects:

  • General. Enter the friendly name of the effect. This is the string to be returned in the DIFILEEFFECT structure for the effect when file effects are enumerated by a DirectInput application.
  • Axes. Choose the axis or axes on which the effect is to be felt. Effects can be created on one or two axes. To create a single-axis effect, select an axis in the first list, and select None in the second list. To create a two-axis effect, select an axis in each list. The order of the axes is not significant—for example, selecting X in the first list and Y in the second is the same as selecting Y in the first list and X in the second.
  • Timing. Choose the time units to be used on this page by selecting an option button.

    Enter a value in the Start Delay text box. This is the delay between the time the effect is started and the time it plays.

    Change the duration of the effect by entering a value in the Duration text box, or select Infinite if you want the effect to play until explicitly stopped. You can also select durations of up to 10 seconds by using the slider.

    You can also make changes to the start delay and duration of an effect by moving and resizing the graph in the timeline window.


Force Properties

The following property sheet pages are available for all effects other than conditions:

  • Envelope. Drag the vertical sliders up or down to set the start and end magnitudes of the envelope. If the magnitude of the force is negative, the envelope magnitude moves in the opposite direction, because envelope magnitude is an absolute value.

    Drag the horizontal sliders left and right to set the attack and fade durations of the envelope. The attack and fade durations are shown in the illustration proportionally to the current effect duration. If you change the effect duration, the attack and fade duration retain their fixed values, and the proportions in the illustration are different.

    Offset is not applied in the illustration on this page. Envelope and offset are both applied to the graph on the timeline.

  • Direction. For multiple-axis effects, change the direction by dragging the dial or by entering a value in the text box, in hundredths of a degree.

Each type of force has its own property page that shows the basic magnitudes and, in the case of periodic forces, the period and phase. The effect of envelopes is not shown on these pages.

The following page is available for constant forces:

  • Constant. Set the magnitude of the effect by moving the slider up and down. Moving the slider below the center line gives the force a negative magnitude, thus reversing the direction of the pull.

The following page is available for ramp forces:

  • Ramp. Set the start and end magnitude of the force by dragging the sliders up and down.

The following page is available for periodic forces:

  • Periodic. The diagram shows about two seconds of the effect (even if the effect is actually shorter), with the phase (the starting magnitude) on the left. Set the offset by using the left vertical slider, and the magnitude by using the right vertical slider. Set the phase by using the top horizontal slider, and the period by using the bottom horizontal slider.


Condition Properties

The following property sheet pages are available for conditions only. If the condition is to be set on a single axis, only one of these pages is available.

  • Axis 1 and Axis 2. Set the parameters for each axis by using the sliders. Some parameters are not available for some types of condition. Select the checkbox if you want the negative coefficient (and saturation, if available) to be the same value as the positive.


Playing Effects

To play a single effect:

  1. Select the effect.
  2. Open the property sheet, and click Play.

    Or

    Choose Play Selected from the Effect menu.

    Or

    Press F6.

To play all effects in the window:

Click the arrow on the toolbar.

Or

Select Play All from the Effect menu.

Or

Press F5.

While effects are playing, you can continue to modify the selected effect. Changes in parameters are applied immediately.


Using Effect Files

To save the effects in the active window, select Save or Save As from the File menu.

You can reload effects for further development by choosing Open from the File menu.

Note Sample files are available in the Media folder of the DirectInput sample applications.

To use effects in a DirectInput application, call the IDirectInputDevice7::EnumEffectsInFile method.


Topic Not Found

No matching topic was found. Some possible reasons and remedies are as follows:

  • The file (.chm) that contains the destination topic is not in the expected location.

    Remedy: Rerun the MSDN Library Setup.

  • The file (.chm) that contains the current topic or destination topic is out-of-date and the link is no longer valid.

    Remedy: Install the latest version of the MSDN Library.

  • The MSDN Library CD is not in the CD-ROM drive.

    Remedy: Insert the MSDN Library CD into the CD-ROM drive.