Testing Economic Balance Changes

A forum for chatting about in-development game features.
Post Reply
User avatar
sven
Site Admin
Posts: 1621
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Testing Economic Balance Changes

Post by sven »

SgtArmyGuy wrote: I think the AI could afford to use its rare doom-stacks more aggressively. The Imperials had some impressive fleets with impervious 720 shield ships, but they rather sat on their own systems and watched me bomb everything around them than go do the same to MY systems. In this game it was the Imperials vs. the rest of the galaxy, but I've seen this behaviour on 1v1 situations as well. If you do intend to make the AI sue for peace earlier on (as I have understood is your idea), why not give it a "main fleet"? A super-aggressive doomstack that actively attacks the enemy systems, and doesn't necessarily follow the rules of other AI. Then you can associate the "sue for peace" event with the destruction of this "main fleet" (or "fleets", if the AI empire grows big enough). Narratively and gameplay-wise, the "main fleet" would create an incentive for fighting a decisive battle (which is a good thing in a tactic-focused 4X). If you DON'T destroy the main fleet, it WILL come to your doorstep and f**k your sh*t up - but if you DO take it on, and take that chance of losing, you have a good chance of making the AI sue for peace. Currently it's just too easy to avoid that big battle and destroy the enemies around the doomstack. This is not very fun, or very narratively engaging.

...and when I say the main fleet should be a "doomstack", don't interpret it too literally. I just mean: give the STRONGEST fleet a "special" AI logic and role in the game. It's bound to wreack some havoc when unleashed, and would require the player to re-adjust their strategy! Basically, you would have the choice of encountering the doomstack or going around it, and each choice would have a more clear-cut "cost" to it.
Yeah, I think the AI logic around managing attacking fleets could really use some logic updates. The core problem, in my mind, is that the AI doesn't currently have much of a notion of a "fleet", instead it just routes each ship independently towards whatever stars it identifies as attack/defend priorities. This leads to a range of problems. Just visually, the fact that the AI is moving around lots of small groups of ships, instead of a couple big coherent fleets, makes it much harder for the player to figure out what's going on during a major war. But the ship-by-ship routing strategy also creates strategic problems for the AI, as small groups of ships that have been routed independently can end up being caught out of position by enemy forces and defeated in detail. Then there's the "fun factor" that you identified -- because the AI is generally splitting up its ships to attack multiple targets at once, rather than just stomping around the map with the biggest fleet it can muster, big decisive battles are rare.

The somewhat delicate thing here is that I think it's capacity to wage war on multiple fronts simultaneously is actually a good and important feature of the AI. Particularly on huge maps, it's pretty common for an AI to be fighting 2+ different opponents at once, and in totally different regions of the map. That it's capable of doing this somewhat competently is important, I think; and if I lean harder into a "main attack fleet" concept, the AI may well get worse at handling those multi-sided conflicts.

That said, the bottom line, I think, is that the current attack routing logic is hurting the game in a variety of ways -- so a rewrite or significant logic patch is probably in order.
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Testing Economic Balance Changes

Post by zolobolo »

sven wrote: Yeah, I think the AI logic around managing attacking fleets could really use some logic updates. The core problem, in my mind, is that the AI doesn't currently have much of a notion of a "fleet", instead it just routes each ship independently towards whatever stars it identifies as attack/defend priorities.
What if the priroity to select defense and attack targets would consider own ships as well? e.g.: if the strongest (capital) ship is located or heading to system A, that system gets a efense priority for smaller ships

