HNHacker News
TopNewBestAskShowJobs

gafferongames

709 karma · joined November 26, 2014

Making a 1000 player space game with AI
submissionscomments
gafferongames··on The best thing that's ever happened for multiplayer games?
Oh shit and I forgot NAT issues. Depending on NAT, some players simply cannot host a game (without a relay server), no matter what they do.
gafferongames··on The best thing that's ever happened for multiplayer games?
Well, I can give several reasons why player hosted servers (like on their own machines) can be a bad idea:

* If the server player quits, the game is over, or the game developer has to implement host migration, which generally sucks. Game developers would prefer to spend this money and time making the game more fun instead.

* If the server player cooks a burrito in the microwave and is playing over wifi, maybe everybody's connection gets really bad for 60 seconds.

* At least in the USA, internet connections are highly asymmetric. It's getting better now, but 10-20 years ago, the vast majority of players would only have enough bandwidth to send and receive one client's worth of bandwidth, and would not be able to upload bandwidth for all players, especially as player counts increased.

* Cheating. The player hosting the server on their machine (if a PC) could modify code and/or memory to cheat.

* Lag switching / network shaping. The player hosting the server could time out, lag out or ruin the experience for a player they don't like.

* Host advantage. The final one is that the player hosting the server has zero lag, so has a huge advantage over other players.

For a competitive game at least, it's much better in 2026 to host your servers somewhere secure, or to have player hosted servers in a secure provider that doesn't let players do any of the things above.

gafferongames··on The best thing that's ever happened for multiplayer games?
Deterministic cross-platform networking with jolt is fine and good, but there are multiple ways to network a game, and even to do networked physics in 2026.

I hope your game world is small, and your player count is low, otherwise: 1) your server will be waiting for inputs from the most lagged player, 2) you will become entirely CPU bound on the client performing all this rollback.

Approaches that don't suffer from these two problems send state, yes they send a lot more bandwidth, but they scale better as the number of players n increases.

gafferongames··on The best thing that's ever happened for multiplayer games?
Cheating in the sense of breaking fog of war, because the client has to actually have the whole game state in memory due to deterministic synchronization. Yes.
gafferongames··on The best thing that's ever happened for multiplayer games?
> Now if you're the author, can you tell me what the space game does?

A larger more detailed world with a higher player count, networked using quake style netcode techniques ala. Counterstrike, Titanfall, Apex Legends with snapshots and delta compression, client side prediction and lag compensation.

In short, FPS netcode scaled up to 1000 players, but applied to a space game, not an FPS, because the world doesn't need another FPS right now...

gafferongames··on The best thing that's ever happened for multiplayer games?
A typical quake style FPS netcode like Counterstrike, Apex Legends, Titanfall etc. would have all gameplay affecting objects (bullets, missiles props whatever...) as server side entities.

On the client these entities are usually interpolated, except the local player character, which has client-side prediction (eg. optimistic execution with rollback to apply server corrections to maintain server authority).

So it's not at all unusual to suggest that all gameplay affecting objects would be server-side. In this network model, that is the default approach.

The exception would be for entirely cosmetic FX or cosmetic debris objects that don't push back on the player.

gafferongames··on The best thing that's ever happened for multiplayer games?
Yes, but how many games truly support 1000 players at the same quality level and fidelity of a AAA FPS? I can't think of any, even Eve: Online has time dilation and starts to chug when the action gets too intense.

What if you could have a 1000 player FPS, and it was networked at the same fidelity of a AAA FPS? It would certainly use more bandwidth, but what if?

gafferongames··on The best thing that's ever happened for multiplayer games?
Nobody has answered my question, which is if you can use more bandwidth, and in doing so supports a larger, more detailed world, then why not?

Why limit yourself to bandwidth usage designed around the turn of the century?

It's 2026. We can do better :)

gafferongames··on The best thing that's ever happened for multiplayer games?
Have you considered the O(n x m) issue with player counts?

For example, if you have n=1000 players, and m=2000 objects, the total number of object state updates that need to be sent out is n x m.

So a 1000 player space game with 1000 players, and 2000 objects (say, 1000 other players and 1000 AI ships...), and you have O(1000 x 2000) = 2,000,000

Compare this with a more typical FPS, let's say, n=32 and m=1000 (let's be generous...).

The amount of bandwidth for that game would be O(32 x 1000) = O(32000).

Given this, it's pretty easy to see how a 1000 player space game would send more bandwidth than a regular 32 player FPS, even if it did use all the standard tricks from first person shooters, eg. snapshots, delta encoding and all that.

There's just more state to send, and in total, roughly O(n^2) bandwidth as player count n increases.

gafferongames··on The best thing that's ever happened for multiplayer games?
It's true plus you cannot just send a snapshot of 100 kilobytes or so from server to client with 1500 byte MTU with regular IPv4 packet fragmentation and reassembly due to packet loss amplification effects.
gafferongames··on The best thing that's ever happened for multiplayer games?
> You can fit a lot of game in 2mbit/s with a little bit of work.

