Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Topic started by: Alpha Centauri Bear on August 10, 2020, 06:08:31 PM

Title: AI improvement
Post by: Alpha Centauri Bear on August 10, 2020, 06:08:31 PM
Dedicated topic for generic AI improvement. I plan to implement it in WTP mod but, as usual, could be used by anybody.

AI improvement is endless topic. There is no plan to solve any particular problem right away here. Rather just collect some intelligence that helps us steering one way or another.

The two biggest problem with AI improvement is that is it:
a) is very time consuming which is obvious for anyone who ever tried to something like that in production.
b) is uncertain. Each change can be implemented in many ways, there is no clarity whether some particular change is actually good one, a lot of play testing is required.

The a) above is why I generally try to avoid or minimize this work. However, it seems that Thinker + WTP is not challenging enough. Meaning that as in vanilla it is easy to learn AI patterns and exploit them.

Fortunately, AI is allowed to cheat heavily as long as it is not perceived unfair to human player. There are a lot of corners could be cut by cheating and this is good as there is no need to implement some complex algorithms for everything. There is no need to make AI actually to think as human in every aspect.

Therefore, the first question is whether it makes sense to just increase amount of cheating AI already has to elevate challenge? For example, currently human growth and production cost factor is 10 and AI's one is 7 at toughest difficulty. Would it make sense to increase this gap even more?  Lowering cost factor for AI has it's limitation. It is risky to go below 5-6 probably. We can just increase human cost factor instead up to 11-12 or something. Clearly, this is a very stupid bonus that doesn't make AI appear in any way smarter, just stronger. So it is still possible to outgrow it just takes longer. We should not discard it outright because it is how it was made in vanilla and it seemed to worked to some extent so far. The great benefit of this approach is it's implementation ease. It is already in thinker.ini. Please share your opinion on that.

Another approach is to take it slowly - one modification at a time. Like the one I did in my previous versions:
# Version 94
* AI tries to kill spore launcher near their bases.
It seems like a exceptionally valid approach for fun made mod format when nobody has lots of time to spend on it. It also has a great value since it is naturally easy to understand what AI does wrong in their patterns. Like when player feels it doesn't counterattack them much and that allows them to assault bases easier. Then we can tune this particular behavior and give user an impression that something changed to the better! 😂

I recall one my first experience with Thinker when I was moving my severely damaged worm to reinforce my base assault forces and I was about to heal it on the monolith along the way that was sticking out of the ground about 6 tiles away from that enemy base. And before I could heal it that same enemy base dispatched a unity chopper and killed my worm. I was shocked to the level I needed some time to accept and process such villainy. That probably was one of the things that kept me going with Thinker and later build my own on top of it.
Title: Re: AI improvement
Post by: bvanevery on August 10, 2020, 06:46:52 PM
When attacking AI problems, I believe in attacking low hanging fruit first.  This is why I've spent 2 1/3 years working on SMACX AI Growth mod, and have never hacked the binary at all.  Iteration is the devil.  The game is like a fine woven mesh where when you pull one string, other things happen.  Only ongoing playtesting makes it clear to the designer, what specifically needs to be fixed.

The AI running itself out of SUPPORT, was the severest problem clearly needing to be fixed.  I managed to mitigate it with a combo of changing the SE choices, removing faction penalties, making Clean Reactor available from turn 1, and making a number of predefined units.  It took a lot of iterations to determine what predefined units the AI would and wouldn't build in practice, and what units were and weren't helpful.  In particular, units that were helpful earlier in the game, became liabilities later in the game.  Mainly because they were still Fission units in a Fusion era.

If I were a binary modder, I'd be using Scient's patch to make predefined units with different reactors in different eras.  I'd also go into the code itself, find the place where the AI is making stupid decisions about SUPPORT, and fix it.  It would clearly have a big payoff for the game, and would obviate the need for my Clean Reactor hack.  But hey, I got the job mostly done without any binary modding at all.  That's the principle of low hanging fruit.

I don't believe in giving AIs more resources and no more intelligence.  I've played dozens of games like that over the years, and my conclusion is that approach sucks.  It's what frustrated programmers do because they don't know what to do, and don't want to spend the effort on a real solution.  I agree that the latter is hard, and the only "high hanging fruit" approach I'm ever personally going to take, is to make a brand new commercial game that I sell and get paid for.  Because the problem is that hard, and I've wasted my life on plenty of hard technical problems in the past, that I never got paid a dime for.  At some point, an endeavor has no basic sustainability, and can make you 50 years old before you know it.  While living out of a car, lol.  Don't do it.

So my advice is: identify a clear and obvious problem.  Fix it.  Iterate and test.  Don't be in a hurry to screw with things.  See what the results are like in the field.

