TMInterface

TMInterface is the de facto standard TAS tool for TrackMania Nations and United Forever. It allows you to replay, analyze and modify runs to achieve faster times and push the game to its limits. It is not meant to be a tool for cheating or unfair play and this is why it comes with security features that doesn’t allow for this.

Do not ever attempt to drive legitimate runs and compete on public leaderboards while running this client. Any run done with TMInterface is a tool assisted run, regardless if the tool injected inputs or not.

TMInterface is also compatible with the Competition Patch and can load the TMUnlimiter mod if you have it installed.

Warning

The tool may be detected as malicious by your browser/antivirus. It is recommended to disable antivirus while installing the tool, and adding the game installation folder to a list of antivirus exceptions.This is because the tool injects its own DLL into the game, which is seen as malicious by antivirus software. See Installation for more instructions.

Features

TMInterface comes with plenty of useful features that help you work with the game and extend the tool:

  • Race speed modification
  • Full, deterministic input playback
  • A command system with bindable commands
  • Native save states
  • Bruteforce script
  • Server API to hook into the game simulation
  • Input visualization
  • And more!

Changelog

This release features an all new trigger settings page, from which you can add/remove/place triggers using the UI. Trigger placement can now be modified exclusively using the mouse, including position and size:

  • Added sliders for position/size
  • Added “Add trigger” and “Remove all” buttons
  • Add togglable “Mouse edit” checkbox that allows a trigger to be moved around in race using mouse + control keys (a helper icon will appear once Mouse edit has been activated which explains how to use it).
  • Add trigger color configuration that allow setting a default color and a hit color
  • Hovering individual triggers in the settings window lights up the trigger in the settings window also. The highlighted color is always the complementary color of whatever the triggers color currently is
  • Triggers now also light up when the car is inside of it
  • Editing/adding/removing triggers is not allowed during bruteforce
  • Triggers now have a maximum/minimum size/position (0.001 to 100000 for size, -100000 to 100000 for position)
  • When using the “Add trigger” button or add_trigger command without arguments, triggers will be added based on context. When adding a trigger while inside of race, the triggers will be added in front of where the car is pointing (in case of cam 1-3), or front of where the camera is looking (in case cam 7) or when in menu, a default grid will be used

Widgets:

  • The speed graph now uses real speed for Y axis
  • Speed graph’s X axis delay was fixed

Bruteforce:

  • Bruteforce no longer displays -1 lines for each attempt. Instead, only attempts with same time will be displayed instead. The number of changed inputs can be viewed in the console window title.
  • Bruteforce inputs are not dumped into the console anymore

General:

  • The UI style was refreshed
  • Fixed “processing changes” showing up even though no processing is being done
  • replay rewinds to 3 seconds before the provided time to allow for take-over preparation
  • Camera 7 no longer changes POV while scrolling in TMInterface’s UI

Commands:

  • add_trigger now accepts no arguments as well, and remove_trigger also accepts a new argument “all”

Variables:

  • Added variables trigger_default_color, trigger_hit_color

  • Fixed bruteforce stopping when bruteforcing for a checkpoint while using the Search Forever option
  • Fixed rapid changes to the input file would not rewind to the latest change, discarding the newest changes

NEW: automatic save states. This is the beginning of the work to increasingly remove set speed from the editing workflow. From now on, TMI will detect your changes to the input file and immediately restore a save state just before your change, so that you can watch the results instantly. This means you do not need to use set speed within your input files just to see your changes. This detection works across different scripts and maps, so e.g. if you load a different input file with only a few inputs changed from the previous one, TMI will use its existing knowledge to skip the part that it already knows to be the same. This knowledge is not persistent across game sessions yet.

General:

  • Removed [Topic] badges from the console messages and replaced them with icons
  • If there are any errors in the currently loaded input file, TMI now displays the line where the error occurred
  • Updated installer: now notifies the user that the game is running and will prevent installation in other games than supported ones
  • Aliases can now be used in timed commands. For example: alias pu "press up"; 0 pu.

