Live data from Hacker News

1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)

gamedeveloper.com

171–180 of 189 posts

Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)

#171

Earlier quoted context omitted.

In age II, it was CRC checks of game state that prevented cheating! Games would get out of sync if there was a mismatch, which could happen for various reasons. I worked at MacSoft during the Age2 and Age3 days. The ports were faithful to the windows versions, but cross platform hadn’t been solved at the time because of this problem. It also made long game play sessions longer because the calculated state kept gettin…

In the Definitive Edition, there has been observed cheating in online ranked mode where players give themselves infinite resources. Evidently there's a way to do that without going OoS. This was probably the same in the original. This is besides the less complex cheat, removing fog of war. Seems the only thing stopping most people from cheating is, they don't want to. Also, I used to play the Mac version a lot. It wa…

> Shame they made the remakes Windows-only.

They run brilliantly through Steam on Linux, fwiw.

Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)

#172

Earlier quoted context omitted.

Dropping in a server like another client might be what they did in HD/DE remakes to allow the game to continue without a player host present. It doesn't help with cheating, cause other players are already interested in enforcing the rules. And doesn't help with lag ofc. Yes, the remakes should've had new netcode. They had full freedom to redo it, no legacy compatibility to deal with. Maybe they wanted to totally emul…

The specific way running the simulation on the server helps with cheating is if client A and client B both claim they've won. As you describe, during the game the clients are enforcing the rules, so a player can't eg teleport their units.

Yeah, you're right, so maybe HD edition had no such authority cause I mentioned that bug where both players can win. Or they didn't check that.

Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)

#173

Lots and lots of great things in here, thank you for sharing. > At first take it might seem that getting two pieces of identical code to run the same should be fairly easy and straightforward I found that a little funny. I would certainly not assume that. Synchronization problems are one of the scariest areas of programming in my opinion.

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…

(Want to add, I'm not complaining about the engineering. This simple approach totally made sense for a late-90s RTS without dedicated servers, continuous patches, or high system requirements. And it held up impressively well considering all that.)

Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)

#174

Earlier quoted context omitted.

Nah, micro can definitely be exciting for even more casual players. They'll be worse at it, obviously, just like casual FPS players are worse at headshots, but it's not like they can't do those things at all. The data we have suggests that people with your opinion -- "people want RTSes just about the strategy, not about control" -- are dead wrong. The most enduringly popular RTSes are mechanically demanding games: St…

> The data we have suggests that people with your opinion -- "people want RTSes just about the strategy, not about control" -- are dead wrong. The most enduringly popular RTSes are mechanically demanding games: StarCraft 2, Age of Empires 2, StarCraft 1. I think this data suggests the opposite. These titles are all more than a decade old. They have endured, but the genre has died. People often find it really compelli…

> I think this data suggests the opposite. These titles are all more than a decade old. They have endured, but the genre has died.

What you're missing is that there have been many titles that have reduced the mechanical demands in pursuit of "greater accessibility", and have been even less popular. That's been most RTSes over the last 15 years, really. They're always talking about how they wanna get rid of the clickiness or base building or what have you. "We're not gonna be APM heavy like Starcraft!" they crow, as they quickly fall into obscurity while Starcraft remains.

It's not wrong to want the genre to be more accessible or fun, or less frustrating, but getting rid of technical and tactical options by reducing control of your units is generally a bad way to go about that.

> People often find it really compelling to get into these games and do the singleplayer stuff. The multiplayer experience didn't live up to that. Limited strategic choices and a demanding micro are not what most people liked when they first entered the genre.

Nah, what points the way forward is SC2's co-op mode. That was extremely popular among more casual players -- being more popular than ranked ladder at least for a time -- despite getting only limited support as a new feature in LotV.

And the way SC2 co-op worked is that it had the same mechanical inputs of course, but it actually had less strategy, not more; similar to campaign AI's, the AI in co-op mode is largely scripted and predictable, no scouting and very little reacting required. People loved it!

Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)

#175

Earlier quoted context omitted.

