Minimal Steam Input API access for mods

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

M1k3y
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Dec 18, 2019 9:14 pm
Contact:

Minimal Steam Input API access for mods

Post by M1k3y »

With Factorio 2.1 approaching its final release, I wanted to ask whether Wube would be willing to consider exposing a small part of the Steam Input API to mods.

I am not asking for Factorio to implement full native Steam Input support. My goal would be to implement that functionality in a mod instead.

What I would need from Factorio is only a narrow bridge to the relevant "ISteamInput" functionality already available through Steamworks, for example enough to:

- access connected Steam Input controllers;
- resolve and read digital/analog actions;
- select action sets/layers;
- query action origins/glyphs where useful.

The mod could then handle the higher-level integration itself.

I realise Factorio's Lua environment is intentionally sandboxed and deterministic, particularly for multiplayer, so simply exposing arbitrary native functions would obviously not be appropriate. I am only suggesting a deliberately restricted Steam Input interface, and input events could potentially be routed through Factorio's existing player-input mechanisms if direct polling from runtime Lua would cause determinism problems.

The motivation is primarily to support Steam Input's native/action-based mode rather than relying on Steam translating controller inputs into ordinary keyboard/gamepad inputs. This would enable things such as contextual action sets/layers, better use of Steam Controller/Steam Deck controls, and mod-defined controller interactions.

One complication for implementing this entirely in a mod is Steam's handling of the Input Action Manifest. Steam currently has good support for a developer-provided manifest, but no clean mechanism for a mod to persistently add or maintain its own actions. I have opened a separate Steamworks feature request proposing persistent/versioned manifest overrides or overlays for this use case, so I am hoping that part can be addressed on the Steam side rather than requiring Factorio to implement its own manifest-management system.

Before putting together a more detailed proposal or prototype, I mainly wanted to ask:

Is exposing a small, purpose-built Steam Input interface to mods something Wube would be willing to consider for 2.1 or later?

If so, I would be happy to investigate the smallest useful API surface and provide a more concrete proposal.
Post Reply

Return to “Ideas and Suggestions”