Commands:

  • Add binds command - shows all currently bound keys
  • replay has been reworked. Executing the command in the game menu will replay the inputs from the validation replay. If you provided a timestamp to replay, replay will now immediately rewind to that time, after initially simulating it with increased speed. replay now also supports relative timestamps such as replay 2.00- and replay 5.00+. Note that this feature only works with input files. For more details, take a look at Commands.

Variables:

  • Add sim_convert_analog - converts keyboard left/right presses into steer commands. Works with dump_inputs and bruteforce.
  • Add autorewind - controls whether TMI should detect changes and automatically rewind to the latest save state
  • Add autorewind_nofinish - controls whether making a change in the input file will prevent ending the race
  • set now explicitly displays what a variable has been set to

Bruteforce:

  • Fix trigger distance was 0 or too low
  • Initial phases are now faster if using minimum timeframe for inputs

General:

  • Rework settings UI for a sidebar navigation and iconography
  • Make time UI inputs accept decimal or numerical format. You can switch the format by clicking on the s.ms button in the input field.
  • Removed extended steering option from UI (still accessible through extended_steer)
  • Prevent double reloads when saving input files with VSCode
  • Fix formatted timestamps with leading zeros e.g 1.00 were wrongly interpreted in commands
  • Fix formatted timestamps not erroring if the string is not a number
  • Fix TMInfinity being loadable after being logged in
  • Fix regression with inputs not being injected with Alternate Method option checked (after 1.1.0)
  • Add Camera 7 position and RPM info to the properties window
  • Add Reset Window Layout button to misc settings
  • Add widget & trigger settings
  • Visibility of all widgets is now saved by default. This means that you do not need to manually add e.g toggle_inputs to your config.txt file

Input display:

  • “Show Input Display” UI option now only controls the default input display
  • More accurate input visualization in the input display for obscure cases
  • Adding a new input display now copies style settings from the default one

Save states:

  • Save states now save inputs and restore them. After restoring a save state, inputs are available with recover_inputs and saved in the replay
  • Fix race camera being in the wrong position after loading a save state

Variables:

  • Add save_triggers: if set to true, saves triggers between game sessions
  • Display a warning if execute_commands is disabled but a list with input commands is loaded
  • Remove start_time variable

Commands:

  • tp now supports teleporting relative to the current car position e.g: tp 50- 200+ 90
  • Fix bg_steer_color and steer_color not saved properly in builtin.txt
  • Add acceleration_color and brake_color that set up/down keys color for the input display
  • Add toggle_triggers to toggle trigger visualization
  • load_state now loads the latest save state saved with save_state without any arguments
  • toggle_ commands now print out a message if the widget was shown or hidden

Triggers:

  • Triggers are now visualized in the race and in validation (with debug mode)
  • You can now choose to save triggers between game sessions. This setting is disabled by default and is available in the Settings Triggers tab.
  • Reject adding a triggers with same position and size

Bruteforce:

  • Bruteforce now ignores triggers before bf_inputs_min_time

API:

  • Fix calling set_input_state in simulation mode resulted in inverted steer inputs
  • on_simulation_step is no longer called when bruteforce is enabled (only on_bruteforce_evaluate)

General:

  • Bring back turning rate label in properties window
  • Do not allow closing console & settings windows
  • Fix state_info crashing on non-existent files
  • Highlight and make input display closable
  • Prevent widgets going offscreen
  • TMI will now not dump input commands that lasted no time e.g: 0-0 press up
  • TMI now removes any duplicated steer and gas commands in its output that are added with “Fill Missing Steering Input”
  • Fix crashes when setting scripts_folder to a folder that cannot be autocompleted
  • Fixed minutes formatting in inputs shown by TMI
  • Input display now properly handles mixed analog and keyboard inputs when showing inputs
  • Joystick visualization now shows keyboard left/right inputs too
  • Fix editor camera moving when hovering mouse over TMI windows