There's also an important demographic question: hard to who?  I got into an acerbic argument with someone on r/alphacentauri the other day.  I was shocked that after playing the stock game for 15 years, they were still challenged by it.  WTF?  My lines of inquiry, insulted their intelligence, and they weren't terribly forthcoming about how they actually play the game.  I accused them of being a "sandboxer", someone who actually isn't interested in winning the game or doing especially well at it, but just likes to move all the terraforming toys around and so forth.  I actually didn't elaborate on that, but that's what I meant.  There are people who play games, and there are people who play with software toys.  I think I ran into one of the latter, but at this point, I can't prove it, because I pissed them off.  This person completely violated my expectations as a designer, that an experienced player "needs more challenge".  Well that's not true for somebody out there.

So do I need more challenge?  And what challenge do I need?

I'm not kicking the snot out of SMACX AI Growth mod lately.  I mean, I always will win if I persist, but I definitely have to exert effort and am not chewing the game up immediately.  Is that good enough for a lot of players in the real world out there?  I have no real data on this.  I get anecdotal responses from a few people that yes, I have improved the challenge level of the game and it is now less stale for them.  Is that good enough?  What would make me think it is not good enough, especially since I'm not getting paid to do any of this?

I continue to play the game and have not completely lost interest in it.  This is remarkable.  I feel like there's something I still want to know about what's going on.  I also seriously doubt there's anything better out there.  I believe I'd have to make it, and I haven't managed that yet.  I'm in a sort of never-ending "pre-development contemplation" on that.

I wonder if my play style bias, makes SMACX AI Growth mod seem harder to me than it really is.  I'm waiting to get the field report from someone, where they blew through the game like it was standing still.  Considering the number of exploit loopholes I've closed, like well, all of the stuff Thinker Mod loves so much, who knows maybe my mod is not cakewalkable now?  But I don't really know.  Not enough field reports.
Title: Re: AI improvement
Post by: Alpha Centauri Bear on August 10, 2020, 07:25:42 PM
I don't think the exact level of toughness matter. That is why there are difficulty levels so everybody can find their own comfortable level. Our AI improvement efforts are irrelevant for those not yet reached the toughest level. It does for others. We will just extend the toughest level to be tougher while everybody will still find their comfortable niche between very easy and very hard.
Title: Re: AI improvement
Post by: bvanevery on August 10, 2020, 08:17:22 PM
But how many people need AI stronger than Transcend?  You do, I do, Induktio does... I just don't have a lot of information from players in the field, of what they think's wrong with the game.  Not all of my modding has been directed towards AI improvement, it has also been directed at "irritances".  I've smoothed out what I could.  That seems to have been noticed by some people.

The game industry in general has a problem that "better AI" is difficult to monetize.  There don't seem to be enough paying customers to justify the effort.

One can do anything one wants as a matter of personal ambition.  But there's a point at which it's not sustainable anymore.  Hence it is wise to pursue "low hanging fruit".
Title: Re: AI improvement
Post by: Alpha Centauri Bear on August 10, 2020, 08:40:08 PM
Err, everybody on this forum? 😉
The same exact people are giving me pointers about what is wrong with AI including you. I've already collected a huge amount of them. Some small number even implemented already. I agree that when this forum dies my mod will die with it. I'll switch doing something else.

Update. The mod will die it terms of continuous development. I will still enjoy playing it myself.
Title: Re: AI improvement
Post by: Nevill on August 11, 2020, 10:02:14 AM
Less philosophizing, more reporting.  ::)
Another approach is to take it slowly - one modification at a time. Like the one I did in my previous versions:
# Version 94
* AI tries to kill spore launcher near their bases.
It seems like a exceptionally valid approach for fun made mod format when nobody has lots of time to spend on it. It also has a great value since it is naturally easy to understand what AI does wrong in their patterns.
1) AI doesn't protect its bases enough. By which I mean a secret project base in the 2200s can be defended by a lone Synthmetal garrison. During a vendetta. On an exposed frontier base.

You can stack defensive bonuses however high you want, but you can't multiply 2-3 armor by enough modifiers to pose a challenge when there are 10+ weapons in play.

Possible solution: teach AI how to upgrade units, or reevaluate its defences once every few years, especially on bases that warrant such an approach (frontier bases, developed bases, Secret Project sites). I read that some code is already in place to make them evaluate how much the base needs protection, but it clearly isn't working too well.

2) AI tends to waste their support minerals on by building useless units. Gaians protecting their bases with scout patrols that crumple like a house of cards, Miriam building a bunch of synthmetal defenders and never touching them again for the next 50 years, checking off some "I have protection" checkbox that doesn't really apply. They just eat minerals and contribute nothing.

Possible Solution: teach AI to build clean units; make Clean Reactor available early and free/cheap for purely defensive units. It would still take an ability slot.

