Earlier quoted context omitted.
The 28.8 was more than enough for me to place the article in time.
If you're old enough to know what 28.8 means
1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)
151–160 of 189 posts
Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)
#152Seeing stuff like this on here fills me with nostalgia. I basically learned to code thanks to a few helpful and extremely patient IRC members in the Spring RTS engine[1] community (some of whom I spot in these comment sections on occasion - hi!), and deterministic lockstep simulation for online play was one of the first ideas that totally blew my mind when I learned about it ("b-but that means all the "random" number…
Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)
#153Seeing stuff like this on here fills me with nostalgia. I basically learned to code thanks to a few helpful and extremely patient IRC members in the Spring RTS engine[1] community (some of whom I spot in these comment sections on occasion - hi!), and deterministic lockstep simulation for online play was one of the first ideas that totally blew my mind when I learned about it ("b-but that means all the "random" number…
The random numbers I understand, because I’ve used a similar principle to make tests deterministic. The trick is to make the same number of calls to the generator and use the same seed. The floats are really thorny though, differing subtly across CPUs. Did they just rely strategically on rounding? Make heavier use of integers?
The id of the node acts as the deterministic seed. Really handy when building views that slice and dice data, it feels like you’re interacting with a database.
Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)
#154What I find interesting about the lockstep approach described here is it seems a lot of modern RTS games still use the same approach, even though the bandwidth calculations have changed radically. When developing my own RTS game I was able to fairly straightforwardly get 1000 units in combat to live stream using about 50 KiB/s bandwidth, which is nothing these days: https://www.construct.net/en/blogs/ashleys-blog-2/r…
Did those units shoot? What happens when there is a few thousand projectiles in the air, fired by those 1000 units? What about map deformations? What about map wide physic simulations, like springs tsunami water sim or the lava flows of a volcano, changing directions?
You can encode that very compactly. 2 bytes for each unit ID, source and destination. So 1000 units would be just around 4K, if they all start shooting at the same time.
After that, you can rely on that in most RTS games how units shoot is deterministic.
Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)
#155Earlier quoted context omitted.
Don't use floats (it wasn't a 3D game) or if you have to, make sure every float is derived from an integer that's kept in sync. And don't do anything that affects simulation state based on those floats.
Age of Empires 2: Definitive Edition consistently de-syncs when playing across a M1 Mac (using Windows 11 Arm or Crossover) and an x86 machine, and I suspect the difference in floating point behavior described here is the culprit: https://developer.apple.com/documentation/apple-silicon/addr...
LHC@Home had big issues[1] with AMD and Intel machines giving very different results to the same work unit. They traced it down to the exp() function behaving different, and ended up using a library[2] for anything more fancy than basic arithmetic.
[1] https://lhcathome.web.cern.ch/sites/default/files/OPENshort....
Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)
#156As someone who fixes up old games in my spare time, and Age of Empires II being one of them, I'll provide a bit of trivia about the game's internals: - The AI system is not part of the deterministic simulation. This was surprising to me, and after contacting one of the original programmers it was explained that it was due to a desynchronization bug that the "AI and network programmers weren't able to fix it in time".…
Sending state updates every 200ms made my spidey sense tingle. Most industrial control systems of the 90s would work on continuous 200ms polling through the network. Mostly RS485 links at 9600 baud. The thing is that this is perfectly reasonable if your network infrastructure is known. If you have fixed bandwidth and deterministic packet sizes, then you can do math and know what the behavior will be. Determinism is g…
Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)
#157Earlier quoted context omitted.
Shame that. Sutra is a word all on its own. Gamasutra was a nifty name. It works. One day sex positive triple-breasted feminist whores of Eroticon Six are all the rage the next you're sunsetting harmless Sanskrit puns. Y'all strange.
Misogyny isn't cool nor wanted here
Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)
#158As someone who fixes up old games in my spare time, and Age of Empires II being one of them, I'll provide a bit of trivia about the game's internals: - The AI system is not part of the deterministic simulation. This was surprising to me, and after contacting one of the original programmers it was explained that it was due to a desynchronization bug that the "AI and network programmers weren't able to fix it in time".…
Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)
#159Earlier quoted context omitted.
IRL it was not simple. The game usually worked, but occasionally things would go out of sync. The biggest downside is mentioned in the article: If one person lags, everyone lags. In an 8-player game, the chance that at least one person lags was pretty high. I used to play on the Mac version of GameRanger, a small community. That was 2008, when reliable internet wasn't as common. Players had personal reputations, and…
That's not intrinsic to this style of netcode, though. Company of Heroes, for instance, just keeps the game running and your input is delayed until you can communicate it to the server. You'd generally want an authoritative server to accomplish this. Having it also execute the inputs prevents most cheating, too.
That makes it very different from this model in my eyes. You wouldn't have every client running the game in sync. The AoE devs had this dilemma and chose the other path.
Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)
#160Earlier quoted context omitted.
It is, in fact, inherent to this model. While there will be some tolerance threshold as to how far behind in the simulation a machine may fall, it still must be rather conservative (generally a few seconds), as elsewise the context (state-) sensitive inputs start frequently failing -- if I issue a command given at world-state time t , will it be meaningful/valid at state t2 ? The answer is where you get your threshol…
If it's not valid, just throw it out! I've built and licensed a time traveling variant of this model (GGPO style) and spent years with thousands of concurrent users playing my games. And they operated just as I describe. Company of Heroes is more of a traditional AoE style and will happily queue up unit orders for a minute or more while it attempts to reconnect or catch up.
Yes it relies on the players trusting each other a little to avoid extreme lag, but there are plenty of ways to ruin this kind of game besides lagging. It's not like CoD where a few useless teammates won't make a big difference, while it didn't have automated ranked play like Csgo. (but the recent DE remake does, and yes it needs better netcode)
Time-traveling netcode... I know Slippi does this, and it works great.