◉ Pulse
Jimntu avatar
#65 today ▲ 26

Jimntu/StatePlay

Python App

StatePlay: State-Aware Game World Models for Mechanics-Consistent Generation

Created Jul 30, 2026
Stars
12
Today
+3
Forks
0
Quality
88/100
Momentum
31

README

Fetched from GitHub on Oct 30, 2026, 10:15 PM UTC · README.md

View original on GitHub

Third-party content — Open Source Pulse is not the owner of this repository.

This README belongs to Jimntu/StatePlay and its contributors. We fetch it directly from the project’s public GitHub repository and display it for reference only. All text, code, images and trademarks remain the property of their respective authors. See the repository for its license terms. Copyright / takedown policy.

StatePlay: State-Aware Game World Models for Mechanics-Consistent Generation

Project Page arXiv Code Model Dataset

StatePlay: State-Aware Game World Models for Mechanics-Consistent Generation

Zijun Lin1,2,4, Zeqing Wang1,3, Cheston Tan4, Bihan Wen2, Yeying Jin1,3

1Tencent, 2Nanyang Technological University, 3National University of Singapore, 4A*STAR

Introduction

StatePlay: Beyond pixel-level realism toward mechanics-consistent Game World Models! Instead of modeling gameplay through visual observations alone, we explicitly predict internal game states and use them to guide frame generation, ensuring consistency with the underlying game mechanics. StatePlay mechanics-consistent generation

Installation

Requirements: Python 3.10+, CUDA, and a GPU with bfloat16 support.

git clone https://github.com/Jimntu/StatePlay.git
cd StatePlay
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .

Model downloads

Resource Required for Files Download
StatePlay checkpoint Inference StatePlay.safetensors Hugging Face
Wan2.2 VAE and T5 Inference and training Wan2.2_VAE.pth, models_t5_umt5-xxl-enc-bf16.pth Hugging Face
UMT5 tokenizer Inference and training google/umt5-xxl/ Hugging Face
Wan2.2 DiT base weights Training only Three diffusion_pytorch_model-*.safetensors shards Hugging Face

Expected inference layout:

StatePlay/
├── examples/checkpoint/StatePlay.safetensors
└── base_model/Wan-AI/
    ├── Wan2.2-TI2V-5B/
    │   ├── Wan2.2_VAE.pth
    │   └── models_t5_umt5-xxl-enc-bf16.pth
    └── Wan2.1-T2V-1.3B/google/umt5-xxl/
        └── ... tokenizer files ...

To keep weights elsewhere:

export STATEPLAY_BASE_MODEL=/absolute/path/to/base_model
export STATEPLAY_CHECKPOINT=/absolute/path/to/StatePlay.safetensors

STATEPLAY_BASE_MODEL must directly contain Wan-AI/.

Code architecture

StatePlay uses separate visual and state transformer branches with shared joint attention. The visual branch predicts video latents; the state branch predicts the five normalized game states. Both branches are conditioned on the initial frame, text prompt, and action sequence.

StatePlay/
├── stateplay/
│   ├── pipeline.py             # public inference pipeline
│   ├── cli.py                  # command-line inference
│   └── models/
│       ├── dit.py              # StatePlay visual/state DiT
│       ├── vae.py              # video VAE wrapper
│       └── text_encoder.py     # text encoder wrapper
├── training/
│   ├── train.py                # training entry point
│   ├── runner_with_state.py    # optimization/checkpoint loop
│   └── data/                   # SF3 action, state, and prompt loading
├── diffsynth/                  # minimal Wan/StatePlay dependencies
├── scripts/
│   ├── inference.sh
│   ├── run_examples.sh
│   └── train.sh
└── examples/
    ├── inputs/                 # eight bundled inputs
    ├── checkpoint/             # local checkpoint
    └── generated/              # generated videos and state predictions

Run examples

Generate all eight bundled examples:

export CUDA_VISIBLE_DEVICES=0
./scripts/run_examples.sh

Generate selected examples:

./scripts/run_examples.sh --only 01 03