Commands:

  • Fix add_input_display working incorrectly
  • Rework identification of input displays. Input displays are now named after the input file they are showing. This is reflected in toggle_inputs, remove_input_display and input_displays commands.
  • sleep and warp now accept formatted timestamps e.g: warp 1:90.23
  • sleep is now taking the time in milliseconds

Variables:

  • start_time, bf_inputs_min_time, bf_inputs_max_time and bf_override_stop_time now support formatted timestamps: set bf_inputs_min_time 1:34.09
  • Setting scripts_folder to a non-existent folder now warns the user
  • random_seed variable is now implemented. Setting this variable sets a new random seed and creates reproducible results every time you launch bruteforce.

Bruteforce:

  • Fix bruteforce crashes after ending/starting the race
  • The ending message now shows properly in the in-game menu

Save states:

  • Fix incorrect inputs restore in run mode
  • Fix the resulting replay ghost being unaligned when restoring a save state

TMInterface now ships with our own TrackMania game executable. What this essentially means for you is that it is no longer needed to apply the Steam patch. Simply install TMInterface with the installer and all will be done for you. The change also extends the limit of game’s maximum used memory from 2GB to 4GB. This allows for bruteforcing very long replays and also rendering long videos where the game used to crash after reaching the 2GB limit. These fixes aren’t exclusive to TMInterface - running the game without TMI will also have these features.

Commands:

  • Added cam command: switch camera during the race. The available cameras range from 0-9. Example: cam 3 switches to the internal camera.
  • Added server_info command: get information about the server name and buffer size of the current instance (for API users)
  • More robust map command: it will now always open the map in the correct game instance and suggest maps from the correct folder
  • Renamed open_stdout to open_external_console
  • load now actually supports loading script files from nested directories

UI:

  • Added TMI version to the window title
  • Added submit button to the console
  • Text now wraps in all parts of the UI and the console
  • Added position/velocity buttons to easily copy this information from the properties window
  • The Help tab is now redesigned
  • The console input is now not cleared after un-focusing/focusing the console
  • More robust input/focus management between the game and TMI UI
  • Restricted value of maximum steering difference and updated UI text

Fixes:

  • Fix the “Yes” button sometimes disappearing from the menu when using autologin
  • Fix freeze on restoring state in debug mode when validating
  • Fix degrading performance when using recover_inputs/dump_inputs many times
  • Fix state_info crashing on non-existing state files
  • Display a useful error when TMInfinity loading failed
  • Fixed displaying map names with color codes in Discord Rich Presence
  • Fix bind taking wrong number of required arguments
  • Some grammar fixes and simplifications
  • Filename completion now supports nested directories for both scripts and save states
  • Scripts in nested directories are now properly reloaded when modified
  • Command line arguments are now passed properly to the TrackMania instance when launched with TMI
  • Fix pressing space after completed command still shows suggestions for that command

Bruteforce:

  • bf_inputs_max_time is now limited when bf_override_stop_time is also set
  • Improved speed of bruteforce when using maximum time difference
  • The console no longer spams “Trigger evaluation” when in debug mode
  • The full improvement message is now saved in the result file, including trigger improvement details

API:

  • Save states are now fully compatible with each other in the two different context modes. This means e.g. that you can execute save_state in a normal race and then use that state to rewind the exact state in the simulation mode through scripts.
  • Bruteforce will now really do nothing when returning DO_NOTHING in the on_bruteforce_evaluate hook
  • Bruteforce now uses the simulation time limit (settable through set_simulation_time_limit) to determine whether to end the initial phase
  • Custom commands when timed are now just passed onto the script
  • Custom commands are now cleaned up after deregistering
  • Reject registering already builtin commands
  • get_event_buffer now returns player inputs in run mode

Misc:

  • Add a /configstring parameter to execute a config string through command line of TMInterface.exe (not in-game console)
  • Implement /serversize parameter to set a custom server buffer size (not in-game console)