That being said, I agree that waging war on multiple fronts is much more effective and is a must on large maps so it is not a fundemental issue that the AI doe not form doomstack (wouldalso not be very fun to play as the downsides and limitations of large fleet battles would become apperant

In fact I had a numer of games in early builds where the AI did end up with massive doomstacks of 6-10 battleships:simply skirted around them with 2-3 firoces with a fraction of firepower but a couple of heavy guns and devastated all their colonies. Had the AI simply split its doomstack into 4-5 fleets with 2 ships in each, I would have easily lost the war whatever they do afterwards
User avatar
sven
Site Admin
Posts: 1621
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Testing Economic Balance Changes

Post by sven »

zolobolo wrote:In fact I had a numer of games in early builds where the AI did end up with massive doomstacks of 6-10 battleships:simply skirted around them with 2-3 firoces with a fraction of firepower but a couple of heavy guns and devastated all their colonies. Had the AI simply split its doomstack into 4-5 fleets with 2 ships in each, I would have easily lost the war whatever they do afterwards
Yeah. I think that, ultimately, a clever player is always going to be able to find strategies that confound the AI; indeed, that's part of the fun of the game. If the AI tends to bunch up it's ships, the player can split up his forces and harass. If the AI splits up its fleets, the player can defeat the AI in detail. And there's not really anything wrong with either outcome -- the goal with the AI code is not to make it play perfectly, but, rather, to make it play in such a way that it's a reasonably satisfying opponent.

The biggest problem I'm seeing with the AI fleet behaviors at the moment is that, as SgtArmyGuy says, they're often not really narratively satisfying. As in, it's rare that you can tell yourself a particularly fun story about the battles you've had against the AI. I think a big part of the solution here may just be to teach the AI to group up its ships into coherent fleets before sending them off on whatever adventure -- as then at least the player would more easily be able to keep track of what the AI was doing, rather than just peering at a confusing swarm of individual ships.

On top of that, tweaking the routing rules so that AI's are more likely to commit to big decisive battles, and then, tweaking the diplomacy rules so that that the AIs react in reasonable ways to winning/losing said big battles, would all probably be improvements over the status quo, I think.
Dragar
Posts: 119
Joined: Wed Mar 21, 2018 12:20 pm

Re: Testing Economic Balance Changes

Post by Dragar »

I think that's an excellent summary of the situation.

Also, I think we're all aware this stuff is *hard* to get 'right', particularly as 'right' is nebulous anyway. SiS is better than a great many other titles!

Sword of the Stars, incidentally, had woeful AI in a strategic sense, but narratively it was pretty great: it gathered a blob of ships, sometimes, multiple blobs, and threw them at you in multiple locations. It was crumbled under an assault, especially a multi-pronged assault, but if it lead with an offense and you were on the backfoot it would create a pretty fun tension to see if you could get the initiative back in order to defeat it strategically.
SgtArmyGuy
Posts: 26
Joined: Mon Jan 14, 2019 4:43 pm

Re: Testing Economic Balance Changes

Post by SgtArmyGuy »

Ohmygodohmygod, I just had the COOLEST idea! It builds upon the "main fleet" idea, but takes it up to 11.

First of all, the AI has been GOOD ENOUGH after Harpy Eagle's mod work - especially the ability to wage war on multiple fronts is an important factor as you have already mentioned. It doesn't go on suicide runs, and can generally cluster enough ships together to make a difference. The only problem is that those stacks don't ALWAYS do anything RELEVANT or NARRATIVELY INTERESTING, and definitely don't give off an impression of being "smart". Small fleets and individual ships get managed properly, fleets don't. This is due to the AI having no notion of "fleets" in the first place, as Sven said.

So... 8-)

How about - instead of re-writing the base of the whole damn AI (that's actually a VERY GOOD base to begin with) - you just give it a "hive mind"? In normal mode, individual ships get managed independently by the AI like they do now. HOWEVER, if enough of them end up clustering up together in the course of the game, this has a set chance of triggering a "fleet event". It works like a hive mind: independent ships are not very smart, but once enough of them bunch up, something cool happens! This even makes them "random" without the need of an actual RNG: the current fleet AI is your RNG. :P All I'm proposing is you make the AI "recognize" when it has "accidentally" created a "fleet", and then trigger a relevant event. After the event resolves, all the ships revert back to the "normal mode" AI (or have a set chance of triggering another event). This way the "fleet" either continues to function, or splits up to wage war on multiple fronts. The "events" should be kept relatively short, and resolvable in most cases in 1-3 turns so it doesn't mess up the overall ship deployment of the AI. The events are intended to give off an impression of STRATEGY and NARRATIVE, not just random ships doing tactical stuff at the front line.

Cool thing number 2: you can limit the events available to the AI by difficulty, so we finally get the "AI difficulty settings" people have been asking for! You're no longer limited to setting the difficulty by starting bonuses alone. Plus, you don't have to re-write old AI code. We'll just "spice it up" instead.

Cool thing number 3: the events themselves! You can get really imaginative here, and tie these into diplomacy events, the type and nuber of ships available, etc. Basic events could be something like:

1) FINAL BATTLE (IF my fleet is a doomstack, AND enemy has a big fleet within range, THEN attack the system containing it)

