Would you accept a less simulated AI?

The big problems with Stellaris these days are performance and AI. One drastic solution to both problems would be to simulate the AI less. This would sacrifice some level of realness for gameplay.

The first example would be trade routes and pirates. For players, trade routes are fun. You can set up patrols to level your admiral, or let pirates spawn and take them out. But the AI seems to have real trouble taking out pirates. Would much be lost if AIs just got %100 of their trade value all the time and never spawned pirates? A pirate battle on the other side of the galaxy would rarely be noticed by the player, but does use CPU resources.

Of course, the biggest performance sink is pops and jobs and the AI isn't great at running their economy. What if we simulated AI economy at the planetary level? There could be a simple matrix. A Pop 4 Agriworld produces X, Y, Z resources. If we ignore details like species traits, then we won't constantly have to run an algorithm trying to put the right pops in the right jobs. Obviously, if you conquer the planet or build a branch office you'll want ot fully simulated. It could be instantly populated with appropriate buildings (just another column in the matrix.) This should greatly improve performance as well as keep the AI from borking their economy too much.

To me, the marauders and crisis are some of the best gameplay and they already work this way. Would you be willing to accept normal AI empires playing a slightly different, simpler, game?

Posted Nov 28, 2019, 2:26 PM UTC

5639
QuantumPancakeLord•

I've found two of the biggest items hitting performance (After accounting for vacant jobs causing daily job checks - pops themselves don't have much of a performance hit when there aren't many checks being run.) are fleet pathing and trade calculations.

Less AI simulation won't directly help with any of that tbh. They need to iteratively optimise their algorithms.

Though trade/piracy probably needs a partial rework, as it's a bit shit right now.

51
JamesDevittOP•

What do you mean by trade calculations?

We could have fleets be able to jump between stations within an empire's territory within the fog of war. That would give an impression of the AI being able to position their fleets. That might cut down a little on pathing. The new ship-building ships might cut down on a lot of pathing.

-4
Turmfalke_•

We could have fleets be able to jump between stations within an empire's territory within the fog of war. That would give an impression of the AI being able to position their fleets. That might cut down a little on pathing.

Not really, the difficult part of pathing is pathing. As in the ai has to check were it wants it fleet to go, making the fleet faster (to the point of teleporting) won't reduce how often the ai decides were the fleet is supposed to be.

12
gc3•

If the actual cost is calculating a ship's movement each frame, then don't do that, just use the route and then render the ship where it is supposed to be when it is seen. Remove small details about maneuvering from the program.owing down and speeding up and the like and maneuverability and turn radius.... features that are not so important.

If the actual cost is calculating a ship's movement each frame, then don't do that, just use the route and then render the ship where it is supposed to be when it is seen. Remove small details about manuevering from the program.

1
Mitchical•

That's not what's meant by pathfinding... spatial updating of ships shouldn't be that expensive outside of battles tbh. He means deciding which systems the ships even need to travel through to reach their target (almost equivalent check for pathfinding trade routes)

2
EpicScizorFungoid•

Trade calculations = Calculating trade routes between stations.

8
JamesDevittOP•

Yeah, I don't think AIs should have trade routes, we can just assume they get all the trade goods where they need to go.

-1†
guto8797•

Stellaris Immortal, a alpha mod does this to improve performance. Trade is all collected with no use for trade range stations, since they are big sources of lag

1
DDumpTruckK•

My problems with simulated AI is why I dont like Total War games. It makes the game mechanics that the player uses different from the mechanics the AI uses. That seems obvious of course but the implications of that are that it is no longer intuitive how to tackle an opponent. If they dont play by the rules then its limiting my creative options to take them down.

For example in Total War the AI doesn't really have money or food like the player does because it couldn't manage it. But that means I can no longer employ a strategy to target their big food production territories to starve them out or I cant attack their money making centers to hurt their finances.

If you remove mechanics from the AI you might end up removing options for the player which isnt good.

13
3rd-wheel•

Oh wow that sucks. Those should absolutely be viable strategies

