Data Sender

A plugin by ar(Trusted developer)

Data Sender
Downloads 222
Updated 26 days ago
Released 1 year ago
Identifier DataSender
Numeric ID 731
Min. Openplanet 1.26.0

This plugin was developed using generative AI.

Game Trackmania
Game Maniaplanet 4
Game Trackmania Turbo

(meant as a replacement for the unmaintained: Data Gatherer for Reinforcement Learning plugin)

Trackmania 2020 — DataSender Plugin Docs

A tiny guide for grabbing race + vehicle-state data over sockets.

OBS: Make sure that you enable the plugin in the openplanet settings as this plugin does not come with automatic sending turned on.


What this plugin does

Channel Endpoint Payload Rate Purpose
Race feed ws://127.0.0.1:{PORT}/feed One JSON "snapshot" per interval (map, CPs, players, etc.) SEND_EVERY_MS Live leaderboard / HUDs / data logging
Vehicle state ws://127.0.0.1:{PORT}/vstate Per-frame car telemetry (pos, speed, slip, RPM ...) Every frame Motion rigs, analytics, fancy overlays, training

Configuring

Open the General tab in the Openplanet overlay (F3):

Setting Meaning Default
Send every (ms) (SEND_EVERY_MS) Snapshot 1 ms (max ≈1 kHz)
Port (PORT) TCP port used by both channels 8765
Automatic startup on plugin load Fire up sockets as soon as the script loads off

Buttons: connect / reconnect / restart server + connect / disconnect / Reset to defaults – self-explanatory.


Quick-start receiver (Python)

# 1 Install deps (once)
pip install websockets

# 2 Run the dual-channel logger
python feed_server.py          # or  python feed_server.py --mode feed|vstate|both

When the plugin connects you'll see pretty-printed JSON dumps like:

{
  "map": "Stadium C-05",
  "gameTime": 123450,
  "cpCount": 12,
  "players": [
    {
      "name": "Zoop",
      "login": "zoop123",
      "raceRank": 1,
      "bestMs": 56234,
      "respawns": 0
    }
  ]
}

Vehicle snapshots contain fields such as spd, pos, rpm, slipFL, gear, etc. (see vstate.as for all fields).


Integrating into your project

  • Replace the logging.info(...) lines in feed_server.py with whatever pipeline you need—DB insert, OSC forwarder, HTTP POST, etc etc etc
  • Writing your own client? Any WebSocket library will do—just subscribe to /feed and/or /vstate and parse JSON.
  • Remember to handle reconnects: the client in client.as will automatically try again every 3 s if the socket dies.

Changelog

2.0.0 - 26 days ago

In this version I've essentially completely rewritten the plugin. The old socket flow has been replaced with a local TCP telemetry server, a source registry, external control commands, subscriptions, filtering, and much better runtime hardening.

I've:

  • Replaced the old WebSocket-style feed/vstate workflow with a local TCP server on 127.0.0.1:28765
  • Added external commands for service control, source enable/disable, broadcast settings, and client field filters, and more
  • Added per-client subscriptions, including subscribe-all, unsubscribe and more
  • Added per-client field filtering so clients can request only exact fields from large sources
  • Added telemetry rate limiting/coalescing to protect clients and keep the plugin more stable
  • Added demand-driven sampling (enabled sources are only sampled when at least one live client requests them)
  • Added stronger error handling so source failures produce available: false payloads instead of taking down the sender (which would have previously required manual intervention to restart)
  • Added stricter command validation and safer disabled-source behavior

The plugin also handles more sources now, and made the previous sources richer!

  • race_data focuses on race/map state from MLFeed::GetRaceData_V4(), read more about that here: MLFeed Documentation
  • player_cp_info now focuses on CP data from MLFeed::PlayerCpInfo_V4, read more about that here: MLFeed Documentation
  • vehicle_state is much richer
  • camera is much richer Note: Optional dependencies now report explicit unavailable reasons instead of silent empty data.

More games have support now! (MLFeed data is not available in other games, but vehicle state and camera are available when the shipped OP plugins are available)

BRAKING CHANGES

-# there is a reason for the major bump xpp

Anyway:

  • The old WebSocket endpoints such as /feed and /vstate are no longer the primary interface
  • The default port changed from 8765 to 28765
  • External readers now connect to the plugins TCP server instead of waiting for the plugin to connect to them
  • The Payload schemas have changed significantly, take a look at: documentation, for more information on the new setup!

View all changelogs