# librungame **Repository Path**: your-own-os/librungame ## Basic Information - **Project Name**: librungame - **Description**: Some miscellaneous processing for running games. - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-04-19 - **Last Updated**: 2026-04-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # librungame Some miscellaneous processing for running games. ## Features - **Multiple Platform Support**: Run Windows games via Wine, DOS games via DOSBox, ScummVM games, and native Linux games - **Game-Specific Implementations**: Built-in support for various games with configuration management - **Save File Management**: Edit and manage game save files and profiles - **Joystick Support**: Configurable joystick/keyboard mapping for games - **Configuration System**: Comprehensive game configuration including resolution, graphics settings, and language - **Extensible Architecture**: Easy to add support for new games and runners ## Supported Games ### Windows Games (via Wine) - Need For Speed series (2, 3, 5, 8, 9, 10) - Grand Theft Auto series (GTA III, Vice City, San Andreas) - Call of Duty (1, 2) - Command & Conquer: Red Alert - StarCraft - Total Annihilation - DCS World - Apache Air Assault - Beach Head 2002 - Plants vs. Zombies - Limbo - Neighbours from Hell - Home Sheep Home 2 - Loco Mania - Starcraft ### DOS Games (via DOSBox) - SimCity 2000 - F22 Lightning 2 ### Linux Games - Factorio ## Dependencies - Python 3 - Wine (for Windows games) - DOSBox (for DOS games) - ScummVM (for ScummVM games) ## Quick Start ```python from librungame import RunGame from librungame.util import SysInfo from librungame.game.windows import NeedForSpeed9 from librungame.runner import Wine # Initialize system info sys_info = SysInfo() # Create game instance game_data_dir = "/path/to/game/data" game = NeedForSpeed9(game_data_dir) # Create runner instance runner = Wine(verbose=1) # Create RunGame instance run_game = RunGame(sys_info, "nfs9", game, runner) # Run the game with run_game.context(edit_or_run=False): run_game.run("main") ``` ## Architecture ### Core Components - **GameBase**: Abstract base class for all games - **RunnerBase**: Abstract base class for all game runners - **RunGame**: Main class that coordinates game and runner ### Game Traits Games can implement various traits: - `GameStraitForWindows`: Game runs on Windows - `GameStraitNeedConfigDir`: Game needs a configuration directory - `GameStraitHasCacheDir`: Game has a cache directory - `GameStraitNeedJoysticks`: Game supports joysticks ### Runners - **Wine**: Run Windows games via Wine - **DosBox**: Run DOS games via DOSBox - **ScummVM**: Run ScummVM games - **Direct**: Run native Linux games - **Proton**: Run Windows games via Steam Proton (planned) ## Game Data Directory Each game implementation expects a specific data directory structure with: - Game icons (optional) - Game patches and fixes - Configuration templates ## Configuration Games can be configured through the context API: ```python # Set resolution game.apply_resolution("1280x720") # Set fullscreen/windowed mode game.apply_fullscreen_or_windowed(True) # Set language game.set_language("en_US") # Configure level of detail lod = NeedForSpeed9.LevelOfDetail.min() game.apply_level_of_detail(lod) ``` ## Save File Editing Games that support save file editing: ```python # List available profiles profiles = game.list_profiles() # Open a profile for editing with game.open_profile("profile_name") as profile: money = profile.get_money() profile.set_money(999999) profile.save() ``` ## License MIT License