3) AI is poor at handling drones; doesn't know how to use Police well. You can observe it by giving an AI faction a -TALENT debuff, or free Genejacks, and watch it choke as it can't handle the first citizen being a drone, even if a unit inside the base would fix that.

4) AI is very poor at using air units that aren't suicide bombers (rockets). I don't know how to fix that. For some reason they really prefer Interceptors over regular units, even when those have a -50% debuff.

5) AI builds lots of transports and then... makes them just sit there on bases? What is up with that? Pre-thinker AI had some kind of bug that made them build a ridiculous amount of transports they didn't use.

6) AI research is very uneven. They do well in the early game up until tiers 4-5, and then forget to prioritize energy, have nothing to work with as a result, and research a new tech once every 30 years (not helped by them favoring Fundie when they are at war, and they go to war ALL THE TIME). Trying to fix that by lowering techcosts for AIs results in Zakharov getting ridiculous, as his Network Nodes, SE choices and already reduced techcosts make him an outlier that is the only one who can compete with the player. I've read that the code has AI put different priorities on resources at different stages of the game, but I think a focus on energy needs to happen sooner.

I've tried a few games in the scenario editor where I gave AI factions free orbital transmitters, resulting in them getting more energy the further the game got. The boost was a bit too much, but it was the only thing I could think of when they just wouldn't farm energy by themselves.
Title: Re: AI improvement
Post by: Alpha Centauri Bear on August 11, 2020, 06:26:15 PM
Thank you, man. You are, as always, the practical one.

1) AI doesn't protect its bases enough.

That is a well known one. Unfortunately, not an isolated fix. As you said it requires evaluation tuning.

2) AI tends to waste their support minerals on by building useless units.

Possible Solution: teach AI to build clean units; make Clean Reactor available early and free/cheap for purely defensive units. It would still take an ability slot.

I wouldn't say they are 100% useless just less useful than other possible alternatives. Same thing here: evaluation tuning.

Clean reactor solution is more of a cheat to make existing AI performing better, not AI enhancement by itself. Plausible solution but it doesn't change situation drastically - doesn't make AI smarter.

3) AI is poor at handling drones; doesn't know how to use Police well. You can observe it by giving an AI faction a -TALENT debuff, or free Genejacks, and watch it choke as it can't handle the first citizen being a drone, even if a unit inside the base would fix that.

Interesting. Cannot say anything on that as I didn't observe it myself. Is this for the first citizen only or for any drones in any base size? Does AI completely ignore drone facilities?

4) AI is very poor at using air units that aren't suicide bombers (rockets). I don't know how to fix that. For some reason they really prefer Interceptors over regular units, even when those have a -50% debuff.

Really? What is this "prefer" percentage in practice? I never noticed this myself. I guess one can get this perception because in vanilla AI tends to place air assaulters next to front line (for obvious reason) and they quite often die on runways due to enemy massive air strikes. So they are left with bunch of interceptors those are capable to defend themselves even on a runway and don't easily lose to air assault.

5) AI builds lots of transports and then... makes them just sit there on bases? What is up with that? Pre-thinker AI had some kind of bug that made them build a ridiculous amount of transports they didn't use.

That I've noticed too. Although, I am not sure if this is vanilla or Thinker as it overrides all unit movement.

6) AI research is very uneven. They do well in the early game up until tiers 4-5, and then forget to prioritize energy, have nothing to work with as a result, and research a new tech once every 30 years (not helped by them favoring Fundie when they are at war, and they go to war ALL THE TIME). Trying to fix that by lowering techcosts for AIs results in Zakharov getting ridiculous, as his Network Nodes, SE choices and already reduced techcosts make him an outlier that is the only one who can compete with the player. I've read that the code has AI put different priorities on resources at different stages of the game, but I think a focus on energy needs to happen sooner.

This is quite a compounded problem and I am not sure the wrong research priorities are even part of it. AI does not change their research priorities!
In WTP AI tech cost is lower on higher difficulties. And AI terraforms like crazy - a lot of boreholes and mirrors. I don't think they are behind in the energy intake with similar number of bases. Need some example play tests to illustrate this problem.
I also don't remember overtaking AI (at least by much) in technologies. Meaning any developed enough faction regardless of their RESEARCH inclination.
You can also see yourself overtaking them due to your exemplary play skill. Which is fine but don't constitute an inherent AI flaw that we can target.
Title: Re: AI improvement
Post by: dino on August 11, 2020, 11:22:59 PM
Remember how you increased native life activity, so the player is forced to waste some more minerals on production and support of units in the early game ?

This kind of pressure should be extended to the whole game, player can safely play builder game with almost no army until he is ready to take on AI.
All it takes to buy few dozens of turns to prepare for a war with threatening AI, while heaving no army is to avoid contact and appease them with few techs.