And you can fit exactly 10X the game in 20mbps with the same amount of work, plus some AF_XDP magic.

gafferongames··on The best thing that's ever happened for multiplayer games?
> I can't imagine a game that'd need that much data

I can :)

gafferongames··on The best thing that's ever happened for multiplayer games?
Companies like https://nitrado.com host community servers cheaply and support mods. Sort of a nice half-way in between truly player hosted servers (where somebody could quit mid-game, or even cheat the game), and dedicated servers run only by the devs.
gafferongames··on The best thing that's ever happened for multiplayer games?
Hosting in AWS (or anywhere else) doesn't preclude you from doing the right thing and releasing your server binary or even source code after you shut your game down. For example, Knockout City by Velan Studios did exactly this.

https://knockoutcity.com/private-server-edition

gafferongames··on The best thing that's ever happened for multiplayer games?
Some games are networked deterministically, so that you can send only the inputs, and the game plays out exactly the same way (down to a checksum matching for all game state in memory across all players).

For example many RTSs are networked this way. They can have thousands or tens of thousands of units, but send only inputs. The classic article on this being 1500 archers on a 28k modem: https://zoo.cs.yale.edu/classes/cs538/readings/papers/terran...

The problem is that as player counts increase, the chance that any one player is late delivering inputs to the server (or to other players, if peer-to-peer) approaches 100%.

A deterministic simulation cannot stay deterministic, unless it has the correct inputs for all players, so the game has to pause and wait for inputs for all players before stepping the authoritative game state forward.

This is why high player count games like MMOs are not usually networked deterministically.

gafferongames··on The best thing that's ever happened for multiplayer games?
Maybe you can just be doing all the standard compression tricks, but still have a 10-20 times larger world? If so, why not?
gafferongames··on The best thing that's ever happened for multiplayer games?
If a normal game sends 2mbps, then 20mbps would be 10 times as many objects.
gafferongames··on The best thing that's ever happened for multiplayer games?
Higher player counts and more detailed worlds? It's 2026 and we regularly watch 4k video streams @ 25mbps. Seems like games should be able to get away with sending this amount of bandwidth too for a higher fidelity experience.
gafferongames··on The best thing that's ever happened for multiplayer games?
The speed of light is not just a good idea, it's the law!
gafferongames··on The best thing that has ever happened for multiplayer games
> this whole post just felt like a brag

And yet, everything I wrote in the article is true.

gafferongames··on The best thing that has ever happened for multiplayer games
Before this change hosting a game with an average CCU of 100,000, with each client sending 1 Mbps would cost $1,650,791 per month in AWS data transfer egress fees at list price.

Obviously, nobody actually spent that. At scale people would negotiate better deals.

The reason why this is a big deal is that now small games, or studios who launch their first game and don't have any real clout yet can get a really good deal from AWS by default.

I think this will result in most new games electing to host in AWS Gamelift by default, due to the difficulty of procuring enough bare metal at launch on favorable terms

For example, working out how much bare metal and in which locations to order? It's really difficult to work out when you are launching a game and you don't know how successful the game will be.

Now studios can just scale elastically up/down at launch, find out their base load and maybe bare metal can beat it, or maybe not, but AWS is competitive now with bare metal for games, and easier to spin up and adjust your fleet, vs. old-school purchase by the month and 30 days notice to shut down bare metal :)

gafferongames··on The best thing that has ever happened for multiplayer games
You can lead a horse to water but you cannot make it drink
gafferongames··on You can't unit test for taste
Nonsense. I unit taste all the time, it's called taste driven develoment (TDD) for a reason.
gafferongames··on Jobs and Software Is Fucked
Multiplayer game networking.
gafferongames··on Epoll vs. io_uring in Linux
You are correct and I misread the article while skimming it.
gafferongames··on Jobs and Software Is Fucked
> I mean it - you're going to be hurt badly if you don't reevaluate what is happening and plan accordingly.

Point taken. I'll just ask the AI to make me a really fun AAA multiplayer game next time I work on one.

gafferongames··on Jobs and Software Is Fucked
And how many games have you shipped?
gafferongames··on Jobs and Software Is Fucked
Thank you sir
gafferongames··on Jobs and Software Is Fucked
AI makes up shit that doesn't exist and lies to you. Sure, let's get the word salad generator to write all the code. What a great fucking idea.
gafferongames··on Jobs and Software Is Fucked
In the game industry this is actually a positive thing. If you think that AI can write code better than you can, I'm not going to disagree with you, but maybe you should try getting better or more specialized at what you do, because I can ask the AI simple questions about my field and it's completely wrong 3-4 prompts in.

Using this technology to build anything remotely serious, OR EVEN GAMES, is wildly stupid.

← PreviousPage 3 of 13Next →