Electricity and logic for your game: generators, batteries, wires, breakers, sensors and logic gates that behave like a real grid and say why anything is off. No code needed.A power grid and logic system for survival bases, horror puzzles, factory builders and colony sims.Place devices, wire them port to port in the Scene view, press Play. Lamps dim when the batteries run low, the backup generator starts at night, the breaker trips when the player switches on one machine too many, and the door that will not open tells you why."Why is this off?" in plain English Every device explains itself, in the inspector, above it in the Scene view, and one call away for your HUD: "Fuse 'Main Breaker' has tripped; 964 W of generation and 3.75 kWh stored are on the other side." A tripped breaker says what the loads behind it ask for and whether it can be reset. No more guessing which wire is missing.A grid that solves itself Sources, consumers and batteries joined by wires form networks. Every tick each network shares out what it has: by priority when there is not enough, partially for devices that can run on less (a lamp that dims and flickers), with batteries charging from surplus and backup generators starting only when everything else falls short. Switches, relays, breakers with a trip delay, a breaker mode that trips when too much is switched on, wires that overload and burn, restart delays, fuel that runs out, idle and active demand.Signals and logic Integer signals on their own wires and 17 kinds of logic: gates, timers (pulse, on-delay, off-delay), clock, SR latch, toggle, memory, counter, comparator, math, selector, power probe, deterministic random. Feedback loops are allowed and well defined. Write your own logic in a few lines of C# and it appears in the menu.No code needed The Circuit Studio holds every device definition with its numbers in W, Wh, seconds and percent. Drag a device into the scene, or turn your own model into one (Make Device From Selection, then click the model to place the ports). Draw wires with the Wire tool, and read the state of every device before you press Play: the edit-mode preview simulates the scene as it starts. Reactions turn lights, emission, sounds, particles, animators and Unity events on and off; sensors turn buttons, levers, trigger volumes and the time of day into signals. A validator lists wiring mistakes in the scene and on your build machine.Player wiring, or no wires at all A drop-in wiring tool for first-person and top-down games: cable lengths, costs, refunds, removal rules and a readable reason for every refusal. Or let devices that touch connect themselves, factory style, with the same links in the editor preview and in Play Mode.Ready for real games Saves in one call: the whole grid, the devices the player built and the wires they placed, matched by stable ids. A deterministic integer simulation with a state hash, for lockstep multiplayer and replays. 10,000 devices in well under a millisecond per tick, and no allocations while it runs. A pure C# core that runs on a server or in your own ECS.IncludedCircuit Studio window: device catalogue with 33 presets, the full definition editor, the scene's networks and issuesScene view Wiring tool (bends, selection, undo), Move Ports, state labels and cable previews in edit mode, a Play Mode overlay with pause, single step, time scale and the selected device's explanationCustom inspectors for the world, devices, reactions, sensors, definitions and wire types, with Play Mode test controls (enable, availability, switch, fuse, press button)Runtime components: world, devices, wire renderer (sagging cables coloured by state, glow, flow animation), player wire tool, port picker, grid connector, day cycle, solar panel, wind turbine, fuel generator, buttons, levers, trigger sensors, time sensors, signal sources, 12 reaction types on 13 triggersFour demo scenes: Survival Base (first person, solar, wind, batteries, a breaker, player wiring), Restore Power (a horror fuse-box puzzle), Logic Lab (gates, timers, a combination lock, a latch alarm, a traffic light and connector tiles) and Stress Test (thousands of devices with the timings on screen)Starter content: one menu item writes 33 device definitions and 4 wire typesDocumentation: README, a QuickStart with screenshots, Concepts, 25 recipes with compiled scripts, a full API reference, a changelog and an upgrade guideRequirementsUnity 6000.5 (Unity 6.5) or newerURP or the built-in pipeline (the demo materials convert with one menu item). HDRP is untested.No dependencies. The demo scenes use uGUI (included in Unity's project templates); the Input System package is used when it is installed.What it does not do No directed (one-way) flow and no transformers between networks yet (planned for 1.1), no voltage or current (power is one integer, shown as watts: a game model, not a circuit simulator), one value per signal wire, no networking (the grid is deterministic and serializable; sending it is your netcode's job), no node graph: circuits live in the scene, where the devices are.About the images: the scenes and windows are Unity Editor screenshots of the included demo content. The backgrounds, lighting effects, callouts, captions and the icon were drawn in HTML and CSS.FeaturesPower networks with priorities, partial power, batteries, backup generators, fuel, switches, relays, fuses, breakers, wire capacity and burningSignal networks and 17 logic functions, custom logic in C#Plain-English explanations for every deviceNo-code Circuit Studio, Scene view wiring tool, edit-mode preview, validator (also from the command line)Reactions (lights, emission, audio, particles, animator, Unity events) and sensors (buttons, levers, triggers, time of day)Player wiring tool with costs and refunds; automatic adjacency linksOne-call saves; deterministic integer simulation with a state hash10,000 devices in well under a millisecond per tick, zero allocations per tickPure C# core without UnityEngine; full C# source with XML documentation on every public memberFour demo scenes, starter content generatorSupported OSEditor: any OS supported by Unity 6.5 (developed and tested on Linux)Runtime: all Unity platforms, WebGL and mobile included. Pure C#, no native code, no threads.Link to documentationIncluded in the package: Assets/Fkgen/PowerGrid/Documentation (README, QuickStart, Concepts, Recipes, API, CHANGELOG, Upgrade). Tools > PowerGrid > Documentation opens it.AI tools were used to assist with writing parts of the source code, automated tests, documentation, and store descriptions.All AI-assisted content was reviewed, integrated, and tested by the developer. No generative AI was used for images, 3D models, textures, or audio.The package contains no AI features and does not call or require any AI/ML services at runtime.