My idea:
1) Calculate ratios of military power score ( probably the score used to determine mil ranking on the info screen would be fine ) of player vs all AI factions.
2) If the score ratio is higher than 3:1, AI is neighbouring the player and is not in pact, it should immidiately pronounce vendetta.
3) If in vendetta, any diplomacy should be refused by the AI until the ratio drops to 2:1, once it drops to 2:1 this feature should stop overriding diplomacy code.

The ratio that makes AI attack unconditionally could be adjustable in the ini file.

Some modifiers could also be used, for example:
+1 , 0 , -0.5 based on ai_fight (1,0,-1),
-0.5 if player runs ideologicaly opposite policy,
+1 if player runs ideologically compatible policy,
+0.5 if peace treaty,

This way the player wouldn't be allowed to buildup for 100 turns with no army, while AIs are wasting resources on units production and support.
Title: Re: AI improvement
Post by: EmpathCrawler on August 11, 2020, 11:59:27 PM
I agree with bvanevery that support mismanagement is a big problem for the AI. It's probably why that particular support system was abandoned in later Civ games. If they could understand to disband fission synthmetal sentinels clogging their bases it would be a big improvement.


Another big one is diplomacy, which induktio has touched upon a while ago. The AI is far too ideological and aggressive. A tiny faction should not declare suicidal vendettas because of social engineering disagreements, nor should a single faction be allowed to soar ahead on the power graph without the others putting aside their differences and forming a coalition.


Pessimistically I'm not sure if there's a point in trying to squeeze out a lot of AI performance due to crawlers. A human is always going to exploit crawlers far more efficiently than the AI. Once you hit Industrial Automation, there isn't much the AI can do about it if you go nuts.
Title: Re: AI improvement
Post by: Alpha Centauri Bear on August 12, 2020, 01:01:19 AM
I agree that AI vendetta timing is even more appalling than its combat tactics. There is lots and lots of tuning to do. I disagree, though, with some rigid simple parameters. They constitute an easy learnable pattern that human can recognize and exploit. That just replaces vanilla pattern with different one.

I have in mind some flexible response that is beneficial to AI and less player centrist. Meaning it should attack as soon as it sees benefits of it taking everything into account: own allies, opponent allies, economical/technical/military advantage, faction bonuses, available SE, etc. I don't think I will be able to implement this all at once but maybe by adding each factor one by one.

Some things I have in mind:

Evaluate comparative strength every turn. Mostly as you proposed but accounting for as many things as possible: pacts, technologies, economics, faction bonuses. Again, most likely one thing at a time.

Production priorities, of course. Emphasizing on units if needed.

Place combat units smart even at peace time. Meaning more on a border. Also both defenders and attackers.

Attack neighbor if they are significantly weaker. Otherwise strengthen borders, make pact with other factions. Stop useless wars.
Title: Re: AI improvement
Post by: Alpha Centauri Bear on August 12, 2020, 01:05:15 AM
Another big one is diplomacy, which induktio has touched upon a while ago. The AI is far too ideological and aggressive. A tiny faction should not declare suicidal vendettas because of social engineering disagreements, nor should a single faction be allowed to soar ahead on the power graph without the others putting aside their differences and forming a coalition.

There is an optimal behavior and there is purposefully imbalanced one to emphasize AI leader personalities. I think it worth keeping SE preferences as is just mix it out with more practical things like comparable military strength as well. Otherwise, if we optimize AI completely we will lost the lore of leader personalities.
Title: Re: AI improvement
Post by: dino on August 12, 2020, 04:45:25 AM
> I disagree, though, with some rigid simple parameters.

Even if it was predictable it would force the player into dedicating resources into defence and slow his development significantly.
I've only proposed the lowest possible effort version, if you would want to put more work and naunce into it, it's of course only for the better.
The bottom line is, the player shouldn't be allowed to play pure builder game unperturbed, the weakness should be exploited.
Title: Re: AI improvement
Post by: Nevill on August 12, 2020, 08:08:55 AM
Quote
Clean reactor solution is more of a cheat to make existing AI performing better, not AI enhancement by itself. Plausible solution but it doesn't change situation drastically - doesn't make AI smarter.
AI can't deal with SUPPORT. It has cheat-tier INDUSTRY to compensate for it though, but not even churning units 50% faster than a player can help it if it has no minerals to build with. Ultimately, it's a quick hack to enable already existing hacks to work properly.

Trying to make AI rehome units to less-strained bases would just lead to lots of pointless movements, and it will never learn using "military bases" that exist solely for the purpose of support to free other bases from it. In fact, if it ever tries to use them, it can be exploited by the players by creating support overload and causing units to disband.