2) SPLIT AND RAID (IF my fleet elements can destroy enemy planetary defenses, AND several targets are within range, THEN split the fleet into smaller elements and bombing raid all systems reachable within 1-2 turns)

3) DOOMSTACK AND PUSH (IF my fleet is a doomstack, AND enemy has no big fleet within range, THEN plot a course of 1-5 stars for invasion/bombing raid shenanigans). If successful and no other worlds have been lost, the AI might even offer peace after being "content" with its conquests.

4) STRATEGIC STRIKE (IF the enemy has a production world in the front line reachable within 1-2 turns, THEN attack it with this fleet)

Following my idea of possible chained events occurring, it would be "fun" to have the AI randomly DOOMSTACKING AND PUSHING into my center, and then suddenly doing a SPLIT AND RAID. Now THAT would be a war story worth telling to the next generations of warriors in order to keep them sufficiently angry and willing to die for their empire. ;) Certainly, the AI would have more teeth and also give off a better impression of doing SOMETHING with its "fleets".

tl;dr: Don't touch Harpy's code. I'm willing to protect it with a cattle prod. :)
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Testing Economic Balance Changes

Post by zolobolo »

sven wrote: Yeah. I think that, ultimately, a clever player is always going to be able to find strategies that confound the AI; indeed, that's part of the fun of the game. If the AI tends to bunch up it's ships, the player can split up his forces and harass. If the AI splits up its fleets, the player can defeat the AI in detail. And there's not really anything wrong with either outcome -- the goal with the AI code is not to make it play perfectly, but, rather, to make it play in such a way that it's a reasonably satisfying opponent.
Fully agree: the AI needs to a satisfying opponent.

Would argue that both amassing all ships into a doomstack as well as splitting up, when harcoded, goes against this as I would say the AI is a satisfying opponent if it plays the game competently. Not perfectly, but visibly understanding the rules and mechanics of the game. Hence concentrating on either grouping "strategy" under all circumstances does not show an understanding of the positioning "game": the AI ideally needs to be able to do both under the right circumstances. It is from here where narrative satisfaction can derive: if the AI makes a competent move that makes sense in the context of the rules and situation - countering that is satisfying

That is why I always argue that both AI and player should not get any buffs or debuffs nor should be there any mechanics in a game that the AI cannot use or does not "understand" as using these in such a case feels cheeting/exploiting the AI and hence not satisfying. If you can beat an AI on a level playing field and the AI is capable of beating you (maybe even done so a few times already) - that is perfect setup for a satisfying gameplay

The idea of having some fleets with a specific goal is a nice workaround and this goes for the hivemind idea: under well-defined circumstances such events could be triggered and hooked up into the diplomatic system: I would love to see the AI threaten the player with a fleet or sue for peace after loosing its promptu doomstack offering regular payment in exchange even if this is scripted. Sure its not that dynamic but it fills in the blanks for the AI script

Swarm of ships are bad no question: makes the galaxy map unreadable in some cases so some coherent movement either via priorities, fleet events of swarm intelligence would improve upon this

What HarpyEagle was doing if I remember correctly, was not to change the routing of ships though but adjust the build priority of planets and thus having the AI build more organic fleets (no more mass production of battleships). This of course naturally aligned with his tactical AI change of retreating more often when the engagement was not worth the losses and resulted in many more AI ships on the map. A large number of smaller ships entering the field earlier in the game naturally lend the AI better chance to combat threats more effectively