Discord presence: want to monitor the status of bruteforce from Discord? Enable the Discord presence setting inside the Miscellaneous settings to show off your TMInterface status to others. The status shows the most important activities such as bruteforcing, editing a map or playing it.

General:

  • Custom commands are now being autocompleted
  • Fix timed custom commands being executed immediately
  • Fix game crash when inputting special characters into the console window
  • New default font for UI elements
  • New default ping sound for bruteforce improvements. If you do not like the default sound, you can now replace it with your own, by creating a Sounds folder inside your Documents\TMInterface folder and placing your sound with the name Ping.wav. The file has to be in a WAV format. Read more: https://donadigo.com/tminterface/customization
  • The same goes for the default font that TMI uses for its UI too! Create a Fonts folder in the same location, and place your font with the name “MainFont.ttf” The file has to be in a TTF format.
  • The startup message now explains why you cannot access online game features and removes the “Connect” button

Commands:

  • Add finish. Forcefully finishes the current race. Useful when you need to save the replay without finishing the map
  • Add alias. Tired of writing press right or set speed? Just alias it: alias pr "press right" will alias pr to press right. The aliased command can then be used in the console and in input scripts as well. Check out the documentation for more details.
  • Add copy_log. Copies the entire console log into the clipboard
  • add_trigger no longer accepts triggers of size 0 in any dimension

Variables:

  • Add bf_improvement_pause. Set to true to completely disable TMInterface waiting after displaying the improvement message
  • Add autologin. Set this variable to your login name in-game to make TMInterface automatically log you in every time you launch it
  • Add discord_presence. This variable controls whether or not TMInterface reports its status to Discord.
  • The background variable is now in the format of R,G,B which adheres to other color related variables. For example: set background 255,255,0 will set the game background to yellow.
  • The log_bot variable now does not affect immediate input commands

Bruteforce:

  • Better distance evaluation: the distance is now calculated to the actual faces of the trigger instead of its edges, resulting in a more accurate evaluation
  • Fix trigger “distance then velocity” evaluation not favouring distance first
  • More explicit warning message when inputs cannot be changed due to settings
  • Fix triggers not respecting the bf_override_stop_time setting
  • Fix outdated information shown in the console title when not using search forever

Save states:

  • Fix being able to save corrupt save states while still in countdown

General:

  • All settings are now saved into the builtin.txt file to preserve them across game sessions. If you want to disable this behaviour, see: The config file
  • Added Help settings tab with useful links
  • If TMInfinity is not found, TMI will try to load TMUnlimiter instead
  • Fixed color settings not saved correctly
  • Unfocusing/focusing the game will no longer stop injecting inputs (you can now change game focus and still replay inputs!)
  • Fixed game freezing after alt-tabbing
  • Fixed high CPU usage after loading a file
  • Added “Real Speed” and replace Aim Direction with Yaw/Pitch/Roll in the Properties display
  • The game will no longer display low FPS warnings when opened with TMI

Commands:

  • The speed variable now applies only when in the race
  • bg_input_color and steer_color commands now take the color in an “R,G,B” format, e.g: bg_input_color 0,255,100
  • log_bot is now defaulting to false
  • Fixed bind crashing when receiving an unknown key

Bruteforce:

  • Added bf_play_sound variable: if set to true, TMI will emit a sound when it finds an improvement
  • Added bf_trigger_eval variable: by default distance, provides a way to optimize for different metrics, other available metrics are: distance,velocity and velocity
  • Display search status in the bruteforce console title
  • Fixed bruteforce would not reset best time that caused bugged behavior with invalid physics replays
  • Fixed bruteforce would not remember trigger state after rewinding to a different state

Save states:

  • Fix repeating inputs from the future when restoring a state

Server/API:

  • The API received some breaking changes, if you are developing scripts, it is necessary to update them. See how in #api. Remember that it is still not a finalized API.
  • New APIs: horn(), give_up(), set_simulation_time_limit()
  • API’s such as set_input_state() and respawn() now work in simulation. This provides a much easier way to manipulate input state within the simulation context. See Python docstrings for details.
  • on_simulation_step now receives a race time in its time parameter instead of the absolute time
  • Fixed the server sometimes sending an empty simulation state
  • Client input change requests now work regardless of the execute_commands setting

