--- license: mit language: - en pipeline_tag: reinforcement-learning tags: - counter-strike-2 - trajectory-prediction - transformer - esports --- # CS-NET v4 — CS2 Path Prediction & Spatial-Only Models Trained checkpoints for **CS-NET v4** — a Transformer-based framework for Counter-Strike 2 game-state forecasting. Full open-source code (training, inference, 3D visualizer) is available at **[github.com/Gary2005/cs-net](https://github.com/Gary2005/cs-net)**. All checkpoints use the **Pro architecture** (d_model=768, ~138.7M params), see `config/pretrain-a100-pro.yaml` in the source repo. ## Files | File | Task | Description | |---|---|---| | `cs-net-v4-pro.pt` | Path prediction (pre-training) | 600k steps. Full model: `{model, global_step}`. Auto-regressively predicts each player's future movement path (16 ticks = 4 s) from a window of the full game state (10 players + bomb + projectiles + raycast depth maps). | | `pretrain-v4-pro-win_rate.pt` | Spatial-only `winrate` | Per-player team win probability from a **single tick** of the game state. `{task, model_state, head_state, config}` — embedder + spatial transformer + linear head. | | `pretrain-v4-pro-alive_end.pt` | Spatial-only `alive_end` | Per-player probability of being alive at round end. Same format. | | `pretrain-v4-pro-future_kill.pt` | Spatial-only `future_kill` | Per-player probability of getting a kill after the current tick. Same format. | ## Quick start ```bash git clone https://github.com/Gary2005/cs-net.git cd cs-net conda create -n cs2demo python=3.10 && conda activate cs2demo pip install -r requirements.txt pip install huggingface_hub # download all 4 checkpoints python scripts/download_checkpoints.py --repo-id gary2oos/cs-net-v4 # verify they load correctly (architecture match, finite weights, forward pass) python scripts/test_checkpoints.py --models-dir checkpoints ``` ### Inference ```python # Path prediction from scripts.prediction_engine import PredictionEngine engine = PredictionEngine("config/pretrain-a100-pro.yaml", "checkpoints/cs-net-v4-pro.pt", device="cpu", maps_dir="maps/optimized_obj_files") result = engine.predict_at_tick(sample, query_tick=120) # sample = round-level dict # Spatial-only (winrate / alive_end / future_kill) from scripts.spatial_only_predictor import SpatialOnlyPredictor predictor = SpatialOnlyPredictor("checkpoints", device="cpu") out = predictor.predict_round_full(sample) # per-tick per-player probabilities ``` ### 3D visualizer ```bash python visualizer/server.py --port 5000 \ --checkpoint checkpoints/cs-net-v4-pro.pt \ --spatial-model-dir checkpoints \ --device cpu # open http://127.0.0.1:5000/ ``` ## License MIT (see source repo).