(also, I hate the disband mechanics with a passion... after capturing a base its units are assigned to the nearest bases, which could cause one to lose an army without a fight by losing several bases those units were assigned to. They get reassigned to other bases that can't support them, and then disband at the beginning of the turn, without the player's input)

Quote
Interesting. Cannot say anything on that as I didn't observe it myself. Is this for the first citizen only or for any drones in any base size? Does AI completely ignore drone facilities?
This is an illustration. The first citizen could be easily suppressed by a police unit, allowing them to build a more permanent arrangement. They go for building RecCommons on a base that riots half the time instead, and turn its sole worker into a Doctor.

Any use of Police is completely incidental. They never switch to gathering energy on purpose to put into Psych, preferring to brute force the problem with specialists. Most drone control is done via direct suppression facilities (RecCommont, Holo Tanks) and basic specialists for when they are not enough.

Quote
Really? What is this "prefer" percentage in practice?
I barely see regular aircraft built... or used when they do build them. The <SAM> units are more common.

Quote
This is quite a compounded problem and I am not sure the wrong research priorities are even part of it. AI does not change their research priorities!
Not research priorities, but resource gathering priorities. I've read the AI prioritizes nutrients in the beginning, minerals towards midgame, and energy in the lategame, though I obviously didn't look at the code to verify that.
Title: Re: AI improvement
Post by: EmpathCrawler on August 12, 2020, 01:13:56 PM
Another big one is diplomacy, which induktio has touched upon a while ago. The AI is far too ideological and aggressive. A tiny faction should not declare suicidal vendettas because of social engineering disagreements, nor should a single faction be allowed to soar ahead on the power graph without the others putting aside their differences and forming a coalition.

There is an optimal behavior and there is purposefully imbalanced one to emphasize AI leader personalities. I think it worth keeping SE preferences as is just mix it out with more practical things like comparable military strength as well. Otherwise, if we optimize AI completely we will lost the lore of leader personalities.


They should keep their personality, but they should also recognize that the fate of their ideology is at stake if they take absurd risks.

I wonder if the AI is getting compelled to interact with the players and other factions when their units encounter each other. That seems to be a trigger. If I'm an AI Gaian and I have 2 bases next door to a sprawling human Morgan, it makes more sense for me to refuse to communicate with Morgan at every chance but try to communicate with Morgan's enemies and suck up to them. It would force the human to take a reputation hit by attacking me if they really want me gone.
Title: Re: AI improvement
Post by: EmpathCrawler on August 12, 2020, 01:15:03 PM

(also, I hate the disband mechanics with a passion... after capturing a base its units are assigned to the nearest bases, which could cause one to lose an army without a fight by losing several bases those units were assigned to. They get reassigned to other bases that can't support them, and then disband at the beginning of the turn, without the player's input)



Love it when my "ally" gifts me a ton of impact rovers during one turn and then my support gets completely [messed up - or loved very much] at whatever base they were nearest to.  ::)
Title: Re: AI improvement
Post by: Alpha Centauri Bear on August 12, 2020, 01:27:37 PM
> I disagree, though, with some rigid simple parameters.

Even if it was predictable it would force the player into dedicating resources into defence and slow his development significantly.
I've only proposed the lowest possible effort version, if you would want to put more work and naunce into it, it's of course only for the better.
The bottom line is, the player shouldn't be allowed to play pure builder game unperturbed, the weakness should be exploited.

Sorry, it sounded too negatively. I didn't mean to reject it completely. Yes, you are right. We can start with something and then keep tuning it.
Title: Re: AI improvement
Post by: Alpha Centauri Bear on August 12, 2020, 01:30:02 PM
Quote
Clean reactor solution is more of a cheat to make existing AI performing better, not AI enhancement by itself. Plausible solution but it doesn't change situation drastically - doesn't make AI smarter.
AI can't deal with SUPPORT. It has cheat-tier INDUSTRY to compensate for it though, but not even churning units 50% faster than a player can help it if it has no minerals to build with. Ultimately, it's a quick hack to enable already existing hacks to work properly.

That is right again. I shouldn't discard it right away.

From the other side, wouldn't it be too much to give AI all clean units? Wouldn't it keep stamping units infinitely then?
Title: Re: AI improvement
Post by: Alpha Centauri Bear on August 12, 2020, 01:32:53 PM
(also, I hate the disband mechanics with a passion... after capturing a base its units are assigned to the nearest bases, which could cause one to lose an army without a fight by losing several bases those units were assigned to. They get reassigned to other bases that can't support them, and then disband at the beginning of the turn, without the player's input)