General:

  • Update UI style
  • Fix parts of the UI drawn over lightmaps and game thumbnails
  • Fix map completion crashing when the tracks folder does not exist
  • Display executed input in the console after all command transformations (cmd_steer_*, cmd_base_time)
  • Raised command length limit to 4096 characters
  • Fix some crashes in bruteforce
  • Fix aim direction displaying wrong values
  • Add turning rate property into properties window
  • Fix wrong rewind timestamp in state file being displayed
  • Fixed timed unload crashing

Commands:

  • Add start_respawn. Set to true to enable online respawn behavior for start respawns.
  • Add bg_input_color to set background color of an input display
  • vars now saves input display and triggers settings into the clipboard
  • Add deregister to force deregister currently connected client
  • add_trigger now uses start point and end point coordinates: instead of add_trigger x y z size_x size_y size_z it is now add_trigger x1 y1 z1 x2 y2 x2 where the two points mark start and end point of the trigger cube
  • cmd_base_time is now applied immediately for all input in the same time
  • press horn is now available

Variables:

  • Add format_decimal_time that changes all output to use decimal time format
  • Add format_separate_rel that makes releases a separate command in all output

Server/API:

  • Fix rewind_to_state in simulation debug mode bugging out visualization
  • on_registered is now a synchronous server call
  • New APIs: log, register_custom_command, on_custom_command, on_bruteforce_evaluate
  • Improve performance of calls to the server

NEW: Save states

This update features an initial implementation of save states, and as with anything there can be severe bugs. Save states are useful for quick hunting and working on longer tracks such as E05.

  • save_state: saves the current race state into a 10kb file, stored in the States folder inside your Documents\TMInterface directory. This file can then be used to restore the exact state later on and can be also shared with others. The file itself does not contain the inputs used to get to that state. The primary way to share runs is still sharing the inputs file and save states are great for quick trial and error. Example use: save_state: saves the state to a file with an automatically generated filename.
  • load_state: loads the provided file you have saved with save_state. In the future, the format of the state file can evolve and as such it is possible that older versions of the tool will not be able to load files saved by the newer versions. Example use: load_state state.bin
  • state_info: displays information about the provided state file such as its version, race time, map name it was saved on and car position

It is recommended that you bind some of these commands to keys so that it’s possible to e.g quickly restore a state. You can also use the global syntax e.g 0 load_state state.bin to load a save state immediately when the race starts.

General:

  • bind now requires quoting of commands you want to bind if they contain spaces. It is likely that your bindings will stop working and they need an update. If you e.g have bind f1 set speed 1 it should now be changed to bind f1 "set speed 1" instead.
  • An analog device or software such as VJoy is no longer required to replay analog input. TMInterface will automatically register necessary bindings to make it work (unless it fails to, which in this case it will warn you).
  • press delete is now implemented to cover all game input
  • steer and gas now support time ranges e.g: a command 2000-3000 steer 10000 is now equivalent to 2000 steer 10000; 3000 steer 0
  • the extended_steer variable is now applied to intermediate commands as well (previously only for scripts)
  • The input display will now change the color to red when an extended steer range is used
  • Fix removing non existent trigger crashing the game
  • Improvements in printing out inputs with recover_inputs
  • Fix completion of filenames with spaces
  • Fix timestamps like 0.1 being translated to 10ms
  • Fix map crashing without any arguments
  • Performance improvements: TMInterface should no longer hammer your CPU while not doing anything

Bruteforce:

  • It is no longer required to export the replay for validation when using bruteforce. Simply set the controller to bruteforce and then validate a normal replay to start.
  • Fix a regression introduced in 1.0.5 where there would be differing results between the bruteforce result and the actual one
  • Fix trigger bruteforcing would stop working after finding one improvement
  • Fix bf_max_steer_diff still affecting press left/right even if set to -1

