Logo Platform
logo amplifiers simplified

AI Modding

Reply
Copied to clipboard!
12 years ago
Aug 19, 2012, 6:50:16 PM
@ ail, I am trying to pick certain changes out of better AI 1.1, and I don't have quite enough information.



The ship template improvements for omnitanking are only in ShipDesignTemplates, correct? I have made changes to that to put in proper names like Falcon instead of Medium1HisshoTemplates, so I will have to merge.



The changes to pick entirely fleet abilities are only in AI/Parameters/AIParametersHeroAbility, correct? I will pick up that instead of AIParametersHero.



I'm not going to pick up the tonnage changes just yet. I hope the devs will fix the tonnage bug "properly" since there are a lot of other interactions to consider such as the effect of constant-tonnage techs and modules.
0Send private message
0Send private message
12 years ago
Aug 19, 2012, 7:52:52 PM
Ail, I just wanted to thank you. I've just lost my first game since I started playing ES. Now that the AI is finally utilizing support modules and extra tonnage (I didn't even realize that were failing to do so before), their military brutalized me (on serious difficulty).



Keep up the good work. smiley: biggrin
0Send private message
12 years ago
Aug 19, 2012, 8:01:35 PM
Excellent feedback. I think the changes I have made to system improvements also help a lot from the economy standpoint. Later today I will update my community mod with the economy changes, using ail's hero and template mods. I am still worried about the tonnage mod. Do you see any side effects when combining the percentage tonnage increases with the fixed value tonnage increases in the east tech tree? Or other funny side effects on shipbuilding?
0Send private message
12 years ago
Aug 19, 2012, 8:13:11 PM
@ ail, regarding assigning admin heroes to fleets, I am hunting for various things in registry.xml, and I stumbled across the following:

[code]



5

10

1

0.75

0.25

0.5



[/code]

I wonder if this may affect how likely an admin hero (system hero) is to be reassigned to fleet duty during a war. I wonder if making all of these "1" will keep system heroes in systems? Before patching in your fleet ability change, I will try this with your original assignment of system heroes to system, and see what happens. I may not have the opportunity to run a full game today, so if anybody wants to try in parallel, please do let us know the result.
0Send private message
12 years ago
Aug 19, 2012, 8:19:25 PM
I've already combined your modifications with Ail's 1.1 changes. Both compliment each other really well, it would seem.



I didn't notice anything out of the ordinary with regard to tonnage changes, although support tonnage modules, indirectly, became more effective (seeing as the weight of all the modules is ultimately reduced to 50%). Still, that doesn't pose a problem now that the AI is making use of them as well.
0Send private message
12 years ago
Aug 19, 2012, 9:06:59 PM
@Insolentius: Thank you for your feedback. Helping the AI to brutalize people is my greatest pleasure. smiley: smile



davea wrote:
I am still worried about the tonnage mod. Do you see any side effects when combining the percentage tonnage increases with the fixed value tonnage increases in the east tech tree? Or other funny side effects on shipbuilding?


The only side-effect I've seen was the wrong display on tonnage once you update an existing design and which goes away as soon as you swap something out. The other is, that the +Tonnage modules are more effective.

I suggest to use it in the community mod but let us be wary for when Amplitude fixes the bug that made these changes necessary. Having the AI only use half of it's capacity in lategame is just too gamebreaking to leave it in the game even if it's only a short time.



I think that change is more important in strengthening the AI than all of the others combined.

The Registry.xml contains lots of potentially interesting stuff. Hard thing is to find it all out. What I found interesting is, that it, once again contains the mysterious parameter . But unlike the Personality.xml it has it set to 5 instead of 1. I wonder if one of those is overwritten by the other and what it acutually reall does. ^^
0Send private message
12 years ago
Aug 20, 2012, 4:35:36 AM
I have rolled ail's tonnage and ship template improvements into the community bug fix mod:



/#/endless-space/forum/37-modding/thread/15801-released-community-bug-fix-balance-mod



