Multiplayer ai: lag/freezeframe and crash

:arrow_forward: GAME INFORMATION

:point_down: These details are CRITICAL; DO NOT skip them or your issue may not be reviewed.

  • GAME BUILD #: 101.101.51737.0 7126076 and earlier versions
  • GAME PLATFORM: Steam
  • OPERATING SYSTEM: Windows 10

:arrow_forward: ISSUE EXPERIENCED

:point_down: DESCRIBE THE ISSUE IN DETAIL (below). LIMIT TO ONE BUG PER THREAD.

When playing with friends against AI about 10-25 minutes into the game. The game starts to freeze for several seconds then speed up to try to catch up to the current events but can’t and gets more and more out of sync with the game (sometimes over 1.5 min out of sync). During the freezes if I click repeatedly the game crashes.

:arrow_forward: FREQUENCY OF ISSUE

:point_down: How often does the issue occur? CHOSE ONE; DELETE THE REST!

about 50% of multiplayer games with AI, haven’t tested without AI

:arrow_forward: REPRODUCTION STEPS

:point_down: List CLEAR and DETAILED STEPS we can take to reproduce the issue ourselves… Be descriptive!

Here’s the steps to reproduce the issue:

  1. start/join multiplayer game
  2. Freezes seem to start on its own about 10-25 min in the game
  3. to crash the game, click repeatedly during one of these freezes

:arrow_forward: EXPECTED RESULT

:point_down: What was SUPPOSED to happen if the bug you encountered were not present?

A normal game

:arrow_forward: IMAGE

:point_down: ALWAYS attach a PICTURE (.jpg, .png, .gif) or VIDEO (.mp4, YouTube link) that highlights the problem.
google drive link below to clip of issue (I ping the map at the beginning and clip ends when ping shows up)

:arrow_forward: GAME FILES (SAVE / RECORDING)

:point_down: Attach a SAVE GAME (.aoe2spgame) or GAME RECORDING (.aoe2record) of the match where you encountered the issue. Link it below if using an external file service.
replays don’t show bug, included enhanced logging to one of the incedents google drive link below

*Clip showing bug
**enhanced logging link

1 Like

I’ve encountered this kind of thing playing with AI in multiplayer since DE was released.

I think it has to do with the networking code. Commands are issued by players, and rather than get executed instantly, they’re added to a queue that’s shared by all clients and done in tiny “turns” to ensure everyone stays in sync. (Turns can be shorter or longer than frames depending on the slowest player’s computer speed. That’s why one slow player can make everyone a little choppy; they all need to wait for him.)

But turns can only hold a limited # of commands before any new commands get postponed for the next turn. When humans are playing, that’s fine – you can’t get an APM high enough to break it. But when AI play, they sometimes issue thousands of commands a second, I’ve noticed. The local computer’s hardware has gotten to the point where that’s easy enough to run when not in multiplayer, but the netcode can’t transmit all of that. This would explain why it doesn’t happen with AI in single player, why it doesn’t happen with humans in multiplayer, and why it didn’t happen with the old AI (much simpler, not nearly as many commands).

Watch a replay of some AI behaviour. There are edge cases where they get deeply confused. For example, put some archers in range of farms around their TC or build a tower near their only gold patch. Sometimes, the villagers start “stuttering” as they rapidly try to mine the gold and stop mining the gold to run to safety — but the conditions loop into one another. Just based on the animation alone you can tell it’s happening many many times a second, for each villager. The more units they have, the more this clogs up the “turns” and means your human commands are postponed 30 seconds into the future.

At least, that’s my armchair analysis without being able to track the code to its source… If correct, the solution would be to limit the # of commands the AI can issue to some reasonable APM. Ideally the above kind of loop conditions would also be identified, or even better, could be systematically checked for (“Have I issued this same command more than 4 times in the past second?”)

Thank for the reports, could you please provide us with info about how many AI and how many human players were on the game, and also what difficulty level was the AI set to? It would be very helpful if you could also attach logs and minidump files from the crashes you experienced, they are located in “C:\Users\USER\Games\Age of Empires 2 DE\logs” and will have a format like this “AoE2DESteam-XXXXX-2021.06.23-09.56.40.mdmp” for the minidump and like this “2021.09.01-15.34.20.txt” for the logs. Just look for the one with the date and time when this happened and attach it so we can investigate what the issue is

Ok, I had already attached a log from the enhanced logging build of a crash to the bottom of the report

here is the link to the log on google drive

I think this is the MDMP what you want I am not 100% sure this from one of these crashes since the only one I can be 100% sure on is the log above and that one didn’t create a minidump file

as for # and difficulty of AI it was from 2-4 (same number of players in match) and hard to hardest difficulty.
AoE2DESteam-51737-2021.08.27-22.56.59.mdmp (156.8 KB)

Thanks for the information provided, this issue is now being tracked