Improving performance in larger/longer matches

In multiplayer games where large quantities of units are produced, certain issues related to performance and pathfinding become increasingly prevalent. These sorts of issues are of course compounded in multiplayer when some players have lower end hardware, resulting in significant (sometimes crippling) sim speed drops.

Are there any ways these issues could be alleviated to some degree, perhaps via a mod or game start option? I'd expect some sort of gameplay tradeoff to result but it seems it may be worthwhile regardless.
I've pondered on this occasionally over the years, and some of the silly ideas I've thought about are below:

-Disabling of collision between friendly units, so they can pass through each other

-Some sort of squadron system, where only a single unit is used to represent and interact as a whole group of units. Or alternately...

-Add 'elite' (or a better label) versions of factory produced units (for example, a t1 tank that costs 10x as much in time and resources, but has 10x as much hp and damage output) to organically reduce swarm sizes in longer games.

-Disable bullet physics/terrain checks, so that only the range check is required for direct attacks to hit.

-Add an upgrade system for all structures, so that economies and production can scale up to the same level with a significantly smaller number of buildings on the map.

I'm guessing doing any of this would either be too hard or break the game in some way, but I'd be interested to read any ideas you might have about this topic.

I did a quick search but was unable to find an appropriate thread, so please direct me there if it exists already and I missed it.

@icewyrm said in Improving performance in larger/longer matches:

-Add an upgrade system for all structures, so that economies and production can scale up to the same level with a significantly smaller number of buildings on the map.

This one is implemented by LOUD.

All the others are related to the engine, they're quite impossible to do as we have to do it in assembly.

While looking at your replays I assume you're playing with AIs? If that is the case then I can recommend you the LOUD project. They take some performance gains quite a bit further than we do, as an example they remove some effects and changed the balance quite a bit to naturally reduce unit count.

We're not as far as LOUD is with regard to performance. We've had some significant gains in the past - an example is the cybran build drones being 6x - 7x as fast than before. We're working on other gains as time passes - we're just a bit short staffed πŸ™‚ .

A work of art is never finished, merely abandoned

@jip Apologies for showing my ignorance but would it at all be possible to reach out to the LOUD team and ask them what improvements they made to their code and then copy and paste the better bits into FAF code?

It is significantly more complicated than copy pasting code, the projects diverged in codebase like a decade ago and many LOUD performance improvements come at gameplay costs FAF isn’t interested in taking.

@ftxcommando That's a comprehensive answer, thanks!

The true answer is a little more in depth. While there are certainly gameplay choices that differ between FAF and LOUD - those have very little to do with performance. That's one of those persistent myths that came about because an excuse was needed about why the work hadn't been done to make it more performant. The real difference is structural, and one of data and code streamlining.

That work is, finally, being started, by Jip.

Doesn't FAF have units checking for enemy units per tick while LOUD doesn't?

We use the same engine calls and everything. Yes - we have made some adjustments to the data rate of some operations, but I think in this case you might be referring to target checks by weapons.

Some weapons do indeed check for targets every single tick - and some check every few ticks or even every second or so. It's really related to the weapons rate of fire. We have limited some of these targeting checks so that no weapons looks for targets at a rate any higher than 4 times it's rate of fire. Does it have a performance impact ? Yes - but it's very tiny - and it's specific to that weapon, on that unit.

If there are many hundreds of them, in game, at any point, yes - you will be able to detect the performance difference. Gameplay difference ? I suppose it's possible - but I've never been able to quantify that. The weapon still fires at the same target, at the same rate.

@scout_more_often said in Improving performance in larger/longer matches:

@jip Apologies for showing my ignorance but would it at all be possible to reach out to the LOUD team and ask them what improvements they made to their code and then copy and paste the better bits into FAF code?

To quote myself in the association chat earlier today:

(...), This is not entirely true - they do a lot of other things, that we're only starting to do recently:

  • better memory management
  • better access patterns
  • removing redundant code (that doesn't impact the game)
  • refactoring the code for better performance (as an example, all units (regardless of what unit) tries to run a 'UnderwaterMove' sound every time they change their movement (stopping, starting, cruising, top speed, etc))

And yes - they did change some gameplay to favor a gamestate that offers better performance. As an example: we can easily have 500+ t1 engineers at some point in the game. They buffed their factories to have more bp in comparison to engineers to naturally reduce the number of engineers. But they're not that big in my opinion

As Sprouto mentioned, we're working on it. The code base is large, and it is manual work. We take it one step at a time πŸ™‚ .

A work of art is never finished, merely abandoned