Manuscript Offprint

arXiv:2609.37907

Pixels to Keys: Exploring Spatial and Motion Cues in Gameplay Inverse Dynamics

Abhishek Pillai, Ekta Prashnani, Joohwan Kim, Iuri Frosio

Abhishek Pillai 1^{1}, Ekta Prashnani 1^{1}, Joohwan Kim 1^{1}, and Iuri Frosio 1^{1}

NVIDIA

{abpillai,eprashnani,sckim,ifrosio}@nvidia.com

Abstract. Video games offer scalable environments for studying perception and control in embodied agents. Abundant online gameplay videos could supply demonstrations, but they rarely include player inputs for training. Inverse Dynamics Models (IDMs) have thus been proposed to infer inputs from frames. Large (up to 1B parameters) IDMs trained on ~1K-2K gameplay hours demonstrate feasibility and cross-environment generalization at this scale, but researchers do not clarify what the key components are to recover individual actions and often report only aggregate accuracy that can mask rare-action failures. We study the problem in a data-constrained scenario to evaluate how spatial motion features, model architectures, and training objectives affect an IDM's outcome and we analyse our models on per-key and balanced metrics such as F1macroF_{1}^{macro}. Our experiments on Trackmania highlight the importance of factors like the model architecture and motion flow extraction in preprocessing, while also showing the limits of evaluation through unbalanced metrics. The application of the same architecture and training recipe to Cyberpunk 2077 reveals uneven performance across game mechanics. Our per-action evaluation and failure analysis highlight ambiguities from camera motion, delayed effects and imbalanced key-press frequencies that call for explicit modeling of 3D scene structure, long-term state and the adoption of proper losses in future implementations.

Keywords: Inverse Dynamics · Key-Press Reconstruction · Video Transformers · Optical Flow · Video Games · Embodied Agents

1 Introduction

Beyond their commercial importance, video games are used as testbeds for perception, sequential decision making and embodied control [3] [13] [17]. Learning from gameplay requires pairs of frames and actions issued by human or digital players to train agents with methods like Behavioral Cloning (BC) [2], Reinforcement Learning (RL) [21], or to gain understanding of visual-motor control.

Despite abundant gameplay videos available on the internet, only a few of these are annotated with Keyboard and Mouse (KBM) actions. Manual annotation at scale is practically impossible, whereas the acquisition of new datasets with frames labeled with KBM data is costly and time consuming. Therefore we study the possibility of automatically annotating such videos with KBM labels.

A. Pillai et al.

The problem is far from trivial for several reasons, including actions with delayed effects (e.g., inertia affecting camera motion without any steady input); also, different actions may produce the same visual results, whereas certain actions may produce poorly visible features (e.g., a car turning while driving against a wall). Additionally, the action distribution may be highly imbalanced (see Fig. 1). Disentangling camera motion from character motion is yet another complication.

Existing works establish this idea at scale. VPT [2] is a 0.5B parameter IDM trained on 1,962 hours of labeled Minecraft data and used to annotate 70K hours of web video. D2E [7] uses a generalist model with 1B parameters trained on 1.3K hours of data (259 hours of human demonstration, 1K hours of pseudo-labeled gameplay). These systems recover broad KBM action spaces and demonstrate the value of scale, but the question we intend to answer is deliberately smaller: before broad action recovery, how well can we recover navigation inputs from purely visual data? By answering this we highlight constraints that may become significant at a larger scale and in applications such as: annotation of online recordings, latency correction in poorly controlled acquisition setups, or the adoption of KBM annotation as an auxiliary task in complex training scenarios.

Our contributions are:

(a) Trackmania

Third-person driving

Figure

Key usage distribution

(b) Cyberpunk 2077

First-person navigation

Figure

Key usage distribution

Fig. 1: Sample sequences and key-press distributions for Trackmania (a) and Cyberpunk 2077 (b). Distributions are on a log scale: key usage is highly imbalanced.

  1. For Trackmania, a 3rd3^{rd} person view and mechanics video game, we isolate the effects of different factors (including frame resolution, use of pretrained embeddings, loss terms and prediction size) and highlight that model architecture, optical flow in input, and contrastive learning provide the most significant advantages.

  2. We highlight the importance of adopting per-key and unweighted metrics for proper evaluation of IDMs.

  3. We identify limitations, open problems, and guidelines for future research by applying the same model and training recipe to Cyberpunk 2077 ( 1st1^{st} person view). We analyze, on both games, the spatial action-query attention map, to show, for instance, the importance of equipping the IDM with the capability of disentangling the camera motion from character motion.

References (44)