I would consider following this logic of considering time as the most valuable resource for the AI (instead of coin or metal) and try to make the AI much more sensitive to travel time requirements. The less their ships are prone to travel long distances, the more likely they would be to form larger fleets and less likely to have many ships moving about the map
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Testing Economic Balance Changes

Post by zolobolo »

New game on Oval, Huge map, all factions but this time on Normal difficulty:
+ The current economy balance resulted in player income not steamrolling even after 2nd annexation! Income +90 after Turn 200. Also not though that I was endlessly churming out ships like on stable version and the ships upkeep costs were the ones eating away on the income
+ All AI factions have managed to carve out a couple of planets for themselves: this I think I have never really seen as one or the other faction alwas got axed in the first 120 turns or got stuck on 2-3 planets
+- Two smalles allied factions joined the player relatively soon: this was good for one of them as it did not really compete with others altogethe, but the other one was centrally located and had the 3rd largest territory (not sure if they should have joined)
- No mayor empires emerged - almost all factions remained on rougly equal strenght except for the Orthin who have gained huge research advantage via destruytion of Harpy units (I think that the research gain here might be OP a bit)
- Noticed in all my games the Gremak never managed to form a big empire. Maybe this is due to their lack of starting research or their expensive ships but worth noting
-The AI is having issues with what to build on its planets and cannot sustain a sizable fleet with the new economic balance on normal. The below image shows the Humans planets, current projects and the buildings on their second largest planet: the largest one has 4 factories! This shows to me that factories have a much higher build priority then they should have and markets would need a higher prio (notice the emphasis on trade porjects, tiny trade pool and rioting minor race withouth moral bonus) The faction (all factions) should constantly churm out ships: small medium and occasionally large to make up for theit ongoing losses and be able to defend and gain new territory but from what I can tell, the build order relies on some resoruce bonuses withouth which the AI is lost trying to make up for them via planetary projects while still keeping a huge amount of factories going which of course is not efficient usage of their production.

If we replace every second factory for this faction with something more usefully, we get a competitive faction as seen on the second picture. Notice:
- Faction has enough metal income to endlessly produce heavy cruiser, destroyers and troop transports in a swift manner (these three enable swift conquering) thanks to increased metal production and reduced labor
- More income and better moral
- More food to sustain pop
- This all comes at the cost of production (mostly wasted before), and research which can be won back again via invasions
Attachments
Humans Before.png
Humans Before.png (1 MiB) Viewed 14854 times
Humans After.png
Humans After.png (972.07 KiB) Viewed 14854 times
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Testing Economic Balance Changes

Post by zolobolo »

Overall the current economic balance is just abouth right for someone with my playstyle in that I din't have to change anything on my build orders but didn't have any steamrolling coin income on the side: it always stayed below 100 income

But I think the AI needs a rebalance to planetary improvements to be competitive compared to the player
User avatar
sven
Site Admin
Posts: 1621
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Testing Economic Balance Changes

Post by sven »

SgtArmyGuy wrote:Ohmygodohmygod, I just had the COOLEST idea!
This post made my day, your enthusiasm is infectious :D

That said, I haven't actually implemented your ideas (at least, not in a direct sort of way), but, I have taken another run at refining the fleet routing code. Sadly, concepts that feel like they ought to be awesome in theory often turn out somewhere between underwhelming and maybe just "ok" in practice. This morning, I had hopes that some of the changes I had in mind would revolutionize player's warfighting experience, but, now that they're coded up, the improvements (if any) are all feeling more sortof incremental.

I did experiment with tweaking the numbers so that the AI would tend to form a huge offensive fleet and go stomping around with it -- but what appears to happen in practice is that the huge fleet strategy will get out maneuvered by other AIs that are more willing to fight on multiple fronts -- so it's a policy that ultimately hurts whatever AI adopts it. On 88-star maps, I suspect that effective play frequently requires splitting your forces.

So, I backpedaled on the huge fleet concept, and returned, more or less, to a version of the AI that tries to split up its forces relatively efficiently over the available targets. There's some logic in there that should make it possible for doomfleets to form and crash into each other, but, the numbers aren't strongly biased towards that happening.

