How do video games stay in sync?
medium.com
medium.com
1) Bandwidth. The users internet can only handle so much network throughput, so for fast paced games (where you're sending data to each client at a rate of 20+ frames per second) it becomes important to optimize your per-frame packet size. This means using techniques like binary encoding and delta compression (only send diffs).
2) Server infrastructure. For client-server games, latency is going to be a function of server placement. If you only have a single server that is deployed in us-east and a bunch of users want to play with each other in Australia, their experience is going to suffer massively. Ideally you want a global network of servers and try to route users to their closest server.
3) TCP vs UDP. Packet loss is a very real problem, and you don't want clients to be stuck waiting for old packets to be resent to them when they already have the latest data. UDP makes a major difference in gameplay when dealing with lossy networks.
If your updates are bigger; you probably will end up with seqs, acks and retransmitting of some sort, but you may be able to do better than sending a duplicate of the missed packet.
If the client misses too many frames the server can send it a snapshot (that way the server can hold a bounded number of old updates in memory).
It's common for people to build this kind of retransmission logic on top of UDP (especially for networked games), it's sometimes referred to as "reliable UDP".
Every 30 frames or so, you send a key frame packet that is uncompressed so that all clients have a consistent perspective of world state if they fell behind.
Using sentTime lets clients ignore old data and interpolate to catch up if behind as well.
It does work, I wrote one from scratch to create a multiplayer space rpg and the bandwidth savings were incredible.
This is done for state that should be reliably transmitted and consistent. For stuff that doesn't matter as much if they get lost (explosion effects, or what not), then they're usually included in that packet but not retransmitted or accounted for once it goes out.
This is different (and a lot more efficient) than sending the last N updates in each packet.
Can you elaborate or give an example of how this works?
1: x = 1
2: x = 2
3: x = 3, y = 5
4: x = 4
5: x = 5
6: x = 6
7: x = 7, y = 1
Diff from 2 to 4 would be "x = 4, y = 5".Diff from 3 to 6 is "x = 6", which will always be correct to apply as long as client is already on ticks 3~6. But if you apply at tick 2, you lose that "y = 5" part. This can't happen in a bug-free code because the server will only send diffs from the latest ticks it knows for sure the client has (because the client sends acks)
entity[123].active = true
entity[123].x = 4
entity[123].y = 8
Then later... entity[123].active = false
And with special rules such that if `active = false`, no other properties of the entity needs to be encoded. And if `active = true` is decoded, it sets all properties to their default value. Then you get a fairly simple way to transmit an entity system. Of course you'd want to encode these properties in a much smarter way for efficiency. But the basic idea is thereAnyone aware of any conceptual way to “encrypt” the location data so it’s only usable if the player has line of sight? I doubt that’s easy/possible but don’t even know where to begin searching for research around topics like that.
https://technology.riotgames.com/news/demolishing-wallhacks-...
https://technology.riotgames.com/news/peeking-valorants-netc...
It works really well and cut my network traffic down by a whole couple orders of magnitude.
The trick is to figure out update grouping so you can create clean groups of things to send and diff on. Ultimately delta compression doesn’t even care what the data is, so modern net stacks do some really efficient compression in this way.
Right. That's how video streams work, too. Every once in a while there's a complete frame, but most frames are diffs.
Games like Blizzard's Warcraft III / StarCraft II and Age Of Empire linked here in this thread (1500 archers on a 28.8 k baud modem) and oh so many other games approach that entirely differently: the amount of user inputs users can input is tinier than tiny. So instead of sending diff of the game state they send user inputs and the time at which they happened. Because their engine are entirely deterministic, they can recreate the exact same game state for everybody from only the timed user inputs.
Fully deterministic games engine also allow for lots of easy to reproduce bugs and they also allow for tiny save files.
Negligible network traffic. Tiny save files. Bugs are easy to reproduce. When the game allows it, it's the only reasonable thing to do.
It also makes the client easier to cheat on and gives one player (the host) a preferential ping.
Most competitive FPS’s use server authoritative instead of replayable deterministic because of this.
If you want to see the limitations, head into the old war3 map editor forums and look up the hacks using automated clicks between placeholder variable units just to move a few bytes of data between clients so they can persist character stats between games.
The most obvious version of this in StarCraft is maphacks that let you see through fog of war, although that’s far from the only thing.
Poker meets all the technical requirements here, but sending everyone the contents of all hands would be a disaster.
I work in the gambling space. A few notes, gambling games don’t ever rely on physics (even roulette, or a coin dozer type of game, everything is decided by a certified rng, no regulatory body that I am aware of allows outcomes based on physics engines). This means there is far less data to keep state on (a hand of cards is very tiny json blob to send). Games like poker etc. don’t require “real time”, if a player takes 4 seconds to decide if they want to call/raise/fold etc. then an extra 200ms of latency isn’t even going to be noticeable. So we don’t really care if there is a bit of latency, these aren’t FPS games.
Games that pretend to be physics-based but in reality have a backed probability engine.
But, since you have the whole game state, you can sift through the data and pinpoint these resources and acquire them quickly and with almost no effort. In multiplayer this is generally considered cheating and is called an "xray" modification to the game client. There are other variations of this hack that involve changing the game's textures to transparent images except for the specific resources you want to find.
Mulitplayer server administrators don't like cheats so they created countermeasures for this. The best example is probably Orebfuscator which "hides" said valuable resources until the player is very close to them.
Or is the "revealing radius" somewhat randomized over time in a way that's invisible to the client?
Ultimately, if you have a big enough server to attract serious cheaters, you will (or at least should) have tools that can also detect suspicious behavior based on heuristics (i.e. see if a player mined straight to an ore block). Tools like CoreProtect[1] can help detect and revert this.
Ore obfuscation still works very well, however, for the majority of causal cheaters that just googled "hacked minecraft client" and installed the first result.
One ore obfuscation technique used in PaperMC actually sends intentionally fake data to the user to "muddy the waters"[2].
(I know a lot of this because I help develop a Minecraft server management tool)
[0]:https://www.youtube.com/watch?v=GaRurhiK-Lk
My friends and I actually quit playing AOE2DE because about 1/3-1/2 of team games had someone lagging from the start, which makes the game slow and choppy for every other player (and this was despite the game having a benchmark you had to complete at a certain framerate to play matchmaking online). Spending the next hour in an unplayably laggy mess of a game just isn't fun.
I know Supreme Commander (supcom) also has problems with 1 player lagging causing everyone else to lag.
There's also the matter of it being much harder to actually program a deterministic game, especially once you try and multithread it (which is really necessary for modern RTS, but a nightmare for determinism). Fixing all desyncs is very difficult (AOE2 and WC3 both still have desync bugs. In AOE2DE some people use them to cheat their way up the ranked ladder, desyncing whenever they're losing so it counts as a draw instead of a loss). I've heard the upcoming Sanctuary RTS (indie supcom spiritual successor in development) talked to a bunch of RTS industry vets, and were told that it's not worth it to do a deterministic simulation these days unless you want over ~10k units. AI War 2 [1] has a pretty interesting network model for multiplayer, where they've got a semi-deterministic simulation, and self heal client's simulations if they diverge from the host, which allows for it to be heavily multithreaded and have 10k-100k+ units. You'd probably have to use dedicated servers for a competitive ranked mode if you went that way (and they'd be heavier to host, for a smaller per-game player count than eg. an fps or a survival game).
[1] https://wiki.arcengames.com/index.php?title=Category:AI_War_...
2) Server placement is still an issue. It's still ~200ms round trip from New York to Sydney for example. Fortunately, cloud infrastructures can make getting servers to closer your players much easier now. You don't have to physically install servers into data centers in the region.
3) Packet loss still occurs, but is incredibly rare that the gap between using TCP and UDP is narrowing. Modern TCP implementations like Microsoft's are amazing at handling loss and retransmission. However, I'd probably use QUIC for game networking if I was to write an engine from scratch these days.
If you find yourself implementing reliability and retransmission over UDP, you're doing it wrong. However, as I mention occasionally, turn off delayed ACKs in TCP to avoid stalls on short message traffic.
Reliable, no head of line blocking, in order delivery - pick any two. Can't have all three.
1) We updated around 60Hz, and bandwidth was never an issue (everything was binary encoded and many values were hand compressed to the number of bits they needed, but we didn't run any additional compression or ever feel the need to optimize further, and these were games with 100 players in an instance).
2) Probably the biggest key to success was global server placement. That mattered most, and we ended up renting servers in 10-20 regions around the globe to keep latency down for players. I didn't work on this part, but I know it was quite a bit of work, and also very experimental. Physical proximity of servers didn't always translate to lower latencies. Country borders could by surprisingly laggy, in certain cases.
3) This is the one that really shocked me. As I said, players were engaging with the game in almost the worst conditions imaginable, weak chromebooks over wifi and all communication was over websockets (which basically behave like TCP). Still, packet loss was not an issue. We prioritized low-latency over smoothness, so our sever just blasted out the latest state to the client ~60 times a second, and the client would display mostly like a dumb terminal. This is approximately how you're supposed to do it with UDP, but dropped packets and resends are supposed to make it unworkable over TCP. But we just YOLO'd it with TCP and it worked great! I'm sure at some point in the past before internet infrastructure got so good, it would have been a disaster, but seems like, for most players, we've advanced past that.
Now, I know partially this just weeded out the people with bad connections, but I really don't think it was that many. Certainly my own experiments taking my laptop and checking out various wifi spots around town with wireshark indicated that modern infrastructure is just that good.
(Actually, in terms of improving latency, beyond making sure people were playing on local severs, the next biggest thing was just optimizing javascipt. Both the client and server were written in it, and GC stalls were a huge problem. The eventually solution was to rewrite the server to not generate that much garbage in the first place and then just disable the GC. Reboot the server process after ~10 minutes between games. Another big js issue was code getting de/reoptimized continually. The biggest issue was inconsistent numerical literals between float and integer. Once we figured out it was an issue, we became very disciplined about that.)
Afterwards, when I tried to validate this as a product (libfabric.com) I realised that I'm trying to solve a problem that nobody has, except for a very small niche. The main problem that developers of large-scale networked games have is acquiring players. They use whatever existing service+SDK (like Proton) for networking and don't think about it. Once they have good traction, then they can afford scalable infrastructure that others have already built, of which there are many.
It'd be nice to some global service to host your game servers controlled by a single slider linking ping to price. With the slider at its cheapest end, there's only one server and it's in the cheapest datacenter. At the most expensive end, there are servers all over the world linking players as locally as possible.
1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond
https://www.gamedeveloper.com/programming/1500-archers-on-a-...
https://www.gamedevs.org/uploads/tribes-networking-model.pdf
What immediately happens in practice with interpolation, is that every second player has a bad network connection and so you get unevenly spaced movement packets from him, and he just warps from here to there (via teleport, or smooth movement, neither of which look good or are possible in single player mode), among other problems. Interpolation also adds latency which is already a constrained area. Your game should already be designed to handle a constant rate of in and outbound packets and is broken if it sends them on demand instead of packing them into this stream of evenly paced constant rate packets. If you can't send packets for a few frames you should be punished until you switch ISPs, as opposed to you getting advantage because you teleport somewhere on the other clients's screens. The idea of "right away" is a misconception here. Since you get packets at a constant rate (which should be high enough to be displayed directly on screen), interpolation is not necessary. 60 tick is literally nothing, for a game with less than 100 players and little to no moving objects. Of course, most gamedevs are not concerned with this stuff as the framerate drops to 10 in most games if 1-6 players are on screen depending on how shit their game is. Also, client side damage is a mistake.
League of Legends is using a custom game engine built from the ground up, it's always been a really buggy mess though.
I can't speak for riot/league but I've worked in unreal for close to a decade and the engine provides complete control over what requires a round trip. I won't speculate on the Fortnite weapon switch lag (although I did work for epic on Fortnite at the time), but these kinds of bugs happen in the same way any other bug happens - accidental complexity. You call a function that you know requires a round trip, but then 6 months later someone else calls your function but doesn't realise that theres a round trip in there.
> Since you get packets at a constant rate (which should be high enough to be displayed directly on screen), interpolation is not necessary.
This is just nonsense. There is no such thing as a perfect connection, particularly when you're communicating across the internet. Even in your perfect world situation it doesn't work - if both you and I are 16 ms away from the server and it's running at 60hz (which is a stretch too - many games are running at much lower update rates because of the expense of running these services), in the worst case you have over 60ms of latency to handle, which is 4 frames.
> Of course, most gamedevs are not concerned with this stuff as the framerate drops to 10 in most games if 1-6 players are on screen depending on how shit their game is
This is the sort of comment I expect on Reddit and not here. Most developers, myself included would do anything in their power to avoid that happening, and I can't think of a single game that drops to even close that bad that was released in the last decade.
> Also, client side damage is a mistake.
Client side hit detection is a trade off. On one end it allows for abuse, but most client interpolation systems (including the one that comes out of the box with unreal engine) will mostly negate that. On the other, it allows for local-feeling play in a huge number of situations.
That doesn't really solve the problem though. In my last apartment a ping to my router on WiFi was 15ms, and it had some nonsense hardware that caused spikes of 100ms+ every now and again [0]. Someone else in your household watching Netflix can cause buffer bloat, and in a multiplayer game you have both players connections (or 10 or 100 players depending on the game). Even at 10ms latency to the server, you have a worst case network latency of 50ms if the server runs at 30hz (plus network buffering plus client frame rates plus buffering plus render buffering...)
You also need the population to support having servers everywhere, and choose to put servers in places, _and_ you very quickly hit diminishing returns. Sure you could locate in 3 cities in the UK to absolutely minimize latency, but the advantage of doing so is complete elimi6 if one player is on WiFi, so the servers for all of Europe might as well be in Amsterdam or Dublin.
Completely agree otherwise!
[0] https://www.ispreview.co.uk/index.php/2018/08/intel-coughs-t...
The really simple way is to just pass a delta milliseconds to each system so it can simulate the right amount of time.
But yeah, it was wild how DS2 at 60fps fundamentally altered a lot of things like weapon durability and jump distance.
Anyway. I only have unfinished attempts at low-latency netcode and rollback, so can't say I'm speaking from solid experience. But I would doubt that engines implement rollback netcode for you. Essentially the game needs to be structured in a way to accomodate storage of game state as snapshots. And it needs to decide how to incorporate messages that arrive late.
The comment was that (surprisingly) all games are single threaded and feel very turn based. Even real-time games.
I also don't know what you mean by "games are single threaded and feel very turn based". Games are usually not single threaded (insofar as most games run on multiple OS threads). If you want to say they feel single threaded, then it might be because the screen emits one frame after another, and you can influence the next frame by your action? But I don't know how that is an interesting insight and it doesn't seem to have anything to do with how games stay in sync.
You might have something interesting to say, but I wasn't able to learn anything from your post. Add to that the slightly accusing tone of it ("again conflating") I can't help but be annoyed.
But anyway, this is like the most basic insight and doesn't touch what I said at all. It does not explain how games stay in sync, unless you go back to shitty 90's lockstep netcode.
As I said in my first comment.
Except because of latency, it's like taking turns when you may be ahead of other players in turns or behind other players and the game does rollbacks to make the turns make sense once they've all arrived and how many turns ahead/behind you are is also dynamic.
It ends up having a very real affect on the actual game mechanics. In CS:GO a player peaking out from an obstacle has the advantage over the player waiting for them to pop out.
while (!exitRequested) {
player.updateState();
someCharacter.updateState();
someOtherCharacter.updateState();
}
you could in theory make this kind of updates in parallel but then the entire game becomes a non-deterministic chaos and trying to deal with synchronising threads in a context like this is such a nightmare and I'm sure intractable performance-wise. did anyone even try this, ever?bottom line, real-time or turn-based, a piece of code needs to execute before or after another, not at the same time.
the order in which things take their "turn" each frame becomes very important the more complex the game btw, so even the order in which things execute serially cannot be entirely arbitrary. usually for things that depend on other things to update their state in order to accurately update their own state. which is a lot of things in every game. for example, you wanna update the text on the GUI that says how much gold the player has. you'll update the text after everything that could have influenced the gold this frame has updated (i.e. at the end of the frame). player input state (keyboard input e.g.) is updated at the beginning of the frame before you make the player's character do anything based on input.
particular stuff can be parallelized or turned into coroutines that "update a little bit each loop" so as to not kill performance. like pathfinding, a character needs to go from point A to point B, he doesn't really need to find the whole path now. a partial path while a separate thread calculates the entire path can do. or just make him think a bit while the pathfinding thread finds a path, the advantage is characters thinking about their actions is also realistic :P
I think it depends on the granularity.
Coarse-grained parallelism is already common: some things like AI (like your example), Physics, Resource Management, Shader Compilation, Audio and even Netcode are already commonly run in separate threads.
However you won't see the updateInputs(), all the updateState() and sometimes even render() running in parallel for two reasons: first because it's often cheaper and easier/simpler to run in the main thread than dispatching async jobs anyway. Second because each operation often depends on the previous ones, and you can't wait until the next frame to take it into account: you often want instant feedback.
However these things can in theory be run in parallel without becoming chaos. ECS is often very parallelizable: you can run multiple Systems in different threads, as long as the output of one System is not a dependency of another running at the same time. You could also process multiple components of a system in multiple threads, but that would negate ECS main advantage: being cache-friendly by virtue of running in a single thread.
https://www.gdcvault.com/play/1022186/Parallelizing-the-Naug...
>for example, you wanna update the text on the GUI that says how much gold the player has. you'll update the text after everything that could have influenced the gold this frame has updated (i.e. at the end of the frame).
Modern game engines are pipelined; you render the previous frame logic. In the talk aforementioned, they show a three stages deep pipeline looking like this
[FRAME] [FRAME+1] [FRAME+2]
----------------------------------------------
[LOGIC] [LOGIC+1] [LOGIC+2]
[RENDER LOGIC] [RENDER LOGIC+1]
[GPU RENDERING]
each stage is independent and doesn't require syncing. they call that "frame centric design". for {
a[i] = something;
b[i] = something;
c[i] = a[i] + b[i]; // can only do a and b at the same time because c depends on them
}
// handle a[0],b[0]
for {
a[i] = something;
b[i] = something;
c[i-1] = a[i-1] + b[i-1]; // can do all 3 at the same time because no deps.
}
// handle c[last]
optimization I saw in a talk about how CPUs can do many instructions at once if they don't depend on each other.I was unaware of how something like this could play into game engines at the loop level, thanks for the link I'll watch it asap.
You press a button. It takes 1 frame for the signal from your USB device to get polled through the OS into your engine. Then it takes 1 frame for the input to affect the logic. Then it takes 1 frame for that change in logic to get "prepared" for rendering. Then it takes 1 frame for the GPU to draw the result. And depending on your video buffering settings and monitor response time, you're still adding a frame until you see the result.
If you're running 60 frames per second, that's an abysmal 83 milliseconds lag on every player input. And that's before network latency.
But these days it's hard enough to convince people that 'a cinematic 30fps' really really sucks compared to 60 (or better), and there's an even smaller number of gamers/devs who seem to notice or care about latency issues.
A system would try to apply damage to a ship that was already destroyed.
It taught me that you often have to flag things and then do a cleanup phase at the end. So destroyed = true but don’t outright delete the entity until the end of the “turn.”
yes, originally it was developed as turn-based and I often wonder if that's one reason why the animations are sooo satisfying. But could be that they simply had great animators.
but more to the point im trying to get self respecting developers OFF of medium
An example of a netcode that does "prediciton" and "rollback" is GGPO, which is used in fighting games: https://en.wikipedia.org/wiki/GGPO
I believe a version of this is what runs in fightcade2 (see https://www.fightcade.com/), which is the best fighting experience I've ever seen. I can play against people all the way around the world, and it still works. Very impressive, and highly recommend to anyone in Gen X or Y who grew up on street fighter.
How is it possible for this medium service to be so spectacularly bad? We are talking about text here...
Edit: Did more test. The page updates and loads the content up to 5s after initial loading. There is no feedback. What a miserable experience.
If not, maybe this: https://fabiensanglard.net/quakeSource/johnc-log.aug.htm.
Or maybe in this archive: https://fabiensanglard.net/fd_proxy/doom3/pdfs/johnc-plan_19....
Of particular note is the fact that they run their physics loop at 120hz to minimize error.
I suspect most games where movement is primarily physics-based are doing this, but who knows, netcode tends to be very game-specific.
Interpolation error is bounded by the data points on both sides. Extrapolation error is not bounded, which is why bad extrapolation can produce wildly bogus values. So you need filtering, and limits, and much fussing around.
What actually happens in an FPS game is all clients just operate in the past. They aren't in sync at all, and don't even try to be. Rather, when the client sends something like a shot to the server, the server "rewinds time" to where everyone was ping/2 ms ago for that client & evaluates the state at that point to see if the shot would hit or not.
https://www.forrestthewoods.com/blog/synchronous_rts_engines...
SupCom was a pretty classic synchronous + deterministic system. It’s a pretty major PITA and the next RTS I worked on was more vanilla client-server.
I see a good potential for better formalization in this area. At its heart, this is literally distributed streaming system engineering with extremely wide, fluctuating variety of requirements in the name of game play first. You don't need to be 100% accurate on physics simulation but the result shouldn't diverge too much on every clients within a very limited bandwidth. You want to depict character movement as accurate as possible across every player, but their detailed status should be shared to their allies, not their opponents. Synchronization of continuous and discrete states are fundamentally different. How can we build a single, general networking model to unify those kinds of requirements without resorting to some ad hoc solution?
Look at actual game engine docs like this one from Valve https://developer.valvesoftware.com/wiki/Latency_Compensatin... or this one from Halo https://www.halowaypoint.com/news/closer-look-halo-infinite-...
But tldr is the only thing a client ever predicts is their own inputs, which of course can't really ever end up wrong later on. There's no other prediction happening (eg, the position of other players is not predicted)
And then for anti-cheat/optimization purposes the server also only sends positions for enemies that could be visible soon, which is done by taping into the same map chunking logic that would be used for asset streaming.
There's a ton of other great resources on this topic here https://github.com/ThusWroteNomad/GameNetworkingResources
But you'll find they all largely do the same basic thing. There's nuance in some of the rules and what state is replicated and what isn't (such as server side or client side ragdolls), but the general architecture tends to be the same. And without a fundamental shift in connectivity, seems pretty unlikely to change.
And I am not very sure if you had a good look through the resources that you posted... Many of them are pretty explicit on their use of own ad-hoc solutions and the trade off that had to be made, which really supports my arguments. (Yeah, I think I already have read and watched more than half of them over the last decade) And this is not surprising if you have a good theoretical ground on distributed systems which have literally hundreds of impossibility theorems and real time games usually have quite tight latency constraints.
I haven't seen it in a few years (re-watching it now), but IIRC they talk about how they do forecasting of things like shielding, grenade throws but need to reconciliate state after.
on a desktop machine open this link in multiple windows and size the windows so they are all at least partially visible at the same time
http://greggman.github.io/doodles/syncThreeJS/syncThreeJS.ht...
they should all be in sync because they are basing the position of the spheres on the system clock.
A networked game can implement a synced clock across systems and move some things based on that synced clock.
Burnout 3 did this for npc cars. Once a car is hit then its position needs to be synced but before it is hit it's just following a clock based path
I think if you engineered games explicitly for this use case, you could create a much more economical path than what products like Stadia offer today.
I just assumed it was a video stream with a touch control overlay.
It's the ultimate DRM for games, you can't crack a game's copy protection if you can't see it's binaries. You can't data-mine the locations of valuables if you don't have the map data. You can't leak unreleased assets ahead of their marketing debut if you don't have a copy of the assets. You can't expose all the Easter eggs by decompiling if you don't have the code. With subscription and premium currency models those abilities can all be interpreted as lost revenue.
The markets for people buying $400 consoles vs buying a $20 HDMI stick and a $15/mo subscription are very different. After the colossal (and to me, surprising) rise of mobile gaming I think the latter might be where the real money will be 10 years from now.
They'll address the bottlenecks on the data center end. I'm pretty sure you can list a dozen problems that make it prohibitively expensive right now and for every one of them some Microsoft or NVIDIA engineer can tell you how they are working on engineering away that problem in a couple years.
This is of course depending on your meaning of „elegant“, but for me this would imply to solve these issues without increasing the server load so much. Let the client decide as much as possible, but check the decisions randomly and in case of suspicious player stats. And DRM for multiplayer games should be no problem anyways? Verify the accounts or your users, but that applies to stadia like services and also the „conventional“ ones. Solving the data mining issue is another topic and yes, giving the server more authority for things that the player should be able to see might be the only way to deal with this. But maybe the server could hand out client specific decryption keys when they are needed? That would be elegant, and not just keeping all the content server-side.
Game streaming services will find their place, but they address mainly the entry hurdle and not the issue of game state synchronization.
Mind you, they're still not going to be great rates, because the data center needs to be geographically close and so utilization will vary a lot in daily and weekly patterns.
Then again, maybe you can fill all those GPUs with ML training work when the gaming utilization is low...
Doesn't seem elegant to me, it seems like a way to have wildly uncontrollable latency, and have one player's poor connection disrupt everyone else's experience.
I have a Steam Link hardware device to stream games from my PC to my TV over ethernet LAN, and even that can have issues with latency and encoding that make it a worse experience than just playing on the PC.
However, I’m not sure this gonna work with modern triple-A games. The current-gen low level GPU APIs were designed to allow developers of game engines to saturate bandwidth of PCI-express with these rendering calls. That’s too many gigabytes/second for networking, I’m afraid.
The solution you proposed introduces latency between your own input, and your own display. Unless the server is in your house or at least within 100km from it, that latency gonna make the game unplayable.
There are essentially two ways of dealing with latency : input lag (wait until we know everything before showing player actions) and prediction/rollback (respond immediately trying to guess what we don't know yet and fix it later, what is shown in the article). Games often do a mix of both, like a bit of input lag for stability and prediction to deal with latency spikes. With video streaming, you limit your prediction options.
View independent shading response and light simulations can be shared between clients. Even much of view dependent response could be approximated in shared representations like spherical gaussians. The scene can also be aggressively prefiltered; prefiltering would also be shared across all clients.
This would be a massive change in rendering architecture, there's no practical way to retrofit it onto any existing games, and it would still be incredibly expensive for servers compared to 'just let the client do it', and it can't address game logic latency without giving the client more awareness of game logic, but... seems potentially neat!
Definitely open to being wrong on this opinion.
For those of you interested in cognition, our brains have almost precisely the same problem of temporal delay and prediction.
Each of many sensory-motor systems has about 50 to 150 milliseconds of jitter and offset. And the jitter and offset in timing depends on many factors—-intensity of the stimulus and your state of mind for example.
How does the brain help “consciousness” create an apparently smooth pseudo-reality for us from a noisy temporal smear of sensory (sensory-motor) input spread out over 100 milliseconds or more?
It is damn hard, but the CNS plays the same games (and more) as in this great Medium article—interpolation, smoothers, and dynamic forward prediction.
Just consider input to your human visual system: color-encoding cone photoreceptors are relatively fast to respond—under 30 msec. In contrast, the rod photoreceptors are much slower integrators of photons—up to 100 msec latencies. So even at one spot of the retina we have a serious temporal smear between two visual subsystems (two mosaics). It gets much worse—the far periphery of your retina is over a centimeter from the optic nerve head. Activity from this periphery connects slowly over unmyelinated fibers. That add even more temporal smear relative to the center or your eye.
And then we have the very long conduction delays of action potentials going from retina, to first base—the dorsal thalamus—, and then finally to second base—the primary visual cortex at the very back of your head. That is a long distance and the nerve fibers have conduction velocities ranging 100-fold: from 0.3 meters/sec to 30 meters/sec.
The resulting input to layer four of your visual cortex should be a complete temporal mess ;-) But it isn’t.
What mechanisms “reimpose” some semblance of temporal coherence to your perception of what is going on “out there”?
Neuroscientist do not spend much time thinking about this problem because they cannot record from millions of neurons at different levels of the brain.
But here is a good guess: the obvious locus to interpolate and smooth out noise is the feedback loop from visual cortex to dorsal thalamus. I mentioned the dorsal thalamus (formally the dorsal lateral geniculate nucleus) as “first bade” to visual system input. Actually it get 3X more descending input from the visual cortex itself—a massive feedback loop that puzzles neuroscientists.
This huge descending recurrent projection is the perfect Bayesian arbiter of what makes temporal sense. In other worlds the “perceiver”, the visual cortex, provides a descending feedback to its own input that tweak synaptic latencies in dorsal thalamus to smooth out the visual world for your operational game playing efficacy. This feedback obviously cannot remove all of the latency differences, but it can clean up jitter and make the latencies highly predictable and dynamically tunable, via top-down control.
Quite a few illusions expose this circuitry.
for more @robwilliamsiii or labwilliams@gmail.com
1. The Pulfrich illusion (link to Wikipedia) is the very first clear illusion of this type.
2. Many false movement illusions expose the inevitable failure of temporal error control.
My favorite is Akiyoshi Kitaoka “subway” illusion @AkiyoshiKitaoka on May 9, 2021
3. Have a look at my pinned tweet @robwilliamsiii
https://news.ycombinator.com/item?id=30359560
DonHopkins 3 months ago | parent | context | favorite | on: Don't use text pixelation to redact sensitive info...
When I implemented the pixelation censorship effect in The Sims 1, I actually injected some random noise every frame, so it made the pixels shimmer, even when time was paused. That helped make it less obvious that it wasn't actually censoring penises, boobs, vaginas, and assholes, because the Sims were actually more like smooth Barbie dolls or GI-Joes with no actual naughty bits to censor, and the players knowing that would have embarrassed the poor Sims.
The pixelized naughty bits censorship effect was more intended to cover up the humiliating fact that The Sims were not anatomically correct, for the benefit of The Sims own feelings and modesty, by implying that they were "fully functional" and had something to hide, not to prevent actual players from being shocked and offended and having heart attacks by being exposed to racy obscene visuals, because their actual junk that was censored was quite G-rated. (Or rather caste-rated.)
But when we later developed The Sims Online based on the original The Sims 1 code, its use of pseudo random numbers initially caused the parallel simulations that were running in lockstep on the client and headless server to diverge (causing terribly subtle hard-to-track-down bugs), because the headless server wasn't rendering the randomized pixelization effect but the client was, so we had to fix the client to use a separate user interface pseudo random number generator that didn't have any effect on the simulation's deterministic pseudo random number generator.
[4/6] The Sims 1 Beta clip ♦ "Dana takes a shower, Michael seeks relief" ♦ March 1999:
https://www.youtube.com/watch?v=ma5SYacJ7pQ
(You can see the shimmering while Michael holds still while taking a dump. This is an early pre-release so he doesn't actually take his pants off, so he's really just sitting down on the toilet and pooping his pants. Thank God that's censored! I think we may have actually shipped with that "bug", since there was no separate texture or mesh for the pants to swap out, and they could only be fully nude or fully clothed, so that bug was too hard to fix, closed as "works as designed", and they just had to crap in their pants.)
Will Wright on Sex at The Sims & Expansion Packs:
https://www.youtube.com/watch?v=DVtduPX5e-8
The other nasty bug involving pixelization that we did manage to fix before shipping, but that I unfortunately didn't save any video of, involved the maid NPC, who was originally programmed by a really brilliant summer intern, but had a few quirks:
A Sim would need to go potty, and walk into the bathroom, pixelate their body, and sit down on the toilet, then proceed to have a nice leisurely bowel movement in their trousers. In the process, the toilet would suddenly become dirty and clogged, which attracted the maid into the bathroom (this was before "privacy" was implemented).
She would then stroll over to toilet, whip out a plunger from "hammerspace" [1], and thrust it into the toilet between the pooping Sim's legs, and proceed to move it up and down vigorously by its wooden handle. The "Unnecessary Censorship" [2] strongly implied that the maid was performing a manual act of digital sex work. That little bug required quite a lot of SimAntics [3] programming to fix!
[1] Hammerspace: https://tvtropes.org/pmwiki/pmwiki.php/Main/Hammerspace
[2] Unnecessary Censorship: https://www.youtube.com/watch?v=6axflEqZbWU
[3] SimAntics: https://news.ycombinator.com/item?id=22987435 and https://simstek.fandom.com/wiki/SimAntics
> To keep that in perspective, light can barely make it across the continental united states in that time
that is not true
2800miles / c = 15ms