I thought about home reassignment at the beginning of each turn for AI. Should fix this particular problem. It is not even AI improvement just a fix for mechanics simplification.
Title: Re: AI improvement
Post by: Alpha Centauri Bear on August 12, 2020, 01:38:37 PM
Quote
Interesting. Cannot say anything on that as I didn't observe it myself. Is this for the first citizen only or for any drones in any base size? Does AI completely ignore drone facilities?
This is an illustration. The first citizen could be easily suppressed by a police unit, allowing them to build a more permanent arrangement. They go for building RecCommons on a base that riots half the time instead, and turn its sole worker into a Doctor.

Any use of Police is completely incidental. They never switch to gathering energy on purpose to put into Psych, preferring to brute force the problem with specialists. Most drone control is done via direct suppression facilities (RecCommont, Holo Tanks) and basic specialists for when they are not enough.

So AI doesn't "plan" for police usage. Got it. Thank you for explanation.
Title: Re: AI improvement
Post by: Alpha Centauri Bear on August 12, 2020, 01:42:07 PM
Not research priorities, but resource gathering priorities. I've read the AI prioritizes nutrients in the beginning, minerals towards midgame, and energy in the lategame, though I obviously didn't look at the code to verify that.

Ah, you mean workers placement to specific tiles? As far as I can tell there are two types: one for Discovery where it prefers energy over minerals and one for other governors where it prefers minerals over energy. The energy over minerals type also obviously maximizes nutrients also.
Title: Re: AI improvement
Post by: Tayta Malikai on August 12, 2020, 02:07:18 PM
Quote
Clean reactor solution is more of a cheat to make existing AI performing better, not AI enhancement by itself. Plausible solution but it doesn't change situation drastically - doesn't make AI smarter.
AI can't deal with SUPPORT. It has cheat-tier INDUSTRY to compensate for it though, but not even churning units 50% faster than a player can help it if it has no minerals to build with. Ultimately, it's a quick hack to enable already existing hacks to work properly.

That is right again. I shouldn't discard it right away.

From the other side, wouldn't it be too much to give AI all clean units? Wouldn't it keep stamping units infinitely then?
Is this implying that it would be possible to modify the game to exempt AI factions from support mechanics? It might sound radical, but the AI has serious problems choking itself with units it doesn't know how to use properly, so if that's what it takes to get around this issue...

In any case, the AI already relies on quantity of production to pose a challenge to the player, so I don't see that it would cause any real issues.

Nevill's mod made Clean Reactor available from the start with a cost factor of -2 (increases with weapon value), so purely defensive units could equip it for free. I found it to be a very agreeable change: you'd still be obliged to use support minerals to sustain an invasion force, but being able to quickly explore the map and deploy garrisons in the era of 3 minerals per base lets you consolidate quickly and better hedge against worm attacks. Since it still takes an ability slot, and 2 abilities per unit gets delayed to tier 5, you also still have to pay support costs for police and trance units, which is a reasonable tradeoff to make.

The only issue is, as Nevill said, the AI doesn't know to take advantage of this. But that could presumably be fixed, if deemed worth the effort.

MercantileInterest's Binary Dawn doesn't go quite that far, only making the preset Scout Patrols come with Clean Reactors (which players agree not to reverse-engineer for other units). I haven't played it myself, but AFAICT, it has no significant imbalancing effect on the game. Players are not going to rely on scouts for defense in any serious war anyway.
Title: Re: AI improvement
Post by: Nevill on August 12, 2020, 02:47:33 PM
Quote
Is this implying that it would be possible to modify the game to exempt AI factions from support mechanics?
I would add that I experimented with having separate faction files for AIs and humans, and that I gave AIs FREEABIL, Clean, which is essentially this.

It did make them build tons of clean units except for formers and pre-designed units that were not clean, but I found it to be an improvement. At least those synthmetal hordes didn't kill off AI production, and eventually it would amass a force, go to war, and kill off the weaker designs, forcing it to rebuild the army with newer specs.

Miriam would end up with 100+ combat units and devastating everyone except Yang whose AI made him build 200+ combat units. :D

I also experimented with faction aggression and Conquer/Build/Discover/Explore values, but as I didn't have access to the code it was all empirical. Pacifist factions didn't fare well, and that is as much as I remember.
Title: Re: AI improvement
Post by: Alpha Centauri Bear on August 12, 2020, 03:49:06 PM
Yea. Need to ponder how to make is nicely and not overdo it. All clean combat units would certainly favor military factions, though.
Title: Re: AI improvement
Post by: lolada on August 31, 2020, 12:46:46 PM
Regarding difficulty, Trascend is plenty hard in WTP for longest duration so i think thats in good place. Vanilla Transcend is often already useless with Needlejet tech for example.

I like bvanevery approach - identify single large important problem and fix it.

1. SUPPORT - AI killing itself with no minerals - its very important issue and if fixed it would be noticable

