Understanding Players as if They Are Talking to the Game in a Customized Language: A Pilot Study (2024)

Abstract: This pilot study explores the application of language models (LMs) to model game event sequences, treating them as a customized natural language. We investigate a popular mobile game, transforming raw event data into textual sequences and pretraining a Longformer model on this data. Our approach captures the rich and nuanced interactions within game sessions, effectively identifying meaningful player segments. The results demonstrate the potential of self-supervised LMs in enhancing game design and personalization without relying on ground-truth labels.

## introduction the dominant form of human interaction is natural language, represented by a stream of words. language models (lms) have become highly effective in understanding and representing these generalpurpose natural languages. similarly, when a human player interacts with a video game, the primary form of interaction is through game controls, which lead to visual and auditory feedback. this ingame interaction is typically recorded as a stream of events, each with rich attributes and categories. this pilot study explores whether we can apply lms, initially designed for word sequences, to model game event sequences. understanding player behavior through this modeling approach is crucial for designing engaging experiences, improving game mechanics, and personalizing content. for example, understanding the optimal balance between challenge and progression can enable dynamic game difficulty adjustments, maximizing the enjoyment experienced by players. traditionally, understanding game players has relied on surveys and interviews, such as those conducted in @xcite . while these methods provide valuable insights, they are significantly limited by scalability. deep learning (dl) models, like those in @xcite , have been trained on aggregated (from game events) gameplay data to achieve in-game personalization, but they often neglect nuanced interactions. recently, training dl models on sequential interactions between players and in-game items has been explored, as exemplified by @xcite . however, these modeled interactions are still relatively limited in type and richness compared to game events. moreover, most of these dl models only optimize for specific personalization scenarios, requiring large amount of ground-truth labels, which are not always available. as a consequence, self-supervised lm pretraining emerged as a promising approach to directly model the rich and fine-grained game events in a scalable way without requiring any labels. in principle, this pretrained model is not restricted to any specific personalization use case. to the best of our knowledge, this is the first attempt to pretrain an lm on game events by treating these events as a customized natural language. the highlights of this pilot study are: ( §3) studying a popular mobile video game from king foot_0 , candy crush saga, ( §4) developing a simple method for transforming a large amount of game events into language tokens, ( §5) pretraining an lm on the customized "language" representing game events, ( §6) reporting experimental results on the lm's intrinsic performance and its capability in understanding game players, and finally ( §7) we outline measures employed to mitigate ethical considerations. ## related work modeling sequential interactions between users and items has been extensively studied in recommendation systems. initial approaches utilized markovian ## the game and interaction events this pilot study focuses on candy crush saga game. when a player interacts with this game on a mobile device, their behavior generates a sequence of time-ordered events, which are recorded locally on the user's device and later sent to the central game server in batches. example events include starting the game application, beginning a new game round, purchasing in-game items, and displaying pop-ups and notifications. the tracked player behavior events fall into 12 categories, each with an associated schema containing continuous and categorical features. the player-game interaction events are segmented into sessions based on the player's activity semantics, as illustrated in figure 1 . according to game analytics conventions recommended by the data scientists from the game producer, a session is considered to have ended if a player is inactive for 15 minutes or more. for this study, we collected a dataset of player event sessions over 15 days, with 10,000 players uniformly sampled from the entire player population. the resulting dataset consists of 125,000 sessions, split into a 2:1 train-test ratio. the distribution of session lengths in the dataset is shown in figure 2a , while figure 2b depicts the distribution of sessions quantities. both session lengths and quantities approximately follow a geometric distribution. our collected event data, while superficially similar to tracking data in other domains like e-commerce, presents unique challenges. in-game interactions occur at a much higher frequency than in web browsing, resulting in large volumes of potentially redundant events that call for careful preprocessing and modeling of long-range dependencies. additionally, game event sequences are often noisy, with incorrectly ordered events or missing ordering information due to users switching between online and offline modes, which can degrade model performance during training and inference. ## from events to words the raw format of game events is json. to make this data digestible by lms, we designed a simple pipeline to transform raw events into textual sequences. as illustrated in figure 3 , the pipeline begins by removing unnecessary events and fields. leveraging game-specific knowledge, we filter out non-informative data, such as device-specific logs, reducing the number of event fields by over 90%. we bin certain numerical features, such as the hour of the day, based on domain-specific knowledge to convert them into categorical variables. additionally, we group similar in-game event identifiers, e.g., the name of the ui shown, to reduce the vocabulary size. the words are then grouped by users and sessions, ordered by timestamps to preserve the natural interaction flow, and concatenated to form a textual description of a player's interaction experience. we use a word-level tokenizer that splits a spaceseparated string into tokens and maps them to unique identifiers. this approach suits the relatively small vocabulary of behavior data (∼13,500 tokens), though the tokenized sequences are much longer than those in typical nlp tasks like sentiment analysis. ## pretrain a language model the tokenized word sequences are often longer than 512 tokens, which are unmanageable for the conventional bert (kenton and toutanova, 2019) architecture and its derivatives. modeling long sequences poses a significant challenge to transformer-based approaches due to the selfattention operation, which scales quadratically with input length in terms of memory and computational complexity. this challenge is intensified when modeling distant dependencies in extended gameplay experiences that involve concatenating multiple sessions. to overcome this, we adopt long we pretrained several longformer variants foot_1 from scratch with different capacities, based on the hyper-parameters listed in ## results first, we evaluate the intrinsic performance of the proposed approach using intrinsic mlm metrics. we report the cross-entropy (ce) loss and multiclass classification accuracy of predicting masked ## ethical considerations computational modeling of player behavior in games has raised various ethical concerns within both research and industry @xcite . in this pilot study, we utilize non-personally identifiable tracking data from in-game interactions to create vectorized representations of player behaviors. our objective is to leverage these representations to support personalized and enhanced player experiences while maintaining ethical standards. potential ethical risks include (1) biases in the input dataset, such as under-representing less frequent player behaviors, and (2) the misapplication of models to different data distributions, known as type iii errors @xcite . to mitigate these risks, we use robust data validation and automated model analysis tools available in productionready machine learning frameworks @xcite . we address under-represented player behaviors through qualitative evaluation methods, such as embedding space visualization. additionally, we periodically retrain the model with recent data to address distribution shifts, with retraining intervals determined empirically based on model performance and data drift. for the downstream recommendation system, we plan to implement model explainability and uncertainty estimation methods to better understand the model's robustness, biases, and other ethical considerations. these measures aim to ensure that our modeling approach supports ethical and responsible ai deployment. ## conclusion and future work this pilot study demonstrates the potential of using self-supervised language models to understand player behavior by modeling game event sequences as a customized natural language. our approach, leverages the longformer model to effectively captures the rich and nuanced interactions within game sessions in a self-supervised manner, agnostic to downstream use-cases. the results highlight the model's ability to identify meaningful player segments, providing valuable insights for game design and personalization. for future work, we plan to extend training to single-and multitask fine-tuning with labeled datasets to benchmark against fullysupervised baselines. we anticipate that our approach can be extended to other event-based game datasets as well.