Massive Stuttering in Multiplayer w/ AI

Hey Guys, I've been a big fan of this game, since I found it about a year ago.

I recently got the game for my friends when it went on sale, so we could play together. We mostly do comp stomps when we do RTS's, until we figure things out.

We tried to play last night in a 3v3 vs 3 easy AI's on Seton's Clutch and were having massive stuttering problems. This wasn't like the occasional hiccup that happens in most RTS games, especially towards end game, it was noticeable the moment the game started, and only got worse. This is something I've never experienced, since I've only ever played single player. We tested a few variations, but it seemed like the amount of stuttering was directly related to how many AI we had in the game. Also, it was affecting one of our players more than the others.

4 Players, 2 AI -> Stuttering but not quite as bad as below
3 players, 3 AI -> Massive stuttering
3 players, 2 AI -> Stuttering but not quite as bad as above
2 players, 0 AI -> Smooth
1 player (me), 7 AI -> Smooth

I guess my question is pretty simple, is this expected? Is this a known problem or am I setting things up wrong somehow? We don't have any UI mod's except the one that gives you better icons on the mini-map, so maybe that is causing the issue? I've searched around a little bit, and I haven't found anyone saying they are experiencing this, but I didn't know if that was because nobody even tried AI matches or not.

Any help would be appreciated, I really want to get my friends into this game, but if we can't do AI matches, they probably won't give it a fair chance.

This is a known issue.

It has to do with this topic and this video that shows that the stuttering you are talking about is right behind us when we're playing with just players. As you can read in the 2nd topic of that post - we're working on it.

An AI adds a lot of computation to a match. These are computed every second, two seconds, four seconds, eight seconds, etc - depending on how often an update is required. That is why when you have more AIs in game the stuttering increases significantly. It is best to have just one AI, maybe give it a cheat factor, or wait the first one or two minutes before building anything yourself. The game is all about exponential growth, this would make the AI harder in general.

Why it works when you're on your own is a mystery. I suspect you have a fast computer (stuttering may not be visible initially, but will become visible as you get to the late game). When playing with other people, I suspect someone has a slow computer. And he would be holding you all back, because that is how the network model of the game works.

A work of art is never finished, merely abandoned

Interesting. Looking at your topic there, it seems you've added some pull requests that have been merged into the FAF develop branch. If I choose the FAF develop game mode in the lobby does that mean I, and my friends will have those fixes, and do they make a noticeable difference?

Also I just want to be clear, but your video shows late game stutters which I think my friends and I could deal with. However, for us it starts stuttering the moment the game starts, and seems bad if not worse than the video. I just want to make sure that, that behavior is also expected? I guess possibly because we are using AI, and that video is from a PvP match?

In any case, glad to see it's being worked on. I have never done any scripting with lua, but maybe I could start looking through things, and see if there is any low hanging fruit I could help with. Thank you.

It would also be useful to check whether one of your friends has a cpu that is simply too slow and/or a poor connection: the first would result in the game being noticeably slower, the second in stutters/a slideshow.

You can check both of these things in game by pressing f11: the simspeed should be at least +0 for everyone at game start (this will depend on cpu), and you can see if someone is having network issues by checking the behind tab.

I don't believe the issue Jip is mentioning should appear right at game start, although it's certainly possible.

@deletethis said in Massive Stuttering in Multiplayer w/ AI:

You can check both of these things in game by pressing f11: the simspeed should be at least +0 for everyone at game start (this will depend on cpu), and you can see if someone is having network issues by checking the behind tab.

Great. I didn't know about this, I will check this tonight and see if either of these seem to be the problem. Thank you.

@samikool said in Massive Stuttering in Multiplayer w/ AI:

Interesting. Looking at your topic there, it seems you've added some pull requests that have been merged into the FAF develop branch. If I choose the FAF develop game mode in the lobby does that mean I, and my friends will have those fixes, and do they make a noticeable difference?

In any case, glad to see it's being worked on. I have never done any scripting with lua, but maybe I could start looking through things, and see if there is any low hanging fruit I could help with. Thank you.

Playing on the developers branch (you can choose to do so on the left when hosting a game) on its own is useful for us when you report back the game log. That way we can see whether the game is still stable (or not) in terms of mechanics.

Note that the changes that we are making right now are primarily aimed for PvP - even though this does affect AI games because they used the same units that are optimized, at the moment we have limited capabilities on changing the AI files too due to time constraints. @Azraeel is working specifically on AI files with regard to the repository.

Also I just want to be clear, but your video shows late game stutters which I think my friends and I could deal with. However, for us it starts stuttering the moment the game starts, and seems bad if not worse than the video. I just want to make sure that, that behavior is also expected? I guess possibly because we are using AI, and that video is from a PvP match?

Stuttering should not be expected - of course. But it is what happens in practice. We suspect the stuttering is the garbage collector. The AIs are not always written with performance in mind - introducing a lot of garbage. What you can do is:

  • Use FAF versions of maps. These have well defined markers and you do not need to auto generate markers using the Uveso generator. The Uveso generator does an excellent job at making markers, but they can also be dense and all functions that work with the markers will therefore be more computationally expensive.
  • Play with only one AI(x), as suggested previously.

@deletethis said in Massive Stuttering in Multiplayer w/ AI:

I don't believe the issue Jip is mentioning should appear right at game start, although it's certainly possible.

You are right - not always. But in some rare situations where I let six AIs dash it out it started after ~ four minutes of game time. I take that as 'appearing right at the start of the game'. On my laptop it can start even sooner, especially with AIs involved.

A work of art is never finished, merely abandoned

Well, weirdly enough, after a few more tests last night, and looking at the f11 menu to monitor, everything was running smoothly. Very minor stutters here and there, which is expected from any RTS. However, nothing like what my friends and I were experiencing the first night. We didn't have time to play through an entire game, but I'm optimistic things will work tonight. It's possible that since my friends had fresh installs, simply restarting their computers smoothed things out, but who knows. I'll reply one more time after we play a full game tonight with an update.