Why the server decides everything
What keeps Idlune fair: no save to reload, the same result whether you watch or not, and how it all works on the server.
This one comes in two parts. The first is about what makes Idlune fair, and what that means for you as a player. The second is more technical: how it’s actually done. So, let’s begin.
Where the game runs
A game’s code runs in one of two places. Offline games mostly run on your own device. Online games mostly run on a server, and your device just shows you what’s happening. Plenty of games mix the two.
What matters is that anything running on your device can be changed, one way or another. Some of you will remember Cheat Engine. Speeding a game up was the easy part: a trip that should have taken minutes was over before you knew it. I remember using it myself to find my gold in a game’s memory, change it to some ridiculous number and go shopping.
When the game runs on a server, that gets a lot harder. Not impossible, but a lot harder. That’s why everything in Idlune happens on the server. The client, whether it’s a browser tab or the mobile app, only shows you the result.
What this means while you play
The result is always saved before you see it. So:
- Closing the game while a chest opens and coming back won’t change what was in it. The loot was in your bag before the lid started to move.
- Closing the game the moment your character dies won’t bring them back. You won’t get an extra second to drink a potion either.
- Playing on two devices doesn’t give you a backup. There’s only one copy of your character, and it’s on the server.
I know why these rules matter to me, because I’ve ruined games for myself this way. I’m not a fan of exploiting glitches, but I’d still catch myself thinking: just this once, nothing will happen. Then I did it again, and again, and the fun I had at the start slowly drained away. So with Idlune I set out to make tricks like these as hard as possible to find, and pointless to use.
Eight hours are eight hours
The same goes for time. Eight hours with the game open and eight hours away from it give exactly the same result. When you come back, the server works out what happened while you were gone with the same rules it uses while you watch. It isn’t an estimate or a “welcome back” bonus, it’s the same calculation.
So there’s no reason to leave a tab open all night, and nothing to gain from closing and reopening the game at the right moment.
How it works
The rest of this post is for anyone who’s curious how this works, especially if you’re thinking about making a game of your own, or already are. I won’t give away every mechanism, but here’s the general idea.
The server doesn’t tick
There’s no loop on the server pushing every character forward every second. Your character’s progress is worked out when it’s needed: when you open the game, the server catches you up to now, saves the result in one go, and only then sends it to you. Playing live and catching up after a night away go through the same code, so the two can’t drift apart.
The client never works out a result on its own. It can fill a bar or count up to a number the server sent, but it never guesses a drop.
Every roll has an address
There’s no ordinary random number generator in the game rules. Each world gets one random seed when it’s first published, and it never changes. Every character’s luck comes from that seed, split into separate streams for actions, fights, exploring and so on, so they never get mixed up.
Each roll also has an address: the third kill in this fight, the second line of the loot table, the roll for whether it drops at all. The same seed and the same address always give the same result. So even if you could turn back time, that kill would land on the same address and roll the same drop. There’s nothing to reroll.
Eight hours in one go, or in a thousand pieces
This is what keeps the eight-hour promise honest. Working out eight hours in one go gives exactly the same result as working them out a second and a half at a time while you watch, down to the last byte. A test checks it by cutting the same stretch of time at random points and comparing.
It took some discipline: everything that carries over from one moment to the next is stored with the activity itself, the maths uses exact numbers with no rounding errors, and the rolls in an action are counted from when the action started, not from when the server last looked. Otherwise you’d end up with players arguing over whether it’s better to refresh often or rarely.
Doing it twice does nothing
Every activity remembers the moment it was last worked out, and that moment only moves forward. Asking again for a time that’s already passed changes nothing, and the time always comes from the server’s clock, never from your device.
Items work the same way. A weapon that drops doesn’t get a random ID; its ID is built from where it came from: this character, this fight, this kill. If the same drop is processed twice, after a timeout or a double-click, it lands on the same item instead of making a copy.
Rolled when you start, not when you collect
I haven’t written about masterworks yet. For now, the short version is that they’re projects you accept, then finish to get an item. A masterwork is the closest thing Idlune has to a chest. Its result is rolled once, when you accept the project, and saved. Finishing it, pausing it or restarting the server won’t roll it again, and if your bag is full when it’s done, it simply waits for you.
Actions and fights are also tied to the version of the world they started in. If the world’s author publishes an update in the middle of your action, your result doesn’t change.
Two devices, one character
Both of your devices read and write the same record on the server. If they both try to save at the same moment, one wins, and the other refreshes and sees what already happened. Everything in one update is saved together or not at all, so you can’t end up with the loot but without the death that came with it. And a character can only have one live session: open the game on a second device and the first one is disconnected.
Next devlog topic
The next post will be about masterworks, and it should be up soon. They’re unique items that players can create, and one of the mechanics that make Idlune different.
— Vanth