The economy, stupid

General Stars in Shadow Discussion Forum
onomastikon
Posts: 19
Joined: Thu Aug 30, 2018 2:05 pm

The economy, stupid

Postby onomastikon » Thu Sep 13, 2018 7:48 pm

I've let a game run on for as long as possible, and I've noticed that NONE of the AI factions ever, ever has any metal and ever, ever has any use for its tons of superfluous money. Even the poorest AI factions on the brink of extinction have huge sums of cash and, apparently, cannot figure out how to spend them.
Certainly the AI will run into the same problems that the human player has, namely, there is not enough metal, no matter what you do, to use the production hammers you have to produce the things you want which require metal, which is basically everything.
In other words, once the mid-game has gotten well underway, the balance between coin or gold or whatever you call it and metal becomes lost. I can still find some use for gold by scrapping factories and markets (since I cannot build much and hence have not much use for gold) and purchasing mines with the gold I have in excess, but the AI does not seem to do this.
Perhaps things need to become more expensive or metal more abundant in late game by having an additional mining tech that can be researched to further improve mining effectiveness? Perhaps you could make refitting ships cost less metal than they currently do? Perhaps you can have a setting in the Game Setup settings to toggle the abundancy of metal or the price in gold of everything?
Attachments
too much money.png
too much money.png (98.37 KiB) Viewed 20898 times

User avatar
Arioch
Posts: 1403
Joined: Sun Feb 01, 2015 12:56 am
Location: San Jose, California
Contact:

Re: The economy, stupid

Postby Arioch » Thu Sep 13, 2018 10:16 pm

The AI doesn't use exactly the same rules as the player does regarding all resources; in particular, they deal with metals in a very different way, and so an AI empire will very rarely have stored metal. So it's not that useful to look at the AI's resource balances to judge its behavior. The AI can never be as smart as the player, so what we have to focus on is for the AI to take needed steps that make it a more interesting and challenging opponent on the whole, rather than trying specifically to get it to manage its resources like a player would.

I think getting the AI to spend excess cash more often is probably a good goal, but the problem is that bankruptcy in the game is catastrophic, and it's very important for the AI to avoid that situation. It was really not fun at all before when you'd be fighting a war and suddenly the AI would go bankrupt and his fleet would disappear. That happens a lot less now, but it means that sometimes the AI ends up sitting on a lot of cash.

zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: The economy, stupid

Postby zolobolo » Fri Sep 14, 2018 8:30 pm

The AI does a very good job of building up: where it stumbles today in my opinion is purely expansion logic (when and where to build outpost and sometimes colony ship)

It poses a signifficant challenge on Normal difficulty and in fact I suspect it also recieves a bit of Metal aid as well ;)

It should be able to now go withouth cion aid though - or at least it could be taken away from it after 100 turns for a test period.

Another option would be to just add/incresae starbase upkeep costs or teach it to buy mercanaries so it has something to do with the surplus

On the player side I find the coin income to be in a good place and when consdiering merc ship buys it is perfect in my opinion

Printz
Posts: 1
Joined: Mon Sep 10, 2018 8:23 am

Re: The economy, stupid

Postby Printz » Mon Sep 17, 2018 10:20 am

zolobolo wrote:The AI does a very good job of listing the absolute best probiotics for women and building up: where it stumbles today in my opinion is purely expansion logic (when and where to build outpost and sometimes colony ship)

It poses a signifficant challenge on Normal difficulty and in fact I suspect it also recieves a bit of Metal aid as well ;)

It should be able to now go withouth cion aid though - or at least it could be taken away from it after 100 turns for a test period.

Another option would be to just add/incresae starbase upkeep costs or teach it to buy mercanaries so it has something to do with the surplus

On the player side I find the coin income to be in a good place and when consdiering merc ship buys it is perfect in my opinion


How do you go about improving such things anyway? I would imagine you have to worry about breaking the AI when you implement new kinds of behavior, right?
Last edited by Printz on Mon Oct 31, 2022 10:14 am, edited 2 times in total.

onomastikon
Posts: 19
Joined: Thu Aug 30, 2018 2:05 pm

Re: The economy, stupid

Postby onomastikon » Mon Sep 17, 2018 12:09 pm

Thanks for those replies.




The AI doesn't use exactly the same rules as the player does regarding all resources; in particular, they deal with metals in a very different way, and so an AI empire will very rarely have stored metal. So it's not that useful to look at the AI's resource balances to judge its behavior. The AI can never be as smart as the player, so what we have to focus on is for the AI to take needed steps that make it a more interesting and challenging opponent on the whole, rather than trying specifically to get it to manage its resources like a player would.

I think getting the AI to spend excess cash more often is probably a good goal, but the problem is that bankruptcy in the game is catastrophic, and it's very important for the AI to avoid that situation. It was really not fun at all before when you'd be fighting a war and suddenly the AI would go bankrupt and his fleet would disappear. That happens a lot less now, but it means that sometimes the AI ends up sitting on a lot of cash.


I had no idea that the AI uses different rules, thank you.
I would have thought that this is precisely the constraint an AI must consider: Not to bankrupt itself while attempting to prioritize its spending. So does the AI need money at all?