Server:

  • Raise buffer size to 65KB
  • Fix accelerate ID in control names being assigned to analog accelerate
  • New simulation APIs: remove_state_validation, prevent_simulation_finish and on_shutdown

The command list has now been moved to https://donadigo.github.io/tminterface-commands! From now on all information will be on this page, you can also check out a work in progress documentation for the server API: https://donadigo.github.io/tminterface-server.

General:

  • Fix adding unnecessary ; in config string from vars command
  • Added support for splitting commands with ; in one line in script files
  • Preparation for savestates
  • Add steer direction into the properties window
  • Add extended_steer variable to prevent accidental usage of extended steering values. By default it is false and makes sure all inputted steer values are within the normal range. Set to true to enable extended steering again.
  • Fixed game crashes when sim_debug is set to true
  • Fixed a possibility of tp crashing the game

Triggers:

  • Rename bf_add_trigger, bf_remove_trigger and bf_triggers to add_trigger, remove_trigger and triggers respectively
  • The trigger activation info is now displayed in the console in a normal run. This allows you to test if your trigger is correctly placed and if it will be reached by the base run

Bruteforce:

  • Remove bf_target: the variable was confusing at most and not needed. The target is now chosen based on bf_target_cp and bf_target_trigger being set instead
  • Remove bf_modify_number as it is not functional yet
  • Rename bf_override_finish_time to bf_override_stop_time, the variable now works with triggers and checkpoints
  • Fixed bf_max_time_diff causing invalid results and negative times being produced
  • bf_max_steer_diff can now change binary press left/right. Setting it to a positive value like 10000 may change the input 1000-2000 press right to 1000 steer 55356; 2000 steer 0 so you don’t need to set bf_max_time_diff anymore.
  • You can now change bruteforce settings live when sim_debug is set to true. Some settings may not be changed anymore such as bf_override_stop_time or bf_inputs_extended_steer
  • The Pause/Break key to stop the script is now gone. Simply use the Escape key instead (the bruteforce console has to be the focused/active window)

Fixes:

  • Fixed compatibility with Windows 7: no more missing api-ms-win-core-path DLL errors
  • Fixed the tool not working at all on some systems
  • recover_inputs and dump_inputs now take an additional optional argument to save the inputs to a file e.g recover_inputs test.txt or recover_inputs test will save the inputs to test.txt
  • Additional info on console startup

Fixes:

  • Fixed some compatibility problems with the tool not working at all (still exists though)
  • Installer now includes the option to create a desktop shortcut
  • Fixed bf_override_finish_time not working correctly when bf_search_forever is set to true
  • Fixed spelling in some of the bruteforce console text
  • Add stunts score into the info display
  • vars now accepts an optional argument to display the value of a particular variable e.g vars bf_modify_prob
  • vars now copies a compact config command into the clipboard that you can share with anyone. This is a quick & easy way to share your console/bruteforce settings, without manually checking what you’ve changed. The command will also not include any personal settings such as scripts_folder.

  • Fix the tilde key not showing the console in some cases

General

  • Throw an error when TMInterface fails to initialize. Will help debug the cases where TMInterface does not load.
  • Add binding keys for numpads num0, num1, num2 etc.
  • Better console message when analog bindings are missing
  • Add toggle_console command to toggle the console
  • Fix bind key not showing in the binding message
  • Automatically force alternate method to be disabled, fixing issues with input not being injected

Bruteforce:

  • Added welcome text and new color formatting to the bruteforce output
  • Fix bf_inputs_min_time and bf_inputs_max_time not restoring the correct simulation state, causing invalid results
  • Automatically go windowed when starting a bruteforce script in fullscreen
  • Add a new bf_result_filename variable that allows to change the filename of the final result
  • The script now saves it’s results into scripts_folder instead
  • Save the time and number of iterations to the result file
  • Number of iterations now doesn’t reset on new improvement

The initial release of TMInterface.