Some solutions: for example people reported that AI plays much better if gifted +2 default SUPPORT. That won't fix lategame maddnes, i've seen AIs go 10+ units into minus. One could try to code AI not to go over x amount of minerals in minus or just give extra support for large bases.

2. Terrain improvement - terraforming and fungus - AI used to destroy itself in WTP with fungus. I see that Fungicide formers are now free upgrade - thats great. Maybe, if not already in game, AI should rebuild its formers to always have at least 1 per base. Then ecology fix need to be put in place - I've seen free minerals were increased to 24 thats good. And we have new terraforming AI. This means this problem might be fixed now - but if not, one could iterate over it because its really important

3. Third large issue is production queue / choice - AI does not build some relevant facilities in time or ever. They skip drone quelling facilities, while I as player put great importance to them. Any resource boosting facilities are very important for example. AI tended to ignore Tree farm even with huge eco problems. One thing to note as well - AI should recognize when it lost the facitilies (to worms usually) and rebuild it. I think this happens more often than we think and then late AI can have pathetic bases even if they are large in size.
Title: Re: AI improvement
Post by: Alpha Centauri Bear on August 31, 2020, 07:39:46 PM
1. SUPPORT - AI killing itself with no minerals - its very important issue and if fixed it would be noticable

Some solutions: for example people reported that AI plays much better if gifted +2 default SUPPORT. That won't fix lategame maddnes, i've seen AIs go 10+ units into minus. One could try to code AI not to go over x amount of minerals in minus or just give extra support for large bases.

I guess the problem with AI units is not that bases cannot support required number of units but that units are wandered aimlessly upon building and eating support for nothing. While AI keeps building them over and over. So the real solution would be to teach AI to 1) use unit effectively - throw attack units in battle as soon as possible or disband them at peace time, 2) to no overproduce them if there is no need for them. Easy say than do, though. 😁

Fiddling with support won't help if they keep and keep producing units. They will either suffocate from oversupport or, if we give them all free units, they will grow their armies out of proportion. Although, the latter one is not that bad for AI to be able to defend themselves, though. Could work as an ugly temporary fix.

2. Terrain improvement - terraforming and fungus - AI used to destroy itself in WTP with fungus. I see that Fungicide formers are now free upgrade - thats great. Maybe, if not already in game, AI should rebuild its formers to always have at least 1 per base. Then ecology fix need to be put in place - I've seen free minerals were increased to 24 thats good. And we have new terraforming AI. This means this problem might be fixed now - but if not, one could iterate over it because its really important

You mean fungus pops? They are happening to everybody. Overall, AI is pretty good with terraforming as long as it has decent production to build formers. Every time I struggle with as fast terraforming as possible, they do it even faster and cover their whole territory with mirrors and boreholes. If fungal pop happens to AI at the same frequency as to human, they should not have problem dealing with them and reterraform fungus in time. So, I guess, the question here is again in AI inability to handle ecodamage on all levels which results in overly excessive number of pops overwhelming their terraforming capacity. They should limit their bases mineral output as well as build eco facilities. Again, this is an AI production tuning which I didn't touch yet.

3. Third large issue is production queue / choice - AI does not build some relevant facilities in time or ever. They skip drone quelling facilities, while I as player put great importance to them. Any resource boosting facilities are very important for example. AI tended to ignore Tree farm even with huge eco problems. One thing to note as well - AI should recognize when it lost the facitilies (to worms usually) and rebuild it. I think this happens more often than we think and then late AI can have pathetic bases even if they are large in size.

Exactly! See my response to your point #2.

Summary

All the above require tweaking 1) production priorities, 2) prototyping, 3) units handling. Thinker somehow touched these subjects, which is an improvement to vanilla, but as far as I see, not that deeply. Out of these two the first one is much easier to do - just select from limited list of available production items. Unit handling is a huge work. A lot of coordination between units and there is an easy way to make things worse. I cannot even imagine how to do it incrementally - meaning do just one single aspect without touching others, etc.

AI modification goes beyond WTP scope. I don't absolutely mind doing it. This is fun in general. Unfortunately, it doesn't fit into my free time slots nicely. I can do programming and if someone can help me out with design/algorithms and testing/tuning, that would speed up things quite a lot.
Title: Re: AI improvement
Post by: bvanevery on September 01, 2020, 06:05:45 AM
I cannot even imagine how to do it incrementally - meaning do just one single aspect without touching others, etc.

Stare hard at OpenSMACX sources for awhile.  See if anything is identifiable as separable.  Talk to Scient about what might be separable.

Trying to go at this straight in the binary, is production suicide.  That's why I've never undertaken it, and keep saying I'll put the effort into writing a brand new 4X game.  Scient has already "committed suicide".  So the important thing, going forwards in the future, is trying to leverage his work.
Title: Re: AI improvement
Post by: Alpha Centauri Bear on September 01, 2020, 03:11:16 PM
I cannot even imagine how to do it incrementally - meaning do just one single aspect without touching others, etc.