User avatar
Arioch
Posts: 1403
Joined: Sun Feb 01, 2015 12:56 am
Location: San Jose, California
Contact:

Re: The economy, stupid

Postby Arioch » Tue Sep 18, 2018 9:06 pm

onomastikon wrote:I would have thought that this is precisely the constraint an AI must consider: Not to bankrupt itself while attempting to prioritize its spending. So does the AI need money at all?

The AI mostly follows the same rules as the player regarding money; it receives income from the same sources and has more or less the same upkeep costs. But elective spending (deciding when and how to spend saved money) is something that's easy for a human but very difficult for AI. AI usually does not have a stored memory of its own decision making from turn to turn, so deciding what is the right time to use a limited conserved resource is a very difficult problem for AI algorithms; it tends to either spends all its money right away, or else never spend it.

zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: The economy, stupid

Postby zolobolo » Wed Sep 19, 2018 8:11 pm

The upkeep cost of starbases could surely be increased by now right?
This wouldn't upset AI economy as it is not spamming these anymore, but make budgets a but tighter and it feels odd that massive stations cost almost nothing to maintain

User avatar
Arioch
Posts: 1403
Joined: Sun Feb 01, 2015 12:56 am
Location: San Jose, California
Contact:

Re: The economy, stupid

Postby Arioch » Thu Sep 20, 2018 12:26 am

zolobolo wrote:The upkeep cost of starbases could surely be increased by now right?
This wouldn't upset AI economy as it is not spamming these anymore, but make budgets a but tighter and it feels odd that massive stations cost almost nothing to maintain

What would be the gameplay benefit of increasing the upkeep costs of starbases?

zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: The economy, stupid

Postby zolobolo » Thu Sep 20, 2018 5:41 pm

I assume the question is aimed toward priority of the change and not the basic idea behind it: think it was also mentioned before that bases are not balanced yet for upkeep (during upkeep balance of ships) and assume you did not plan with both types of bases costing 0 upkeep forever

As for priority: this is ceartanly not the change with the highest benefit. Like I said, balance is ok now though there is quite a wiggle room here as the player can usually find a place for spare money to rush buildings and these can swallow up a huge amount of surplus before an unbalance becomes apparaent

The benefit here is that implementation effort is minimal and it would "slightly" decrease surplus of AI and player (the topic of this thread) withouth forcing the player into a fixed development path or the AI to go pankrupt (as the AI does not spam bases anymore). another benefit is immersion: bases would actually cost something to maintain which increases also their percieved value for meat-robots (aka: humans).

But if you would ask me on which change a developer should be working on: upkeep increase Or diplomacy update finalisation Or merc ship buy for AI I would not cast a vote on the first one even though effort and risk are miminal

User avatar
Arioch
Posts: 1403
Joined: Sun Feb 01, 2015 12:56 am
Location: San Jose, California
Contact:

Re: The economy, stupid

Postby Arioch » Fri Sep 21, 2018 4:46 pm

zolobolo wrote: The benefit here is that implementation effort is minimal and it would "slightly" decrease surplus of AI and player (the topic of this thread) withouth forcing the player into a fixed development path or the AI to go pankrupt (as the AI does not spam bases anymore). another benefit is immersion: bases would actually cost something to maintain which increases also their percieved value for meat-robots (aka: humans).

Decreasing the cash surplus of the AI is not a benefit by itself. Getting the AI to spend its surplus on something useful would be a benefit, but simply removing the cash doesn't serve any purpose. Keeping a large cash reserve has some value, at least.

Defensive structures are very often of questionable value unless you know the location is likely to be attacked, and so many players don't build them. Increasing the maintenance cost for a unit of questionable value makes the player less likely to build it, not more likely to build it. If defensive structures had the same cost and upkeep as mobile units (which can be used for both offense and defense), there would be no reason to ever build them.

orvarth
Posts: 19
Joined: Tue Aug 01, 2017 12:06 pm

Re: The economy, stupid

Postby orvarth » Fri Sep 21, 2018 6:42 pm

perhaps you should remove money from the game and develope influence :

ship maintenance with metal

mercenary maintenance with influence .

influence come from treaties/market/population .

phidi bonus in market and treaties , yoral strength in population , a bio race could be dependent only on food like tinker for metal , food and metal use in trading influence .

zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: The economy, stupid

Postby zolobolo » Sat Sep 22, 2018 8:54 am

Arioch wrote:Decreasing the cash surplus of the AI is not a benefit by itself. Getting the AI to spend its surplus on something useful would be a benefit, but simply removing the cash doesn't serve any purpose. Keeping a large cash reserve has some value, at least.

Agreed, generaly it would be optimal to have the AI play according to the same rules like a human does - I have seen a +5-8 coin per planet bonus for AIs that does not seem to be needed anymore though.