Here are some interesting statistics. There is a "science speed run" thread where I gave a standard game setup. There are a number of save games there done without the mod, including a horatio game I played (run a). A few days ago I did another game using UE and version 02 of the community mod; this has my star system improvement AI changes and ail's exploit changes (run b). Today I did a related run, using the same map, but I just pushed "next turn" a number of times instead of really playing (run c). This one used version 03 of the mod, which also has the tonnage and ship template changes. It isn't *really* comparable to (a,b) because my neighbor, green sophon, was able to expand into my area since I wasn't expanding. Still, the numbers at turn 60 are interesting:



a. AI scores: 1200, 1200, 800, 800, 500; total pop 50, 50, 50, 40, 40; total MP 3200, 2600, 2000, 2000, 1800

b. AI scores: 3200, 2400, 1900, 1800, 1400; total pop 90, 80, 60, 60, 50; total MP 7200, 6300, 4500, 3600, 2200

c. AI scores: 3100, 2000, 1800, 1800, 1700; total pop 110, 70, 60, 60, 60; total MP 9800, 5500, 4800, 3700, 3600



So from a to b, we see pretty significant improvement in economy. From b to c, we see some improvement in total MP; but the tonnage changes really shine on later tech ships. It will be interesting to get more player feedback.



BTW, for those carefully tracking any differences between the "better AI 1.1" release and the community serial 03 release: I did not include the hero changes in 1.1. Instead, I changed some numbers in registry.xml which may keep system heroes at systems, even after the AI is at war. So this has ail's original Hero.xml, and it does not have HeroAbility.xml.



EDIT: Hm, should have tested the hero change more thoroughly before releasing. The registry changes seem to cause all AI heroes to be permanently stationed in systems. Even the pilot/commander ones.
0Send private message
12 years ago
Aug 20, 2012, 10:51:25 AM
I've noticed something peculiar in the two games I played with 1.1 changes. All AI ship designs feature only one weapon, always, and most of the time it's the same weapon. This makes for boring and, most importantly, exploitable behaviour (although I tend not to exploit it). I see that every design entry in the shipdesigntemplate.xml has only a single line, unlike the default one where certain designs have up to two. Was this intentional on your part?



Either way, I'm gonna modify some of these to include two or, at times, even three weapons to spice things up. Seeing as I don't exploit the omni-tank system by stuffing my ships with only a single weapon type, this will make for some more interesting battles that go past phase one.



EDIT: also, it seems that you haven't modified hisshoranger2 and hisshoguardian2 templates seeing as they're the only with default module values.



Additionally, I have a question. If I were to split...







... into...









... would that force the AI to use two different weapon types on its design?
0Send private message
12 years ago
Aug 20, 2012, 2:32:21 PM
@ Insolentius, good feedback. I have also noticed (based on examining only one game) that the AI now almost always builds lasers. I am not sure why; I thought it was a random selection among the three weapons. I agree that probably putting back two weapons onto some templates is worthwhile, but I am curious why it always selects lasers now. Is it because the AI prefers the techs that happen to give lasers, and therefore lasers are always the highest tier choice? It would be worthwhile to jailbreak some save games and investigate this.
0Send private message
12 years ago
Aug 20, 2012, 2:42:30 PM
In the first game that I played, the AI focused on beam weapons whilst in the second, it went nuts with missiles. I'm currently modifying the ShipDesignTemplate.xml and adding some "flavour" with regard to weapon choices. I'm even thinking of creating more offensive or defensive oriented fleet designs (by putting more weight on either weapon or defense modules), depending on the faction, of course.
0Send private message
12 years ago
Aug 20, 2012, 3:17:38 PM
That's exactly the kind of feedback I was hoping for.



Consider what I've one as a first attempt. We shall see and find out what the best way of designing ships is and then make that into templates for the AI. This might take some cycles because of the effect, that the previous designs were so crappy that we knew exactly what was the best to counter them. No we see the new approach and figure out how to counter them aswell.



Obviously it is not as random as I though when it comes to what weapon they put on their ships.



What I intended them to do was, yes, get Omni-Defense and only 1 weapon-type. BUT have it be a different weapon-type on different designs, so it still is hard to counter. And this obviously did not work.

