Procedural Game Engine powered by IntentShield and LogicShield (BSL 1.1)
Project description
# Sovereign Engine
The Zero-Trust Procedural Game Engine. Built securely on the IntentShield and LogicShield architectures.
Sovereign Engine allows game developers to seamlessly integrate LLMs (Large Language Models) into their games to generate procedural dialogue, dynamic quests, and complex NPC interactions while absolutely guaranteeing that the AI's output mathematically adheres to your game's rules.
Installation
pip install sovereign-engine
Features
- Deterministic Validation: The
LogicShieldbackend forces the LLM to output perfect JSON that maps exactly to your defined game state parameters. - Action Gatekeeper: A deeply integrated, ultra-fast
IntentShieldsystem intercepts the AI's intended actions, instantly rejecting anything that isn't functionally possible in your game. - Engine Agnostic: Can be imported seamlessly into Unity (via Python backends), Unreal Engine, Godot, or standalone Python architectures.
Quick Start
from sovereign_engine.engine import ProceduralDialogueEngine
# The engine routes through OpenRouter automatically
engine = ProceduralDialogueEngine(api_key="sk-or-your-developer-key")
# Pass the player's current environment directly to the engine
scene = engine.generate_node(
player_state={"level": 5, "inventory": ["Iron Sword", "Shield"]},
recent_history=["You enter a dark cavern and hear a low growl."],
player_action="I walk forward with my shield raised."
)
print(scene)
Customizing Rules (LogicShield) & Actions (IntentShield)
You can easily expand the engine to enforce your own custom mechanics mathematically, or allow new verbs for the AI to take (like CRAFT or STEAL).
from sovereign_engine.engine import ProceduralDialogueEngine
from sovereign_engine.logicshield.rules import Rule
# 1. Define custom JSON math validations
my_rules = [
# Force the LLM to include a gold reward that is less than max_loot
Rule.less_than("gold_dropped", "max_loot"),
# Guarantee the AI never spawns a boss inside a tutorial zone
Rule.custom(
"no_bosses_in_tutorial",
lambda payload, state: not (payload.get("spawn_type") == "BOSS" and state.get("zone") == "Tutorial"),
"You cannot spawn a BOSS in the Tutorial zone!"
)
]
# 2. Inject them into the engine alongside allowed actions
engine = ProceduralDialogueEngine(
api_key="your-key",
custom_actions=["STEAL", "CRAFT", "PERSUADE", "INTIMIDATE"], # Adds to base actions
custom_rules=my_rules # Appends to base validation rules
)
License
This project is licensed under the Business Source License 1.1 (BSL 1.1). For production or commercial use, you must obtain a separate commercial license from SovereignShield.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sovereign_engine-1.0.3.tar.gz.
File metadata
- Download URL: sovereign_engine-1.0.3.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7776d522603cc7571d15e6b403ddf644b4c16d6332b10b5a2cecabd5c9f48b0
|
|
| MD5 |
a44da1db341ad21b69e841669d87a274
|
|
| BLAKE2b-256 |
f1b0b4208d4447aa2a6d1fe278f8794d4a7752c47a8a137d34007d85772472ac
|
File details
Details for the file sovereign_engine-1.0.3-py3-none-any.whl.
File metadata
- Download URL: sovereign_engine-1.0.3-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
503696753a6456dd706f28e5d1668efc60a5e049f13ba5f340d7989593010b3f
|
|
| MD5 |
5675856013cac971011e2d52df9a8fe2
|
|
| BLAKE2b-256 |
2c878bb4954273fc27cdb34606efa9978fd6b075c58af5be5edf8c3ab1917552
|