At the same time, I also added some logic to encourage AIs to muster their fleets into a single group before charging across the map with them, which should help make the strategic map view a bit less cluttered. But I'm not including the 'mustering' code everywhere, and that means you still do get cluttered maps in some situations.

Finally, I did find some bugs in the code for offering concessions when suing for peace, and with those fixed that feature should actually be working as intended. Hopefully, that fix, along with some incremental improvements to the fleet routing code, will contribute towards making wars a bit more narratively satisfying.

If you notice any real differences, good or bad, in r38102, let me know.
SgtArmyGuy wrote:tl;dr: Don't touch Harpy's code. I'm willing to protect it with a cattle prod. :)
The sentiment is appreciated, but as zolobolo pointed out, harpyeagle never actually touched the fleet routing code. In fact, I myself haven't really touched this code in years, and in going back to it I've discovered many smaller and larger bugs. At this point, I'm amazed it ever worked as well as it did. Of course, in changing/patching it, I may well have introduced yet more bugs, but, that's an unavoidable risk. I'll just need to keep a careful eye out for strange AI fleet routing behaviors going forward.

High level though, my fundamental approach is to build on/improve what's currently working, not to recreate it all from scratch, which I think is the heart of what you're suggesting here :)
nathanebht
Posts: 120
Joined: Sat Oct 21, 2017 2:48 pm

Re: Testing Economic Balance Changes

Post by nathanebht »

On the AI fleets topic, when the AI goes on the attack their ships often don't arrive on the same turn. This then lets me defeat them in detail.

If the AI actually formed fleets. Also if the AI defended their empires instead of going across the map to an allies empire. Then they actually might become dangerous. :D Of course you'd still have the problem that they don't build enough troop transports.
User avatar
sven
Site Admin
Posts: 1621
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Testing Economic Balance Changes

Post by sven »

nathanebht wrote:On the AI fleets topic, when the AI goes on the attack their ships often don't arrive on the same turn. This then lets me defeat them in detail.
This specific suboptimal behavior is something I was able to attribute to an AI logic bug, and that bug should now be fixed, so please let me know if you see it happening much in builds r38102 and newer.
SgtArmyGuy
Posts: 26
Joined: Mon Jan 14, 2019 4:43 pm

Re: Testing Economic Balance Changes

Post by SgtArmyGuy »

Based on what Sven wrote, let me refine my earlier concept.

What exactly is a "doomstack" in a STRATEGIC sense? It's an application of LOCAL ADVANTAGE IN MANPOWER. More ships overall doesn't matter, it's about how many of them you can bring to bear at any one time. One counter to a big stack of ships is, logically, to split your smaller fleet into elements and strike several systems at once. Once the doomstack is now forced to split up as well, YOU might actually end up having the local advantage in manpower in at least some of the fights. So you're applying the SAME basic principle to win, not a different one. The "push" strategy and "split" strategy I mentioned in the earlier post build on the same starting position, in which the AI "recognizes" it has LOCAL ADVANTAGE IN MANPOWER.

So lets forget "doomstacks" per se. We should be talking about concentration of force, and that might actually come down to something as simple as TIMING. The issue, in my mind, has been that the AI brings a fleet forward, but then backs up instead of striking undefended border worlds. Is it thinking TOO FAR AHEAD? I mean, I often move my border fleets to the next system only - they never spend more than 1-2 turns in-flight. Once they strike, I take a look on how the situation has changed, and re-route if necessary. In addition to the strike fleets, there are staging areas where new ships arriving as reinforcements get sent to - these ships can have orders to spend several turns in-flight.

The point is: if the AI can recognize it can apply local advantage in manpower WITHIN a short time-frame of 1 or max 2 turns, it should seize the opportunity (if we're talking about aggressive AI - it's possible to devise other strategies as well). I saw doomstacks just sitting and idling when stuff around them kept blowing up. If the stack splits, that's good. If it pushes forward and makes sure I can't harm it, that's equally sound (although probably not wise, as Sven took note, but at least it conserves the ships in the stack). So my suggestion is to make the dynamically-formed hive mind "doomstacks" OPPORTUNISTIC: have them apply that force somewhere QUICK. Clustering up is not a strategy, it's a tactic. No wonder the AI that consistently stacks up gets beaten down. My concept is all about making the AI do something decisive and unpredictable when it finds itself in a situation that's already advantageous to it.