Outputs are written to examples/generated/. Each example produces an MP4 and a _state.txt file. The model is loaded once for the entire run.

Inference

export CUDA_VISIBLE_DEVICES=0

./scripts/inference.sh \
  --image examples/inputs/01_macro_success_clip/first_frame.png \
  --actions examples/inputs/01_macro_success_clip/actions.parquet \
  --prompt-file examples/inputs/01_macro_success_clip/prompt.txt \
  --output output.mp4

This writes output.mp4 and output_state.txt. Defaults are 101 frames, 30 denoising steps, text CFG 5.0, state/action CFG 1.0, and seed 2.

Use custom model paths through STATEPLAY_BASE_MODEL and STATEPLAY_CHECKPOINT, or inspect all options with:

./scripts/inference.sh --help

Training

Download the StatePlay dataset and the Wan2.2 DiT initialization weights listed in the model table above.

Run training:

export STATEPLAY_BASE_MODEL="$PWD/base_model"
export STATEPLAY_DATA_ROOT="$PWD/data/StatePlay-Dataset/SF3"
export STATEPLAY_OUTPUT="$PWD/outputs/StatePlay"
export CUDA_VISIBLE_DEVICES=0,1,2,3

./scripts/train.sh

The script derives the process count from CUDA_VISIBLE_DEVICES. It trains at 480×832 with 101 frames, learning rate 5e-5, state sampling end, and saves every 500 steps.

✉️ Feel free to email me (zijun002@e.ntu.edu.sg) or raise the issue if you have any questions about our work.

Citation

If you find our work useful in your research, please cite it as follows:

@article{lin2026stateplay,
  title={StatePlay: State-Aware Game World Models for Mechanics-Consistent Generation},
  author={Lin, Zijun and Wang, Zeqing and Tan, Cheston and Wen, Bihan and Jin, Yeying},
  journal={arXiv preprint arXiv:2607.26754},
  year={2026}
}
Rendered by GitHub from the repository’s README. Scroll to read the full file.
First trending

Jul 30, 2026

first spotted on the list

Best rank

#34

highest position reached

Appearances

3

times on the trending list

Quality score

88

out of 100

Momentum

31

trend strength indicator

Star velocity

0.13

stars per day since creation

Activity — last 60 days

daily counts, collected every 6 hours
  • Stars
  • Forks
  • Merged PRs
  • Issues
  • Closed issues

Collecting activity data since launch — check back in a few days.

Star history

total stars per snapshot
68101214Jimntu/StatePlay · Jul 30, 2 PM UTC: 7 starsJimntu/StatePlay · Jul 30, 7 PM UTC: 9 starsJimntu/StatePlay · Jul 31, 3 AM UTC: 12 stars2 PM8 PM3 AM

Rank history

position on trending · lower is better
#1#30#35#40#45#50#55#60#65Jul 30, 2 PM UTC: rank #34Jul 30, 7 PM UTC: rank #48Jul 31, 3 AM UTC: rank #652 PM8 PM3 AM

3D card for your website

Live HTML card with a glass surface and pointer tilt. Paste the iframe on any website.

<iframe src="https://www.notionpulse.cc/embed/Jimntu/StatePlay" width="420" height="240" style="border:0;max-width:100%;background:transparent" loading="lazy" title="Jimntu/StatePlay — trending on Open Source Pulse"></iframe>

Stars badge

Show current stars in your README or profile. Auto-updates every 6 hours.

Jimntu/StatePlay stars badge
Markdown
[![Jimntu/StatePlay](https://www.notionpulse.cc/api/badge/Jimntu/StatePlay.svg)](https://www.notionpulse.cc/repo/Jimntu/StatePlay)
HTML
<a href="https://www.notionpulse.cc/repo/Jimntu/StatePlay"><img src="https://www.notionpulse.cc/api/badge/Jimntu/StatePlay.svg" alt="Jimntu/StatePlay stars badge" /></a>

Repository of the Day

#34 Repository of the Day

Repository of the Week

#34 Repository of the Week

Repository of the Month

#34 Repository of the Month