World of Origocraft
README.md
OgSim
The Origocraft simulation kernel — engine-agnostic gameplay logic that
operates on a plain state table. No entity, ui, camera, or
rendering calls live here, so the same systems can drive any view.
state = OgSim.newState() then OgSim.createCharacter(state, class, name)
gives a live game. The controller calls into these each tick:
- Character & stats —
createCharacter,recomputeStats,relearnAbilities,hotbar. - Combat & casting —
tryCast,canCast,tickCasting,resolveAbility,tickAutoAttack,damageMob(rolls critical strikes on player damage viaopts.canCrit+player.critChance),damagePlayer. - Mobs & boss —
tickMob,mobAttack,tickBoss,killMob, targeting (cycleTarget,setTarget,targetMob). - Quests —
acceptQuest,questEvent,turnInQuest,npcQuestState. - Inventory & economy —
addItem,equip,sellItem,buyItem(vendor purchase),useConsumable(drink potions on a shared cooldown),bankDeposit/bankWithdraw. - Progression —
grantXp,onLevelUp,xpToNext. - Persistence —
serialize/deserialize,saveSnapshot/loadSnapshot.
local Sim = require("@root::og.OgSim")
local state = Sim.newState()
Sim.createCharacter(state, "warrior", "Recruit")
Requires OgData. Side-effecting world updates
(moving entities, audio, UI) are the controller's job — OgSim only
mutates state and appends to its floaters / cues / combatLog
queues for the controller to drain.