Thanks for pointing out that I forgot 2 of the Hissho designs. Guess I was just missing them in copy&pasting.



I've also done some massive editing to StarSystemImprovements.xml and quite a few on AIParametersBuilding.xml as well.

One example for something that did and did not work as I wanted was that the AI would switch from food to something else, then colonize a new planet and then switch back to food. I think I've stopped that now by increasing the priority of colonization over that of switching exploitation.



But I'll do quite a lot of testing first before releasing my new changes. Thing is, when different players think that different building-strategies are the best (a good thing) it is not so easy to actually teach the AI what is best.

My new changes for example shall limit food production for the AI because I think that is better. Davea says he's not sure if that really is the case.



One thing that Telpar29 mentioned is that most of the tweaks we are doing here affect only the stuff that is already here. He is right. Sure we can tweak the build-order and -circumstances of existing buildings to near perfection if we keep doing it for long enough and let new insight flow into it. However, as soon as someone mods in a new building it would need to be reevaluated with all of the existing ones.

That's why I would have liked a completely different approach for that: The AI shall do a simulation of whatever happens when it builds a building and then evaluate that. Because what we now do is evaluating it manually.

I would like to be able to implement some kind of super smart-formula that evaluates the value of every builing with all possible parameters and then assign that instead of all the "2"s in the Current AIParametersBuilding.xml.



