Power cuts as a game mechanic in Gbege
How Gbege turns NEPA taking the light into a rule of the game. Three power states, a generator that runs on litres, and a clock the server and the game agree on.
Gbege is a life sim of everyday Nigeria. It is in development, and there is no public build yet. This post is about one small system in it: the power going off.
Anyone who has lived in Nigeria knows the moment. The fan slows down. The fridge goes quiet. Someone in the compound shouts “NEPA!” Then you hear the first generator on the street start up.
We wanted that moment in the game. Not as a cut-scene, but as a rule the game runs on.
The first morning
Your first morning starts at 6:30 am. The power is on. At 6:34 am, NEPA takes the light.
It happens every time, on the first morning, at the same minute. We tested that exact line: the clock reads 6:34 am and the power is off. A fixed first cut means every new player meets the mechanic in their first minute, and it means our tests can say exactly what should happen.
It is also the joke. You have barely woken up.
Three states
Power in a home is one of three states:
- On: NEPA is supplying light.
- Off: no light.
- Gen: the generator is running.
That is the whole model. There is no voltage and no load. We tried to keep only what changes a player’s choices.
The generator has two rules. It won’t start if the power is on, because there is nothing to fix. It won’t start if it is already running. Each refusal has its own reason, so the game can say why instead of just failing.
Litres, not timers
The generator runs on fuel. One litre runs it for two game hours. When the litre is used up, the generator stops and the power goes back to off.
Why litres and not a plain timer? Because fuel is the real decision. In real life you don’t ask “how long do I want light?” You ask “how much fuel can I afford, and what do I need light for?” Litres put that question in the player’s hands.
The game clock runs at twelve times real speed. One game day is two real hours. So one litre lasts about ten real minutes. That is long enough to cook, charge a phone or watch a match, and short enough that you feel it running down.
Where things happen
The generator is something you deal with in your room, not on the street. The street has the NEPA pole, which is the world telling you why the light went. Home has the things you can do about it, like the generator and a power bank on charge.
That split comes from how we describe the world. Facts about each thing live in a data card: what it is, where it can be, and what you can do with it. The code that runs the morning doesn’t name individual items. If we add a new way to get light, it is a new card, not a new special case.
One clock, two machines
Gbege has a game server that is the authority. The rules live in one shared engine, and both the server and the game run it.
For power cuts, that means both machines must agree on exactly when the light goes and exactly when the generator stops. If the server says the generator stopped at 8:34 and your phone thinks 8:35, you would see the light flicker back and forth.
So the shared engine follows strict rules:
- No floating-point maths. Time is counted in whole game seconds. A litre is exactly 7,200 game seconds.
- No reading the system clock. The engine is told how much time passed. It never asks.
- Randomness is seeded. When something is random, it comes from a seed both sides know.
With those rules, the server and the game get the same answer to the bit. When your game joins the shared city clock, a running generator keeps the game seconds it had left.
What isn’t built yet
Being honest about this matters to us, so here is what doesn’t exist yet.
Power doesn’t come back yet. In the current build, once NEPA takes the light, it stays off unless you run the generator. The code has a note that says so: “power on” stands in for “not cut yet”, and that has to change once power can return. We left it simple on purpose, and wrote down where it will need to grow.
There is also no fuel market, no generator repair and no noise for the neighbours to complain about. Those may come. We won’t describe them as features until they are built.
Why bother
A power cut is a small thing. It is also one of the most shared experiences in Nigerian life. Getting it right, down to the minute and the litre, tells players that the game knows where it is set.
It also gives the game a rhythm. Light shapes what you can do. You plan around it, you complain about it, and then you laugh, because the gen just started next door and it is louder than yours.
The game is meant to be honest about the struggle and still be fun. Power cuts are the first place we try to do both.
There is more on the Gbege page, including a small preview of the street when the light goes.