Timedemo and Framerate Test

From X-Plane Wiki

Jump to: navigation, search

Contents

[edit] About the X-Plane Framerate Test

X-Plane contains a built-in framerate test mode. In this mode the sim ignores preferences and loads a fully known and controllable configuration, runs some framerate tests (with user interaction disabled, e.g. no dialog boxes will block operation) and quits. Information is output to the Log.txt file.

The framerate test is aimed at two audiences:

  • It allows Laminar Research to gather performance information from beta users' machines without the risk of configuration error.
  • It allows driver writers to run X-Plane as part of an automated regression system.

This document is written for programmers who want to use X-Plane in a production environment, like an automated regression harness.

[edit] About the X-Plane Time Demo

The X-Plane time demo is a 3-platform bzipped tarball of X-Plane 9 RC3 with some optional content removed to reduce download size.

If you are looking for the X-Plane web demo, do not download the time-demo. Go to http://www.x-plane.com/demo.html and use the web demo installer to get the full demo. The time demo has been stripped of most airplanes to reduce its size. The web demo is hosted by significantly more servers and should be quicker to download. The web demo is also a more recent version of X-Plane!

You should use the timedemo if you are creating an automated test because:

  • It is pre-packaged in a format that can be extracted without running a tool with user interface.
  • It is packed with at least one test flight to vary tests.
  • Because it is a snapshot of RC3, the test parameters will not change when patches come out.

[edit] How to Download the Time Demo

Use these shell commands to get and install the time demo:

curl -O "http://update.x-plane.com/X-Plane_900r3_timedemo.tar.bz2"
tar -xjf X-Plane_900r3_timedemo.tar.bz2
rm X-Plane_900_r3_timedemo.tar.bz2
cd X-Plane_900r3_timedemo

[edit] Running Simple Tests With the Time Demo

Here are some example tests:

./X-Plane-i686 --load_smo=Output/movies/test.smo --fps_test=1
grep FRAMERATE Log.txt

[edit] FPS Test Options And Commands In Detail

The framerate test is controlled by command-line options. Please note that options and preferences discussed here are accurate for RC3 but may be subject to change in the future.

[edit] Running a FPS Test

To run a framerate test, you use the option:

--fps_test=<n>

Where N is a number indicating the FPS test to be run. The FPS tests are pre-built settings. The basic framerate test will run for 90 seconds:

  • 30 seconds of a forward view with the panel.
  • 30 seconds of a forward view with no panel.
  • 30 seconds with a forward view, no panel, simulation paused.

This structure was originally designed to provide a differential cost of the 2-d panel and flight model.

The performance of each of the tests is output to the log file like this:

[edit] FPS Test Codes