This way we would not have to think about questions like. When the AI colonizes a new system: Shall it first get the exploitation or shall it prefer some stuff (Like Industry1, Science2, Special1) over the exploitation (I think the answer is yes because all these give a lot of fids without requiring population, so that's why I manually increased their value for the AI).



@davea: Sounds interesting that you could modify the AI's behaviour about when it uses what hero. I'm eager to see if you find a solution that somehow forces them to uses system-heros on systems only and fleet-heros on fleets only.



Btw: I now also tripled the value of TechA08 because it unlocks the, imho, super imbalanced +40 Science building. I personally always go for it right after completing the first "circle".



@Davea: For the test you have run to see how much the mod increases AI-performance by measuring score: Think the best way is set to up a 1v1-scenariom no pirates and just do nothing. That way the results would become much better comparable because otherwise randomness of AI-interaction with eachother would make for contaminated samles.



I'm really interested to see if and how much the changes I've made yesterday are an improvement over the latest version in the community-mod.
0Send private message
12 years ago
Aug 20, 2012, 3:38:54 PM
a. We need more investigation into how the AI chooses the one weapon. I agree that having one weapon, if it is always the same, is a bad idea. Maybe putting back the two weapon templates is enough of a solution.



b. In the file ShipDesignTemplates.xml, I have made a change for all the template names. As you know, when you play, you can see that the medium/large AI ship names are things like MEDIUM1HISSHOTEMPLATE 12 or similar. I have put in the correct names to the community mod serial 02 and 03. If possible, could you please use this variant to make more changes? This will save me time/effort in re-merging.



c. I agree that the simulation idea seems attractive, but I don't think it would really help. That is, once it does the simulation, then we still need some way to pick which is the best result. Is +2 food better than +5% growth rate? What most other games do is to supply (edit: a set of 6) weights for all the buildings. If the AI is interested in money, it should pick the available building with the highest (edit: money) weight. It should not include any other factors. This way, all the tuning can be done by setting weights. When a modder adds a new building, it is the modder's responsibility *only* to select an appropriate weight, and everything else will readjust.



d. Regarding the AI behavior and heroes, what I found is that both fleet and system heroes are affected by the registry.xml values. This is not at all helpful. In the next community mod rev, I will revert registry.xml and aiparametershero.xml, and instead use your aiparametersheroabilities. If I have to pick, I will pick "all heroes on fleets, with all fleet abilities" rather than "all heroes on fleets, with a mixture of fleet and system abilities". Of course, "some heroes on fleets with fleet abilities and some heroes on system with system abilities" would be better, but I cannot figure out how to achieve that with our current hooks.



e. In other news, I am mostly working on racial diversity, although I will be happy to roll any of your changes into a community mod update.
0Send private message
12 years ago
Aug 20, 2012, 4:07:49 PM
1st 80 turns are over and I've made an interesting observation considering ship-designs.

The AI, if it does not meet anyone, really seems to slack with that.

They have the 30 Missiles, the 30 Massdrivers and the 20 Beams.

But their current designs wield the 13 Massdriver and they still build those which no doubt is a massive waste of resources and building time.



Was it this what you changed:

1

0.75

0.25

0.5

I think I would change it to:

1

0

0

1



Reason: Even if the heros do not provide anything to the systems when they are skilled for fleets, they would level up faster when set to systems during peace and "default" which I believe is when the empire has not met anyone yet. Neutral I think is for cold war. And I think then having them on fleets is better as well.
0Send private message
12 years ago
Aug 20, 2012, 4:28:16 PM
a. The only drawback to your suggestion of measuring a 1v1 is that after 10 minutes of clicking "next turn", I have only one AI position to look at. In a 6 or 8 player game, the same amount of elapsed time gives 5 or 7 positions to look at. If there were an "autoplay" that could go off and run on its own from a shell prompt, then I could run dozens of games overnight. (I have done that with Civ IV, for example, to collect a lot of info.)



b. I think the AI has some state variable, and it doesn't do any military research till it meets somebody or else til when a war starts. "Some" of this is OK, for some races. I don't think Amoeba should full-out research military, but hissho probably should. Is that what you are seeing? Maybe this variable does not affect shipbuilding, so we get lots of ships with very low technology.



c. Yes, I changed the parameters you mention in registry.xml. I was hoping because "administrator" is in the variable name, these variables would only affect pure system or "hybrid system focus" heroes. Fleet heroes would still be on fleets. But it seems this globally affects all heroes. What I would like is two sets of variables, and some classification of heroes into system vs fleet heroes, and then some way to apply the hooks we have differently to these. I think we are just picking among different hacks, none of which will really give much improvement.
0Send private message
12 years ago
Aug 20, 2012, 5:29:22 PM
davea wrote:


b. I think the AI has some state variable, and it doesn't do any military research till it meets somebody or else til when a war starts. "Some" of this is OK, for some races. I don't think Amoeba should full-out research military, but hissho probably should. Is that what you are seeing? Maybe this variable does not affect shipbuilding, so we get lots of ships with very low technology.



They did research and build military. But they did not update their ship-designs.

So my curiosity goes to: What triggers them to design new ships? Imho this should always happen whenever something is researched that affects ClassShip or it's sub-classes in any way.

Their designs were flatout obsolete in comparision to their tech.



I also found that our "greying out"-trick via causes a problem when applied to stuff like that:

$(../TraitEconomy07Norm1) or ($(../ClassEmpire:NumberOfFriends) ge 1) (this is what I used for the trade buildings)

What happens if you started such a building and then reduce your NumberOfFriends to 0 (by declaring war for example) is that the building will never finish.

I believe I've seen the same with ships when you lose a strategic resource. So this is not a modding-error in the first place. I think in this case something shall either finish despite the requirements are no longer fulfilled or, what I also believe is saver: Be removed from the build queue.

I'm not sure if the actual AI will clean it's queue but when you use the Governor-AIs they wont.



I found that when continuing the game as them and declaring war to my old alter-ego. After everyting (that is allowed) is built all systems were either Ecstatic or Happy even when I set tax to 50%... save 3 systems that were stuck building the trade-building since ages probably.
0Send private message
12 years ago
Aug 20, 2012, 5:43:14 PM
Ail wrote:
What triggers them to design new ships? Imho this should always happen whenever something is researched that affects ClassShip or it's sub-classes in any way. Their designs were flatout obsolete in comparision to their tech.


I have noticed that sometimes. But I have also noticed that the sequence number in their schematic names is quite large. For example, "Kilo 11" means that Sophon has already gone through 11 different destroyer templates. I rarely have more than 2-3 in a game, only when I get significant tech updates and also I plan to start a round of shipbuilding/retrofitting. So there is something wrong here, but it may be hard to find out what.





I also found that our "greying out"-trick via causes a problem when applied to stuff like that:

$(../TraitEconomy07Norm1) or ($(../ClassEmpire:NumberOfFriends) ge 1) (this is what I used for the trade buildings)


We have to maintain a large difference between PathsPrerequisites and AIPrerequisites. For Paths, we should only grey-out when a building will *never* be useful, as a constant thing: for example, careful sweeping in a system with no moons at all. If you have made, or found any changes like that in Paths, please remove them.



For AI, it seems to make sense to have these terms, which may be true or false at different times. But, your point is what happens if the building on the top of the queue, suddenly becomes invalid? NumberOfFriends is one example; a blockaded resource is another example. If this happens to me as a player, I move that item down in the queue so that I don't lose the progress rather than deleting it, and then move it back up again when the condition is satisfied. If the AI lets an unbuildable item sit there, that is a bug, and probably one we cannot fix.
0Send private message
12 years ago
Aug 20, 2012, 6:20:11 PM
Right, that was my fault. Should not have copied it from the AI... I wanted it to not show UP, when I'm Craver and while that worked well, it now is a hindrance.

Will throw that one out.



Another thing that I now ran into was the Industry6 and what it's consequences for Food6 and Habitat4 are.

For food6 i added this:

$(ClassStarSystem:Population) lt $(ClassStarSystem:MaxSystemPopulation) or $(ClassStarSystem:FoodSurplusToProductionBonus) gt 0

So it will get built even at Max-Pop when there is an Industry6 causing the Surplus to be 0.

I shall add that to Food1-5 too since it can't hurt.



But the thing is, to prevent the AI from building Industry6 before it reaches max-pop.

$(ClassStarSystem:Population) eq $(ClassStarSystem:MaxSystemPopulation

is not enough here because when you get Habitat5 after building it, you prevent growth. And not only the AI can run into that problem. It also is annoying for the player should that happen.

So I was thinking if one should not simply remove that line:



from StarSystemDescriptor.xml.

This way you would have the food and the industry. I mean I would feel bad for the people: "Yes, your food-ration is granted. But if you ever get a baby, we'll let it starve because we need the whead to fuel our Manufacturing Plants!"



Edit: This shall make the AI utilize Terran-Worlds better for production once it has Industry6:

($(../ClassStarSystem:Population) lt $(../ClassStarSystem:MaxSystemPopulation) or $(../ClassStarSystem:FoodSurplusToProductionBonus) gt 0) and $(PlanetTypeTerran)
0Send private message
12 years ago
Aug 20, 2012, 6:24:23 PM
Ail wrote:
Teaches the AI to increase their pop-growth by always using the food-exploit for all planets in systems below maximum-population.




Is there a way to make the Sowers AI use the industry-exploit in that case (below max-pop)? The actual food gain is halved for them, so focusing on the industry-exploits (which are also cut in half) makes more sense because they benefit both growth and production, unlike food-exploits, which only provides growth for the Sowers.



Another thing, assuming that the AI governor (I don't use it personally, but I was testing it) that the player can use is basically the same thing that the AI uses, it's skipping moon-related improvements even when the moon(s) have been explored and there's nothing better to build (it uses ind-sci/dust conversion instead of building the food/dust per pop on planet with a moon improvement).
0Send private message
12 years ago
Aug 20, 2012, 6:47:28 PM
Ail wrote:
Another thing that I now ran into was the Industry6 and what it's consequences for Food6 and Habitat4 are.


Assuming industry6 is the one which converts all food into industry, I think that mechanic should be changed in the game. It makes no sense to convert *all* food when there is pop capacity available. For example, if you build the industry6 building and then "super cities" from the south tree, your pop cap is increased but you will never grow to fill it. Rather than finding some complicated heuristic for this, it would be better to focus on the earlier game stuff and make that as strong as possible.



@ insolentius, good point about the governors. When I play my next game through (sadly, probably not till later this week) I am going to try using only the governors, except for decisions about shipbuilding, and maybe ind->dust if I don't rely on trade. I know many players used to complain it is awful, but this is exactly the thing we are fixing here. It will be a good way to get more feedback, if I disagree with its decisions.
0Send private message
?

Click here to login

Reply
Comment