How kabooma/s1api works
Project Type and Purpose
• S1API is an open-source SDK / compatibility layer for Schedule One game modding.
• It abstracts Mono and Il2Cpp environments into a single managed API that modders consume.
Core Architectural Layers and Main Components
Row A (Integration Entry)
• [Col 1] S1APILoader
• [Col 2] Mod Developer (Consumer)
• [Col 3] Game Engine Assemblies (Mono / Il2Cpp)
Row B (Core & Abstraction)
• [Col 1] S1API Core (S1API.cs, S1API.csproj)
• [Col 2] Internal Abstraction Layer
– IGUIDReference, IRegisterable, ISaveable + Registerable/Saveable, EventHelper, GUIDReferenceConverter
• [Col 3] Build & CI Config
– .github/workflows, .releaserc.json, example.build.props, github.build.props
Row C (Domain Modules – grouped into three columns)
• [Col 1] Entities & Game Time
– Entities (IEntity, IHealth, NPC, Player, all NPC subfolders)
– GameTime (Day, GameDateTime, TimeManager)
• [Col 2] Content Managers
– Items (ItemDefinition, ItemInstance, ItemManager)
– Products (ProductDefinition, wrappers, ProductManager)
– Quests (Quest, QuestEntry, QuestManager, Constants)
– Property & Storage (PropertyManager, StorageInstance)
• [Col 3] Interactions & UI
– Dialogues, DeadDrops, Conditionals, PhoneCalls, PhoneApp, ConsoleHelper, Messaging, UIFactory, Logging
Row D (Persistence & Utilities)
• [Col 1] Saveables & Serialization
– SaveableField, Saveable abstractions
• [Col 2] Internal Utils & Patches
– Utils (RandomUtils, ReflectionUtils, ImageUtils, ArrayExtensions, ButtonListener, CrossType)
– Patches (HomeScreen, NPCPatches, QuestPatches, TimePatches, PhoneAppRegistry, PlayerPatches)
• [Col 3] Public / Documentation
– README.md, Public/README.md, CONTRIBUTING.md, CODING_STANDARDS.md
Relationships and Data Flows
• The S1APILoader (Row A, Col 1) loads the single-assembly S1API into the game process.
• Mod Developer (Row A, Col 2) references the S1API assembly compiled for Mono or Il2Cpp.
• S1API Core (Row B, Col 1) exposes APIs that call into Internal Abstraction (Row B, Col 2).
• Internal Abstraction uses Utils & Patches (Row D, Col 2) to bridge calls to Game Engine Assemblies (Row A, Col 3).
• Domain Modules (Row C) use Abstraction layer to register, save/load, and interact with game state.
• Persistence components (Row D, Col 1) handle serialization of game data for mods and restore via IRegisterable/ISaveable.
• Documentation and CI (Row B, Col 3 & Row D, Col 3) support developer onboarding and release automation.
Architectural Patterns & Principles
• Layered Architecture:
– Top: Loader & Consumers
– Middle: Core API → Abstraction → Patches/Utils
– Bottom: Domain Modules → Persistence
– External: Game Engine & Assemblies
• Plugin/Registration Model:
– IRegisterable and ISaveable central to dynamic module loading.
• Cross-Compatibility Abstraction:
– All calls into Mono or Il2Cpp are routed through the same internal patches and converters.