When they get stuck that is not due to coin shortage like seen below: they have the colony ship, have market tech and bountiful planets direct next to them: this seems like an expansion logic issue - once they get rolling, they are swimming in coin though as reported by some users already so they have no need for bonuses: In my last game I had a tinker enemy empire that was 3X the size of mine including fleet power. I have purged their planets directly (exploit) instead of confronting the fleets and even after they have lost 2/3 of their planets, they were still making good money while still meaintining that huge fleet. An AI empire on the roll does not seem to be able to get into a tight financial situation currently even in such extreeme circumstances: this is not necesseraly something you want as the player is expecting the enemy to adhere to the same rules as they are (even if this is not entirely true). The occasonal unexplained ship decomissioning of the enemy due to budget can be dealt with message to the player: "Our pitiful enemy: The XY has managed its finances so poorly that they are forced to decomission: n ships. Victory wil lbe ours soon just whach out for that bottom line - Phidi advisor!"

Arioch wrote:Defensive structures are very often of questionable value unless you know the location is likely to be attacked, and so many players don't build them. Increasing the maintenance cost for a unit of questionable value makes the player less likely to build it, not more likely to build it. If defensive structures had the same cost and upkeep as mobile units (which can be used for both offense and defense), there would be no reason to ever build them.

I don't know abouth other players, but I always build a few on default settings: this is due to the amount of habitable systems within range which leads to pretty well calculatable chokepoints on the map untill late game.

Now that we have a location lets see an example of value comparing Human Light cruiser to Starbase:
LC - Starbase
Cost: 540/320 - 400/800
Attack: 240 - 506
Defense: 90/50/240 - 460/200/480
Upkeep: 2 - 0

We can agree for the above that it would take at least 3-4 Human Light Cruisers to stand a chance against a starbase of equal tech level
From the costs we can thus determine that a starbase is a no-brainer investment as it is wastly faster to produce, costs less metal, and does not have upkeep costs. Yes the base is not mobile, but if the enemy cannot stop the player invasion, the newly conquered planets make up for the lost of investment while on the other hand, they will be there to keep the enemy forces back if the war goes into the other direction

This of course does not consider heavy weapons as they basically nullify the starbase value. These do not generally pop up though untill well into the mid game from whereon starbases do loose value rapidly of course

In my opinion, starbases need to be pushed well back into planetary defense range and all defending ships should start next to them and not in front of them: this way PD and star bases would have a strong synergy, their costs can remain and should recieve a upkeep cost to offset the huge bonus from the synergy. Currently, the AI benefits very litle from starbases as they rush their ships ahead and are not familiar with the heavy weapon range exploit
Attachments
Why not expanding.PNG
Why not expanding.PNG (947.04 KiB) Viewed 20754 times

User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: The economy, stupid

Postby harpy eagle » Mon Nov 05, 2018 4:08 pm

onomastikon wrote:I've let a game run on for as long as possible, and I've noticed that NONE of the AI factions ever, ever has any metal and ever, ever has any use for its tons of superfluous money. Even the poorest AI factions on the brink of extinction have huge sums of cash and, apparently, cannot figure out how to spend them.
Certainly the AI will run into the same problems that the human player has, namely, there is not enough metal, no matter what you do, to use the production hammers you have to produce the things you want which require metal, which is basically everything.


Coming across this thread is really amusing for me, because I ran into the exact same problem myself and went about solving them around half a year ago :P

Solving this problem with how the AI mismanages its metal economy was in fact the initial goal of the economy AI overhaul I worked on a while back.

The main cause of the problem was twofold:

1. Above all the other causes, the primary problem was with how the AI chose what ships to build. The economy AI would look at all the available designs and choose the most expensive one to build. If you think about it, it's kind of an anti-optimal strategy.

2. The AI had no awareness of metal as a distinct resource from industrial production (hammers). The AI was evaluating the build cost of ships by using hammer cost + metal cost. This is a grave mistake for the AI, as the two are not interchangeable and cannot simply be added.

I was able to correct both issues by recognizing that the fundamental resource that underlies both hammer and metal income is time. Hammer and metal income by itself has no intrinsic value, and the hammer and metal cost of ships are only meaningful to the extent that they bottleneck our ship production.

Anyways, there were two conclusions:

In the case of (1), we recognize that we want to build up our military power as fast as possible, whether it is because we want to replenish our losses, catch up to rivals, or maintain superiority. In all cases we benefit from building the ships that have the greatest combat power/cost, NOT cost!

In the case of (2). As mentioned above, hammers and metals have no intrinsic value by themselves. Therefore, the "cost" in the "combat power/cost" metric we developed above must be specified in terms of build time. Again, time is the fundamental resource that allows us to unify hammer and metal cost.

There's a third point, that was also needed to really solve the issue: If, due to limited metal income, we can build at most 10 ships in 10 turns, we don't want to be building them on 10 separate planets if it will take the same amount of time to build them on 2 or 3. The other 7 planets can then be freed up to e.g. build improvements, or use e.g. research/trade/mining focuses.

There were also several other improvements to the economy AI, but what I've mentioned here seemed sufficient to prevent the AI from strangling itself on metal shortages (in fact, I then had to deal with the AI being swamped with metals it wasn't utilizing :D).

However, I encourage you to check out the improved AI yourself and let me know what you think.

On Steam, you can access the testing branch using the code "alphatesting"


Return to “General Forum”

Who is online

Users browsing this forum: No registered users and 33 guests

cron