Stare hard at OpenSMACX sources for awhile.  See if anything is identifiable as separable.  Talk to Scient about what might be separable.

Trying to go at this straight in the binary, is production suicide.  That's why I've never undertaken it, and keep saying I'll put the effort into writing a brand new 4X game.  Scient has already "committed suicide".  So the important thing, going forwards in the future, is trying to leverage his work.

1. I don't have a lot of "awiles" to go about. 😁😟
2. Scent disassembled original game. He didn't modified it. I am in a constant contact with him as needed and used his findings quite a lot. Still takes some work to do it even with his help.
Title: Re: AI improvement
Post by: bvanevery on September 01, 2020, 07:04:15 PM
Of course it takes piles of work.  That's why I don't do it!  I'm going to put that kind of time into a new 4X game that can make me money.  My hope is that Scient's disassembly and presumed C-ification (? I've never looked at his code) provides a basis for modding.  Elbow grease of actually modding is left as an exercise to the reader.

I don't expect Induktio's codebase to be suited to the task of pulling out and dealing with these most thorny AI issues, because as you said, he didn't address the things you want to address.  That leads me to believe it isn't easy to get to square one with such things.  But I've never stared at Thinker Mod code for longer than 3 seconds, so YMMV.

I am guessing that Scient is pursuing the long-term sustainable project and Induktio isn't.  From a strategic open source standpoint, it would make more sense if Induktio started migrating his work to OpenSMACX.  I mean if everyone has to be "Induktio smart and motivated" to do AI mods, nobody but Induktio is ever going to make progress banging on the AI.  There has to be a code base where people aren't dinking around with disassembly to get at the AI.
Title: Re: AI improvement
Post by: Alpha Centauri Bear on September 01, 2020, 09:49:30 PM
I am guessing that Scient is pursuing the long-term sustainable project and Induktio isn't.  From a strategic open source standpoint, it would make more sense if Induktio started migrating his work to OpenSMACX.

OpenSMACX is not operational.

I mean if everyone has to be "Induktio smart and motivated" to do AI mods, nobody but Induktio is ever going to make progress banging on the AI.  There has to be a code base where people aren't dinking around with disassembly to get at the AI.

I don't think it is that specific. Most of the people just don't bother with exe modding at all. I think I've seen and heard about 50 different text mods and only 3 exe (two of which are actually just patches). That's all there is.

And AI improvement is a completely different beast than patching stuff. Aside from disassembling one also need to introduce some new exceptionally convoluted algorithms which is about 100 times more difficult than any disassembling.
That is why I am calling for help as it seems to be exceptionally heavy burden just for single person fun project.
Title: Re: AI improvement
Post by: bvanevery on September 02, 2020, 03:57:15 AM
I'm playing right now with something called terranx_opensmacx_debug.exe, so something is operational.  Scient cooked this up at least for me, maybe for more purpose than that, I'm a little unclear.  Not sure how much OpenSMACX it is, but it's some kind of code injection.  What I actually get out of it, is saved games every 10 turns forever, and the 1st turn saved automatically without getting munged.  The hope is that having provided this "tripwire" system, one of these days I'm going to stumble on one of these "rarely surfacing" bugs and be able to report back what happened, for tracing and conquest.

Quote
I think I've seen and heard about 50 different text mods and only 3 exe

Well how many games need .exe mods?  And how many games are old enough, and need .exe mods, and are substantial enough games that have withstood the test of time, to be worth modding?  And have someone skilled enough in their communities, to have poured blood on the table to do it?

Quote
And AI improvement is a completely different beast than patching stuff.

Not completely different.  For instance, there's probably some simple formula somewhere that regulates SUPPORT decisions.  Or not-so-simple, but tractable as 1 routine that Scient may have pulled his hair out deconstructing.  Or could.  When those single points of control are identified, their formulae can be fixed.  These can have huge impacts on the game.  I mean my Clean Reactors hack demonstrates the power of such approaches without any programming at all, just changing the resource basis of a game.  Much can be done with adjusting formulas.

For all we know, forensically "combat stupidity" when attacking a city might be some bad weight somewhere.  Or sending all these units to mill in the hinterland.  It's possible to tell the AI to "Go fight this city!" in the diplomatic dialogues, a feature I haven't used since the stone ages.  Well what if there are intelligible function entry points for controlling that?

It's like, what's under the damn car's hood?  Maybe there's some doo dad sticking up (that's a technical term) and maybe there's gunk all over it.  You don't have to redesign a car to make it run better.
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 31 - 840KB. (show)
Queries used: 14.

[Show Queries]