It might not be complete, but I think itís stable
I ran a multiplayer test overnight, and told people they could invite their friends, too, so the server would be full all night. The internet being the internet meant it took about 20 minutes before the password had leaked to a couple of large communities. I figured I might as well just go for a proper stress test, and announced the password on my twitter as well.
Itís now some 7-8 hours later, and the server is still running. Itís getting 3-5 connection attempts per second, the log is so huge that itís causing actual slowdowns just to update it in the gui, and apparently gameplay is kind of laggy, but itís still running, and the memory profile is SMOOTH.
Memory usage on an infinite map, with all players being far away from each other, is about 35 MB/player. That means you could in theory host a server for 28 players with 1 GB ram. In reality, the server uses some overhead ram that varies with how many entities there are, how fast players are moving (the map generator), and how many monsters there are and what theyíre doing (more when theyíre pathfinding), so itís probably more like 20-24 players maximum per 1GB of ram, for an infinite server.
The memory usage is worst-case with everyone heading in their own direction, though. If they stay close to each other, itís significantly less. Almost all of the RAM usage is terrain data.
If you chose to limit the playing area, the memory usage gets capped at 320 bytes per m^2 of surface area. That means that if you limit the playing area to 1600*1600 blocks, the server will never use more than 800 MB of terrain data, regardless of player count.
The biggest bugs so far:
- Sometimes an entire chunk fails to get added to the client, making a huge hole in the world. Trying to jump down it leads to the server resetting your position, but since thatís still over the hole, you start falling again, ever faster. Itís pretty disturbing. I THINK I know what causes this.
- When players get too far away from each other, they stop being able to see each other. I know what causes this.
- Thereís a lot of repeating terrain (the same chunk over and over) out in the distance where there should be no terrain. I think this is related to the first bug.
And there are some major things left to implement before itís a game:
- Inventory (itís client-side at the moment)
- Health and respawn (same)
- ItemEntities (signs, chests)
- Detecting flying players. (It already detects players why try to pass through the terrain)
I plan on finishing up the first four points before releasing a test server.