5
DDumpTruckK•

Yeah, but for fairness in the example given by the OP for Stellaris: piracy, it wouldnt be as big of an impact as my Total War example since in Stellaris theres just not much an outside empire can do with another nation's trade value. So it might work out in that Stellaris example. I just also wanted to preach a caution in simplifying and simulating AI because I think the inability of Total War games to make an interesting AI is one big factor that had led to the decline of those games in my eyes.

3
WoomodCelestial Empire •

My problems with simulated AI is why I dont like Total War games. It makes the game mechanics that the player uses different from the mechanics the AI uses. That seems obvious of course but the implications of that are that it is no longer intuitive how to tackle an opponent. If they dont play by the rules then its limiting my creative options to take them down.

It speffically mentioned stuff like agri worlds and such, so i think we can assume that hitting an agri world hits their food supply more directly.

1
DDumpTruckK•

Yeah but it gets bogged down a little in the theoretical execution though, right? Like the AI cant manage pops or buildings so OP has posited to just simulate like it could. But then when I take their agricultural world what's stopping them from instantly designating another similarly populated world as an agricultural world and problem solved?

I'm not completely against a simulated AI, just cautious because it's a REALLY big project to consider every angle from and theres probably a point where the simulation is so complex to represent the complexity of the real game that they could have just taught the AI to manage its pops in the first place.

1
MThead•

Taking out the pops/jobs for AI is kind of a bandaid solution as that would still leave terrible slowdown for multiplayer and would actually take a bit of work to set up (not to mention be largely incompatible with a lot of mods).

Nah, in this case it'd be easier to actually fix it IMO. Players have already found the root cause of the lag and there's two options. The quick and dirty one is to just check for jobs less often. The best way would be would be to move to an event system where it only checks for jobs on resettlement/user interaction/pop finishes growing.

12
SmordanSmeterson•

In theory I have nothing against it, all I want from the ai is a challenge. I have no idea how they would pull that of at this point though.

12
Delthor-lionRogue Servitors•

YES! This would be the number one thing I'd change if I was King of Stellaris for a day. The AI empires aren't there to be some kind of demonstration of the AI team's superiority. They aren't opponents in a board game. They're more like NPCs under a Game Master in a tabletop roleplaying game. Making them follow the same rule set is silly. It wouldn't 100% fix the performance problems, but it would fix the AI problems and still be an improvement to performance.

Sadly, I don't think the 4X/Grand Strategy community will ever get over thinking of this as "cheating." Numerous other game elements use a completely different rule set: marauders, crises, leviathans, fallen empires, enclaves, and so on. Often these are bigger challenges and threats than the rival empires. Usually, the quality of play they offer is also much better. Yet no one considers those things to be cheating. Why can't we just do that with the rival empires?

Trying to teach an AI to play a game that's deep enough to be enjoyable to a human player in a strategy game has never gone well. At this point, it just feels like a huge waste of resources that could be better spent improving the areas where the AI does need to follow the same rules like fleet movement.

5
Mornar•

One thing that I see here: other empires are supposed to be similar to player empire, be affected by similar things. What hurts me, should - under right circumstances ofcourse - hurt my enemy. Abstracting too much of inner workings of an AI empire puts that at risk. An example (and still a very tame one) is Total War: Warhammer public order and corruption, the AI doesn't give a crap on higher difficulties. A fun strategy like spreading your corruption to trigger rebellions to subsequently claim weakened clay simply doesn't work, even though it should. Yes, it solves the problem of AI being shit with managing PO, but is the tradeoff really worth it? Especially in a way more complex GSG?

6
Dzekistan•

they took away the public order bonus to AI in the newest versions in Warhammer

2
Delthor-lionRogue Servitors•

That's a solvable problem. Much moreso than training an AI to play Stellaris. It would be even easier if they started from scratch this way. As they introduce each be mechanic to the system, ensure it's taken into account in the AI's abstraction. Now that we're deep into the game, we have a ton of systems so it would take some work to get caught up. But that's what happens when you make a poor decision early in the process; you eat the cost to fix it. Like they did with the 2.0 and 2.2 reworks.