> The data we have suggests that people with your opinion -- "people want RTSes just about the strategy, not about control" -- are dead wrong. The most enduringly popular RTSes are mechanically demanding games: StarCraft 2, Age of Empires 2, StarCraft 1. I think this data suggests the opposite. These titles are all more than a decade old. They have endured, but the genre has died. People often find it really compelli…

> I think this data suggests the opposite. These titles are all more than a decade old. They have endured, but the genre has died. What you're missing is that there have been many titles that have reduced the mechanical demands in pursuit of "greater accessibility", and have been even less popular. That's been most RTSes over the last 15 years, really. They're always talking about how they wanna get rid of the clicki…

> What you're missing is that there have been many titles that have reduced the mechanical demands in pursuit of "greater accessibility", and have been even less popular. That's been most RTSes over the last 15 years, really. They're always talking about how they wanna get rid of the clickiness or base building or what have you.

I'm not convinced this is accurate. I'm of the opinion that by the time AoE 3 came out the fire was gone from the genre because people did not like playing the multiplayer.

Excessive micro sucks, but that's not really the main thesis of my argument. It's more so that the traditional "Random Map Battle" mode is really devoid of strategy for the majority of players because you have so few real choices to make. You don't get to do much strategy. You probably have a build order for several minutes. And then want to rush. That's almost always the optimal move until you're very, very talented. I can't think of any competitive multiplayer focused RTS games that tried to address that successfully.

> Nah, what points the way forward is SC2's co-op mode. That was extremely popular among more casual players -- being more popular than ranked ladder at least for a time -- despite getting only limited support as a new feature in LotV.

> And the way SC2 co-op worked is that it had the same mechanical inputs of course, but it actually had less strategy, not more; similar to campaign AI's, the AI in co-op mode is largely scripted and predictable, no scouting and very little reacting required. People loved it!

I'm amused because I feel that was MY point. Single player (and naturally also co-op) content against scripted scenarios was the best part of RTS games. It's where the genre was born. You get to ask yourself "What am I going to do" and come up with a plan. My point is that you DON'T get to do that with Random Map Battle RTS games in competitive multiplayer. Instead you largely just get punished for not doing the meta plan; or worse, get punished because your execution of the meta plan is worse.

Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)

#176

Earlier quoted context omitted.

> I think this data suggests the opposite. These titles are all more than a decade old. They have endured, but the genre has died. What you're missing is that there have been many titles that have reduced the mechanical demands in pursuit of "greater accessibility", and have been even less popular. That's been most RTSes over the last 15 years, really. They're always talking about how they wanna get rid of the clicki…

> What you're missing is that there have been many titles that have reduced the mechanical demands in pursuit of "greater accessibility", and have been even less popular. That's been most RTSes over the last 15 years, really. They're always talking about how they wanna get rid of the clickiness or base building or what have you. I'm not convinced this is accurate. I'm of the opinion that by the time AoE 3 came out th…

> I'm not convinced this is accurate.

Well, it is. They've been a lot less successful. "The fire was gone from the genre" isn't how things work. SC2 co-op is a good example of this -- if something is good and polished, people will play it, have fun, spread it around, etc.

