To Break or Not to Break the AI, that is the question...

Discussion about the project in general, organization, website, or any other details that aren't directly about the game.
Post Reply
Message
Author
User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

To Break or Not to Break the AI, that is the question...

#1 Post by eleazar »

Now that we've achieved 0.4.2, it seems like there are two ways we could proceed.
  • A) Make content changes freely, then at some later date worry about bringing the AI up to speed.

    B) Coordinate changes with Dilvish to try to keep the AI continually competitive.
While it would be sad to see the AI get out of touch, i think the main concern is which method is the most efficient in the long run, like say a couple months. It may be useful to distinguish between changes that break the AI and changes that merely make it less competitive. Is there an easy way to tell the difference?

Thoughts?

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: To Break or Not to Break the AI, that is the question...

#2 Post by Dilvish »

With the long term in mind it's probably more effective to plow ahead with content changes, trying to do at least enough coordination for the AI to not be actually broken (which would probably impair testing) but not worrying about slowing down any content changes for the AI to try to keep up. 0.4.2 is enjoyable enough & a decent fallback if the AI winds up lagging & someone wants more of a challenge. I'll be resigned to all the comments about the AI handling all kinds of situations terribly :|
That approach will probably wind up being more efficient/effective for the AI in the long run as well.

As far as what would break the AI, mostly that's a matter of interface changes that can actually break it, but there is a little exposure on the content side. The biggest exposure that comes to mind would be changes in slots in the hulls used by the AI -- someday I'll get around to making that more flexible but not really soon. Even that I think would mostly just gimp them as opposed to outright breaking them (I have tried to make it resistant to outright breaking after having gone through a few rounds of that). I'll try to think more about what content changes might actually break it.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

gvdm
Space Floater
Posts: 43
Joined: Sun Nov 06, 2011 11:04 am

Re: To Break or Not to Break the AI, that is the question...

#3 Post by gvdm »

Is there any way to allow the AI to see the value of techs? IE, have the AI see that one tech provides 0.5 industry per pop and the other +5? And then some kind of weighting, ie, the AI compares its current industry and research and decides industry is lagging, hence researches industry improving techs. Or compares the state of its ships to the other enemy ships it knows of and tries to stay a tech level ahead or even.

Briefly looking at the code it would seem that instead of doing things like setting a list of techs manually the functions
primaryLearningTechsList, primaryGroTechsList etc could scan through all the techs and then pull out a sorted list of "best learning techs" and "growth techs"

This would make the AI slightly more resistant to content churn.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: To Break or Not to Break the AI, that is the question...

#4 Post by Dilvish »

gvdm wrote:Is there any way to allow the AI to see the value of techs? IE, have the AI see that one tech provides 0.5 industry per pop...
I've looked into it, I may get around to trying it sometime, but not right away, and it won't totally do away with the issue you're addressing. It would first require giving the AI access to EffectsGroups through the python interface (which would be fairly straightforward), and then code would have to be written for the AI to interpret the subset of Effects that we care about it understanding. As far as the actual Effects go, it would be easy to code the AI to understand the ones we most expect it to care about. But the Scope and Activation clauses in EffectsGroups can get very complex -- it would be a lot more work to get the AI to understand them & then to actually figure out what they would apply to in the current universe would require a great deal more computation, almost surely slowing down the AI beyond acceptability.

Even then, that would help the AI automatically fine tune to small changes, but not so much for big changes. Trying to make AI decisions totally flexible based on parsed tech would be extremely complicated and not likely to yield good results -- Elezear posted a link to an article by the lead Civ designer where he talks about that very thing: viewtopic.php?p=58664#p58664
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

gvdm
Space Floater
Posts: 43
Joined: Sun Nov 06, 2011 11:04 am

Re: To Break or Not to Break the AI, that is the question...

#5 Post by gvdm »

That's a nice article, from what I summarise he mentions basically two things, he got caught up in designing an elegant AI engine rather than a strong AI and that making the AI have mood swings was not conducive to fun gameplay.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: To Break or Not to Break the AI, that is the question...

#6 Post by Dilvish »

gvdm wrote:That's a nice article, from what I summarise he mentions basically two things...
From the player's perspective, perhaps it could be given a high level summary as broad as that; from a developer's perspective I think there's a great deal more there...
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

gvdm
Space Floater
Posts: 43
Joined: Sun Nov 06, 2011 11:04 am

Re: To Break or Not to Break the AI, that is the question...

#7 Post by gvdm »

My apologies for posting unclearly, instead of saying:
That's a nice article, from what I summarise he mentions basically two things
I meant:
That's a nice article, from what I summarise he mentions basically two things relating to AI
The post is massive and covers a lot of ground about Civ5 and his new project ATG, from resources to diplomacy and more.

Specifically about AI I picked up on those two main points.

He does mention a third point in relation to AI, that of the difficulty of managing combat within the context of 1UPT type of TBS (ala wesnoth), I didn't mention this as FreeOrion allows stacking (it also actually just didn't come to mind at the time of the first post, but I just quickly reread the article).

But anyway, it would be nice, although I agree somewhat difficult, to have a flexible AI.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: To Break or Not to Break the AI, that is the question...

#8 Post by Dilvish »

gvdm wrote:My apologies for posting unclearly, ... I meant: [... relating to AI ]
I meant my previous comments with respect to the AI as well; it seemed to me that your summary so strongly minimized what was in the article with respect to the AI that it would tend to wrongly discourage folks who are otherwise interested in discussing the AI development from reading the article themselves.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Zireael
Space Dragon
Posts: 429
Joined: Mon Aug 15, 2011 5:33 pm

Re: To Break or Not to Break the AI, that is the question...

#9 Post by Zireael »

A) Make content changes freely, then at some later date worry about bringing the AI up to speed.

B) Coordinate changes with Dilvish to try to keep the AI continually competitive.
We could do A) in test builds (i.e. the ones Vezzra compiles from SVN) and B) in release builds.

Post Reply