Currently the framerate test numbers are built from three digits (leading zeros can be omitted):

  • Hundreds digits - Viewpoint. 0 = default, 1 = view from above, 2 = night.
  • Tens digits - Weather settings (0 is default) - a variety of different weather conditions, 1-6).
  • Ones digits - controls rendering settings: 1 = low, 2 = medium, 3 = high. This controls a range of rendering settings; use individual preferences for more control (see below). Note that 1 gives you "high" tex res (4x reduction in all dimensions, 2 gives you "very high" (2x reduction) and 3 gives you "extreme" (no reduction). This is useful because the _tex_res_ pref seems to not be command-line controllable.

Note that the fly-over interferes with some views - see prefs below.

[edit] Minimum FPS Mode

X-Plane can also be run in minimum-fps mode. In this mode, the sim will run one 30 second test (with flight model and panel on) and then return 1 on success or 0 on failure. Framerate is not logged. Typically this would be used to fail an automated regression test, e.g.

./X-Plane-i686 --fps_test=1 --require_fps=30 || echo X-Plane is running slower than 30 fps.

Note that you must use --require_fps with --fps_test.

[edit] Playing Replay Movies

Normally the fps test will simply leave the plane on the runway; however you can also program X-Plane to load and play a "replay movie" (.smo file) - this is a binary file containing a replay of an X-Plane flight. Example:

./X-Plane-i686 --fps_test=1 --load_smo=Output/movies/test.smo

The smo file is a relative path from the root of the X-Plane folder. The timedemo test contains one movie, test.smo.

The fps test will run for 90 seconds (or 30 seconds for --require_fps) regardless of movie length; you should set your movie to about 90 seconds. Note that the .smo file format is fixed-size; you will not save disk space with shorter movies. (But shorter movies will zip more efficiently.)

One use of replay movies is to vary the viewpoint (by flying the plane) to get a more representative rendering load.

[edit] Controlling Individual Settings

You can override individual settings using the --pref command; the syntax is:

--pref:<name>=<value>

For example:

./X-Plane-i686 --fps_test=1 --pref:_x_res_req_ALL=1440 --pref:_y_res_req_ALL=900

will run the sim with fps test 1 but at 1440x900 res.

Preference names are strings; you can find them by viewing the contents of the Resources/preferences folder (after running the sim normally to init preferences).

  • Res X-System.prf contains a few resolution settings, global to all apps.
  • Set X-Plane.prf contains most non-binary X-Plane prefs that can be set.

Here are some settings that are useful for testing X-Plane performance. Note that I have not tested all of these; this comes from dumping a prefs file to the terminal.

Preference Name Values Example Notes
_alias_req 0=none,1=2x,2=4x,3=8x,4=16x --pref:_alias_req=2 Actual FSAA may be lower due to hw limits.
_col_res_req 16 or 32 (bit depth) --pref:_col_res_req=16 Bit depth - may be ignored.
_prefs_found 0 or 1 (boolean) --pref:_prefs_found=1 This determines whether the first-time user fly-in happens; set this to 1 to skip the fly-in.
_set_res 0 or 1 (boolean) --pref:_set_res=1 If true, X-Plane will try to reset the monitor to requested size.
_x_res_req_ALL pixels --pref:_x_res_req_ALL=1600 Requested x resolution, must be at least 1024.
_y_res_req_all pixels --pref:_y_res_req_ALL=1200 Requested Y resolution, must be at least 768.
_tex_res 0-5 --pref:_tex_res=3 Sets texture resolution; each step below 5 cuts tex res by 2. Appears to not work from cmdline.
_FOVx degrees --pref:_FOVx=20 Sets the field of view horizontally. Vertical FOV is slaved.
_LOD_bias_rat ratio --pref:_LOD_bias_rat=0.5 This adjusts the distance calculations on objects; smaller numbers cause far-away objects to disappear.
_draw_objs_06 0-6 --pref:_draw_objs_06=2 This corresponds to the number of objects popup menu.
_draw_vecs_03 0-3 --pref:_draw_vecs_03=2 This corresponds to the number of roads popup menu.
_draw_cars 0 or 1 --pref:_draw_cars=0 This enables cars on roads.
_draw_birds 0 or 1 --pref:_draw_birds=1 This enables bird drawing.
_draw_detail_wrl 0 or 1 --pref:_draw_wrl_detail This enables high-detailed features like airport light fixtures.
_draw_reflect_water05 0-5 --pref:_draw_reflect_water05=3 This sets the amount of detail rendered into the water reflection texture.
_draw_volume_fog01 0 or 1 --pref:_draw_volume_fog01=1 This enables the "volumetric fog" advanced fog shader.
_draw_shaders 0 or 1 --pref:_draw_shaders=1 This enables pixel shader drawing.
_aniso_filter ratio --pref:_aniso_filter=4 This sets the anisotropic filtering level
_draw_for_05 0 - 5 --pref:_draw_for_05=3 This sets the forest density popup.
_comp_texes 0 or 1 --pref:_comp_texes=0 This enables or disables texture compression.
Personal tools