"Some men just want to watch the world burn." :)
Alimaeus
Posts: 11
Joined: Sun Mar 03, 2019 2:59 pm

Re: Testing Economic Balance Changes

Post by Alimaeus »

Some of what SgtArmyGuy said.

Also how does the Military AI work currently? If this isn't how it works already, I think you're going to need a Ship AI that plugs into a Fleet AI. Ship AI designs and builds ships and controls civilian ships, military ships then join a fleet and Fleet AI takes over. The fleet AI will need to be objective focused and defending core colonies has to be priority 1, priority 2 can be attacking the enemy, leaving vulnerable frontier colonies to priority 3. Maybe have priority 2 and 3 switch during a war where you're fleets are outnumbered or you have allies to do the heavy hitting.

Fleet AI judges how many fleets it needs and what they should do. This judgement is based of weighted numbers based on e.g. total ship upkeep, defence targets (own systems/colonies with larger weights for larger colonies and capitals) and offence targets (enemy/hostile systems). So once the AI passes certain thresholds in ship upkeep it splits its fleet into multiple fleets capable of working on multiple objectives. The ratio between defensive/offensive systems can determine whether the Fleet AI needs to bunch up or split apart. Having more defensive systems should encourage more fleets and having more offensive systems should encourage bigger fleets.

You're likely going to need so set some weights to encourage the AI to reliably form fleets and change between bigger fleets and more fleet according to certain triggers. One obvious trigger should be when the enemy causes a fleet to retreat due to being outnumbered, this should trigger an oh shit reaction for the Fleet AI and it should attempt to double up its fleets. Another should be e.g. skirmishing trigger when a fleet attacking/defending an objective has more ships than needed and there are nearby undefended systems so it should be weighted to split in half and spread out, this function should be (temporarily) disabled if the Fleet AI has an active oh shit trigger.
nathanebht
Posts: 120
Joined: Sat Oct 21, 2017 2:48 pm

Re: Testing Economic Balance Changes

Post by nathanebht »

Started a new game using version 38109 on hard difficulty, 88 stars with the Gremak. Not finished it yet.

The early game was oddly peaceful. No early declarations of war. This made sense. The AI took planets fairly aggressively. Even one planet that I thought they couldn't take from the Arda. Had good relations and treaties with all but one of my neighbors. The Ashdar Colonials didn't have good relations with me for no reason I could determine.

Got to the mid game and saw that my Human neighbor was getting taken over by the Tinkers. I was building up a fleet planning to attack someone.

Suddenly the Ashdar Colonials declared war. Same turn two other neighbors got into a war. Next turn, significant fleet of Colonials appeared over my further-est planet. 5 military transports, 2 light cruisers, 1 destroyer and 1 light carrier. Lost that planet and 3 of my cruisers. See they also have 2 battlecruisers with plasma cannons at another nearby planet of theirs.

I hadn't been building planet defenses because they have such a high maintenance cost.

Good thing another patch came out today. Will have to start a new game with it so the testing is reliable. ;)

Should mention that the AI's research progress seemed more reasonable with this version.
User avatar
sven
Site Admin
Posts: 1621
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Testing Economic Balance Changes

Post by sven »

nathanebht wrote:Had good relations and treaties with all but one of my neighbors. The Ashdar Colonials didn't have good relations with me for no reason I could determine.
This is probably working as intended -- Ashdar should have a strong anti-Gremak basis. In game, that basis will be reflected both in some negative "ancient enemy" issues, but, also in increased influence costs for any treaties. If you felt like they gave you the cold shoulder, then attacked for no reason, that's... more or less exactly how the Gremak/Ashdar relationship is supposed to play out ;)
Post Reply