It's still less work than trying to create an AI comparable to what cutting edge researchers are working on. Because that's essentially what people are asking for. Objections like this read to me like someone saying "But climbing that hill would be hard, so we should keep trying to climb Mt Everest."

2

For single player, I wouldn't mind a less simulated AI. Some other games I play, like Total War, allow the AI to play with simpler mechanics. Another possible solution is to create some kind of server that (optionally) collects gameplay data, like actions, species traits, etc. and sends them to a computer to analyze, compile, and develop player-like strategies and techniques. One game that impressed me with the AI recently was CS:GO. Their CPU players seem to mimic experiences players with their tactics. I don't know if it was based on compiling player data or if the Valve personnel just understand the game they made enough to make a competent AI.

4
Moartem•

Youre talking about machine learning and the scope of the whole game is FAR to big to commercially train a machine for that (thats on an academic level currently). However a dedicated research team has trained a superhuman Star Craft2 AI. I could imagine, how a certain subset of AI functions could benefit from a trained AI, like fleet maneuvers, planet development, or even just empire power estimation. A lot of improvements could also be made by getting rid of AI bugs.

4
Peter34cph•

No. I’ve always loathed the cheating AI in the Civ games. I know that creating good AI requires ability, and that for this reason game publishers are more and more loudly encouraging their customers to play MP only, but that’s exactly what justifies a company making a profit: That it does something that is difficult. Something that only few can do. So get your asses in gear, Paradox! Try to impress me.

4†
WoomodCelestial Empire •

Okay blunt response, are you okay removing modding?

1
Eric_SenpaiCorporate•

Totally down for less simulation. I wouldn't mind a setting wherein ai just got techs at certain years, or mirrored your techs. Or if their planets built things instantly onto a prepare template, and when you conquered their planets everything got randomized again like when you terraform a planet.

Obviously this isn't for everyone but at this point I'll take anything for some decent performance.

3
Xerberus886•

100% YES

... honestly f#ck people yelling about "no cheating" AI.

i want a challenge and immersion of me and AI playing in the same universe / game, but i have no probs if the AI cuts some mild corners.

problem is though the automation AI then.

2
everstillghost•

No.

I want a better simulated AI. This changes will not help much performance and will kill a lot of immersion.

2
3rd-wheel•

Hol' up! You can train your admirals by having them go on patrols??

2
JamesDevittOP•

yeah slowly, i think

1
3rd-wheel•

Slowly is better than none at all as it usually is in my games. Maybe if I get them to lvl 2 sometimes

1
CTSCommando•

The biggest performance sink is vacant jobs. The degree to which this affects late game performance is such that everything else is just tinkering around the edges. It's been demonstrated that, in a massive game with no vacant jobs, performance is just fine. There's no point in improving performance by 5% by making sweeping changes to everything else, including allowing the AI to "cheat" by eliminating such things as piracy and true economy, if the remaining 95% goes untouched.

The vacant job performance hit is a problem for both players and AI. Players can mitigate it by ensuring that there are never any vacant jobs, so while one answer would be to make AI prioritise ensuring that there are no vacant jobs this is the wrong approach.

The correct approach is to make it so vacant jobs don't incur a massive performance hit. Improvements to the AI's ability to manage their economy would also be welcome, for more reasons than just performance, but the problem is so dire that AI improvements should be a secondary concern at this point.

Simplifying the AI is the wrong solution. It takes AI in the wrong direction by allowing them to cheat more rather than making them smarter so they don't need to cheat, it reduces immersion by leading to a situation where the players and the AI are effectively playing different games, and it doesn't solve the real problems with performance anyway.

2
acolightIntrospective•

I'm afraid I would be strongly against that. I'm fine with some entities following their own rules, but the majority of the game is about similar things happening to similar entities, and the outcomes of choices they make.

Simulation, even with resource generation advantages, is a huge selling point for me.

1