In contrast, you could look at the CoH series, which is one of the many games that went for being less APM heavy (albeit there's still a fair amount of micro involved). CoH2 is decently popular, sure, but much less so than AoE2 or SC2. The CoH/DoW branch is one subgenre of RTS that's less demanding, but you could look at the C&C and TA-like branches the same way. And yeah, they're moderately popular, but less so than the more demanding games. Why?

> It's more so that the traditional "Random Map Battle" mode is really devoid of strategy for the majority of players because you have so few real choices to make. You don't get to do much strategy. You probably have a build order for several minutes. And then want to rush. That's almost always the optimal move until you're very, very talented. I can't think of any competitive multiplayer focused RTS games that tried to address that successfully.

This is just an argument from ignorance. The truth is that even APM-heavy games like AoE2 or Starcraft have plenty of strategy. Well, maybe not the really cheesy games where someone immediately goes all-in, but the ones that go beyond a few minutes, yes.

Like, these words

> You probably have a build order for several minutes. And then want to rush.

don't even make any sense. In the case of Starcraft, if the game is several minutes in, attacking is no longer a "rush". It's just...an attack. Which you'd expect people to do in an RTS. And even early attacks aren't necessarily rushes.

The words you've put in here is like stumbling into a discussion about Counterstrike and claiming that the game is nothing but people using the AWP forever and ever, or that you can win every game of PUBG or Fortnite by doing nothing but hiding. You're simply wrong, and advertising that you don't really know what you're talking about.

> I'm amused because I feel that was MY point. Single player (and naturally also co-op) content against scripted scenarios was the best part of RTS games. It's where the genre was born.

If that's what you like most, that's fine, but it's true that these involve less strategy, rather than more. You don't have to outsmart someone, you don't have to scout them out and react, all the while they're scouting you out and reacting to you. The computer's on rails and there's usually a dozen different ways to exploit how dumb the AI is. That can be good fun, just like any other single player game, but it's not very strategic at all, because your opponent isn't actually strategizing against you.

> My point is that you DON'T get to do that with Random Map Battle RTS games in competitive multiplayer. Instead you largely just get punished for not doing the meta plan; or worse, get punished because your execution of the meta plan is worse.

People get 'punished' if they have poor strategies or poor execution of strategies, which is as it should be, yes. There's nothing special about being "on meta", what's meta is usually just what people have found to be effective -- at lower levels, the professional meta tends to be markedly less dominant, with all kinds of other strategies being effective that wouldn't be at higher levels. I'm considerably higher ranked than average, but I still lose to plenty of stuff that would never work at a pro level.

Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)

#177
post #150

Earlier 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...

Another reason for me to stay clear of the M1 for now. It’s really fascinating, but it’s not quite there yet. I’ll let others work the rough edges away before I give it a try.

Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)

#178
post #171

Earlier quoted context omitted.

In the Definitive Edition, there has been observed cheating in online ranked mode where players give themselves infinite resources. Evidently there's a way to do that without going OoS. This was probably the same in the original. This is besides the less complex cheat, removing fog of war. Seems the only thing stopping most people from cheating is, they don't want to. Also, I used to play the Mac version a lot. It wa…

> Shame they made the remakes Windows-only. They run brilliantly through Steam on Linux, fwiw.

Sorta. You have to mess with the DLLs and Proton settings to make multiplayer work, and even then it's laggy. It also works in Wine on Mac in some cases, but for me it always had problems.

Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)

#179
post #67

Earlier quoted context omitted.

Ok, so option 1) is to make internet multiplayer run on a game server, not peer to peer, but that's not exactly running the game on their own computers. Another option would be for the peers to only send data that the other should know (fog of war), but that's a lot trickier. Because you then need to figure out how to validate the unseen data wasn't cheating, too. You might be able to do something with this today, be…

And here we are using tech to try and solve social problems again :)

There's no social solution to getting players to not try to cheat in competitive games.

Re: 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)

#180

Earlier quoted context omitted.

No, it's the same model - the clients run the game in sync and the server does too. Only inputs are transferred. It wouldn't surprise me if the AoE remakes do this to work out who won the game.

Don't you have to handle the situation where one client falls behind? That means asking for the latest state and figuring out what happens to the stale inputs it sent. It's a nontrivial difference. Definitive and HD Edition both seem to use nearly the same netcode as the original game. And the whole thing lags if one player lags. Yes it handles situations where all players leave, so there's a server doing something,…

I was writing a real-time multiplayer game a couple years ago.

The netcode was written so that players only send their inputs along with a timestamp (The "timestamp" actually being a frame counter). The server would then relay those inputs with the timestamp to other players. The client maintains snapshots of the game state and would then re-run the game logic from that timestamp given the new input.

I handled clients falling behind by making the server reject any inputs that were more than 500ms (Really, 30 frames) behind the current time. The server would send a message to the client that essentially said "You're lagging, here's the current frame counter and current state of the game"

Granted, this approach really only worked for my game because the entire game state could be squished to ~300 bytes. But it had the added benefit that it prevented players from cheating using a lag switch. They couldn't have a malicious client that sat and listened to what other players were doing and then send a bunch of back-dated inputs to put itself in an advantageous position.

Post reply on HN