Logo Platform
logo amplifiers simplified

AI Modding

Reply
Copied to clipboard!
12 years ago
Aug 20, 2012, 7:17:07 PM
Oh... the sowers. Didn't think about them. They would have to be treated seperately here.



Yes, the AI uses the various governors. Mostly the Industrial on new systems and the Balanced one later on.

I think the reason why Davea made the condition for Industry2 was necessariy because of the Industrial-preference. That very often causes the AI to build the 2nd Ind building too early.



I've found out quite a lot more about how the AI works and think I can tell you why they skip or delay certain buildings.



First of all:

All buildings have values in different fields. You can find those in "AIParametersBuilding.xml".

Then comes the governor and multiplies these values with his preferences. Those can be found in "StarSystemAssignation.xml".

Example:





















Then it get's added up in order to determine how much each building is currently liked to be built.

Not at the end yet. The build time now is also factored in. Let's say it is divided by the built-time which is a likely thing.



Now an example:







The governor from above sees that, muliplies it with his 0.5 for food and gets a value of 1.








The governor from above sees that, muliplies it with his 1 for industry and 0.3 for military and gets a value of 2.06.

Now say the value is divided by the build time.

Say food 1 takes 2 turns and Industry 3 takes 9 turns.

1/2 = 0.5

2.06/9 = 0.228

Thus the AI will build the food1 first despite being on "prefer industry".

Whenever this final-value drops below 0.1 it will make Industry to Dust or Industry to Science.

That's at least what I guess how it works from what I've observed.

The Real AI of course will queue in ships as well. I don't know what exactly are the values to line in the ships. I guess it's 1/buildtime by default and increases/decreases during war/peace/war-preparation.

So whenever you see the Governor on auto build the conversions, the real AI would most likely be making ships instead.



Oh, the StarSystemImprovementMoney2 is another thing. It is wrong in Daveas version of StarSystemImprovements.xml! I told him, he denied that it is wrong, but I can tell him again!



StarSystemImprovementMoney2

count(ClassStarSystem/ClassPlanet/MoonStatusExplored) gt 0

count(ClassStarSystem/ClassPlanet/MoonStatusExplored) gt 0



%StarSystemImprovementMoney2Title

%StarSystemImprovementMoney2Description







The marked 0 is where he has a 1. So he requires 2 moons to be explored before allowing to build it. Maybe he thought it gives +2 Dust per moon. But the truth is it gives +2 Dust per Pop on a planet with an explored moon! So 1 moon is totally sufficient to justify building this.



Edit: As a conclusion of that, I think that we should probably make all governors from StarSystemAssignation.xml work similar and then optimize the rest around it to get more consistent behavior.
0Send private message
12 years ago
Aug 20, 2012, 7:17:15 PM
Oh boy. There's seems to be a huge problem with the Sowers AI. I first noticed it when I was testing something else and then confirmed it by trying it again. The Sowers don't seem to update their fleet designs... ever. On turn 49, he had 54 fleets, all 11/11 and all of them featured the basic "defender" design. Start a 1v1, fast, small map against them and see if you can confirm it.



Regarding the planetary exploits, I think it's rather silly that a Sowers AI would build hyper-scale farms on a lava planet while the system is still growing (1.5 effective food vs 2 effective food + 5 industry).
0Send private message
12 years ago
Aug 20, 2012, 7:25:12 PM
Ail wrote:
Oh, the StarSystemImprovementMoney2 is another thing. It is wrong in Daveas version of StarSystemImprovements.xml! I told him, he denied that it is wrong, but I can tell him again!


I know there are a lot of posts and this got buried, but my point is that the correct decision is tax rate dependent. Do you agree? I prefer to wait for xenotourism till pop 10, and I only build careful sweeping once I have explored two moons. There is an exact equation but this seems like too much trouble.
0Send private message
12 years ago
Aug 20, 2012, 7:42:16 PM
I could not reproduce the Sower-Design-Issue. I just encountered them for the 1st time in Turn 31 and they already have "Defender 3" that is using missiles, missile-defense and a little bit of mass-driver-defense.



@davea: If you are right, that would mean I do not understand how the building works. I will just try it's exact effect out now so we can see what would be right.



Edit: Ok, you were right. No-Tax means no dust from this building. So we once again are at a point where we really need to be able to do maths in those equtations. count() works, gt, lt, eq, and, or... it's hard to believe that we can't do other maths there as well. I even remember ThorTillas having given an example where he suggested that one could use math there. (In his exampled he spoke about multiplying something by 0.6) But he just mentioned it in a sentence without actually showing the XML-Code for that!



I really wish Amplitude would help us a little bit more in improving their game by giving us the information we ask them for. (I made a thread directed at them but it was never replied to)



Edit: From some testing I believe the output of these Dust-buildings is Tax-Rate/50*the value shown. So at 50% tax their yield is exactly as shown.
0Send private message
12 years ago
Aug 20, 2012, 7:52:37 PM
Ail wrote:
(I made a thread directed at them but it was never replied to)


The entire dev team was at a big game conference last week (gamescom). I hope they will dig out of the backlog and reply soon.
0Send private message
12 years ago
Aug 20, 2012, 8:36:58 PM
Ail wrote:
I could not reproduce the Sower-Design-Issue. I just encountered them for the 1st time in Turn 31 and they already have "Defender 3" that is using missiles, missile-defense and a little bit of mass-driver-defense.




Damn. Everything was working perfectly last night. Today I downloaded dave's 03 version and everything seems to have borked up (I tried other factions as well, same problem). At first I thought that the modifications I made to ShipDesignTemplate.xml could be the root of the problem, but then I redownloaded 03 again, started a new game and the problem persisted. You say you couldn't reproduce the issue... are you using dave's latest revision?



Also, if I, for example, change this...





















... to this...























... would that cause any issues or would it mean that the design would simply use two weapon types in a 3:2 ratio instead of one? That's the kind of modifications I made to the ShipDesignTemplate.xml and I thought that it was the culprit, but it turns out it wasn't.
0Send private message
12 years ago
Aug 20, 2012, 8:59:41 PM
The only part of the community mod I used was the StarSystemImprovements.xml and even that is now heavily modified in my local revision.

Also note that I had troubles using mods as they are meant to be used. That's mostly the reason why I'm directly editing in the Public-Folder of the game-directory and only copy the files that I canged away into a mod-folder that I only use for zipping and uploading but not to run the mod from.



Davea mentioned something about renaming the ships again after my changes. Maybe a non-crashing-syntax-error snuck in this way.



I suggest replacing ShipTemplates.xml with the one from my AI-Mod and see if it fixes the problem. If it does not, then there probably something else within the community-mod causes this problem.



And yes, your assumption is right. What you did there should not cause any trouble... assuming there's no weird invisible characters somewhere.
0Send private message
12 years ago
Aug 20, 2012, 9:18:54 PM
Ail wrote:
Davea mentioned something about renaming the ships again after my changes. Maybe a non-crashing-syntax-error snuck in this way.



I suggest replacing ShipTemplates.xml with the one from my AI-Mod and see if it fixes the problem. If it does not, then there probably something else within the community-mod causes this problem.




You were right. I tried the ShipDesignTemplate.xml without the name changes and it works fine (the AI (Sowers) updated its ships almost immediately). Davea must have screwed the pooch somewhere in the file... or maybe changing the names causes this issue. I played two games with rev02 + your 1.1 changes (with default ship names) and it worked fine. Today, with rev03 which combined your ship design updates with the name changes, shit started hitting the fan. Davea should try a game with rev03 and see whether he'll be able to reproduce the issue.
0Send private message
12 years ago
Aug 20, 2012, 9:36:56 PM
I know that changing the names does not cause any problem by itself. If you diff ail's better AI 1.1 file with my community serial 03 file, I hope you will only find differences on the ShipTemplateName lines. Anything else would be a merge error. I know that some problems may occur if you only use parts of the mod; in particular, if you include one file under the AI/Parameters directory, you must include all of them. Please see this thread:



/#/endless-space/forum/37-modding/thread/15876-ai-lost-ability-to-make-colony-ships



@ ail, are you having trouble *creating* mods, or using them? There should be no problem using my mod. If you are creating mods and having trouble, please check "standalone=false" in the index.xml file and please check output_log.txt for any syntax error. In addition, make sure to include all files under AI/Parameters and if you include plugins/galaxygenerator/(anything), you have to copy the entire contents of plugins/galaxygenerator. What is the specific trouble you have had? If you upload a nonworking mod zip, I can download to try to find the problem.



I ran a game using serial 03 by pressing "next turn" 90 times, and then looked at the point totals, hero distribution and schematic efficiency. It was not broken.
0Send private message
12 years ago
Aug 20, 2012, 9:59:26 PM
davea wrote:
I know that some problems may occur if you only use parts of the mod; in particular, if you include one file under the AI/Parameters directory, you must include all of them.




I know. That's why I immediately switched to an unmodified 03 to see whether any changes I made were the cause. It turns out that they weren't because when I replaced your ShipDesignTemplate.xml with the one that Ail uploaded, everything was alright. If the only difference between the two are the ship names, then it's logical that they, somehow, cause the issue.
0Send private message
0Send private message
12 years ago
Aug 21, 2012, 2:43:59 AM
There appears to be "some" problem with community mod serial 3, but not what I expected. If possible, I need some suggestions on how to track this down. I did three runs like this: three player game with one sower AI and one other AI, "next turn" 60 times, jailbreak, and look in the naval screen. The only difference was the exact details of ShipDesignTemplates.xml



1. With community mod serial 03 as released: sower had *NO* new schematics (wrong), sophons had new schematics.

2. With file directly from ail's better AI 1.1: sower had new schematics, pilgrims had new schematics.

3. With community mod serial 03, but replaced original sower names like Medium1SowerTemplates: sower had new schematics, hissho had new schematics.



How the #$%(#*% can one of the races require the original template names? I searched in all the other xml files and the string "SowerTemplates" never appears. Can this really be hard-coded into the game executable?



Anyway, I will go with the updated file from run (3). Please see this post where I have updated the community mod with the corrected file:



/#/endless-space/forum/37-modding/thread/15801-released-community-bug-fix-balance-mod
0Send private message
12 years ago
Aug 23, 2012, 1:38:43 PM
Some findings (via jailbraking)...



- the AI favours weaker shield modules even when there are stronger ones available (this also happens for the player when (s)he uses auto-upgrade)

- the AI does not make use of the extra tonnage from technologies even with your changes, i.e., it still treats the modules as if they weighed the same as before

- the AI does not appear to use buyout... ever



I speculate that the AI tonnage problem is related to the auto-upgrade function. Whenever a player clicks it only once, it does not take into account the extra tonnage provided by the technologies and I reckon that's how the AI does it... by "pressing" it only once. In order to utilize every single bit, one must spam the button until it completely fills the ship up. Is there a way to modify the auto-upgrade function so that it uses up all the tonnage available at once (via a single click)? I think, if possible, it would solve the problem.
0Send private message
12 years ago
Aug 23, 2012, 2:18:36 PM
How do you conclude that the AI never uses buyout? I assumed (but did not know how to verify) that the AI gets a huge tax bonus and uses that money to buyout a lot.
0Send private message
12 years ago
Aug 23, 2012, 2:26:37 PM
I can't be absolutely certain, but there was an AI fighting a war, and losing it horribly, with about half a million dust in its bank. If the AI were using buyout, I don't think it'd be able to accumulate so much, especially in situations where buying ships is more preferable to building them.



The AI doesn't get a tax bonus. However, it enjoys lower upkeep costs and higher approval, which makes higher tax rates possible without crippling its economy. The only way to test it would be to start saving each turn, jailbreak each save afterwards and determine whether the AI's dust amount ever drops (ignoring the hero hiring costs, of course).
0Send private message
12 years ago
Aug 23, 2012, 2:32:23 PM
What is the possible reason for raising the tax rate without buyout? All that does is lower happiness.
0Send private message
12 years ago
Aug 23, 2012, 2:36:45 PM
The AI does what it's told. As I'd said, I'm not absolutely sure it doesn't use it, but judging by the dust amount each AI had and the fact that most systems were building improvements and ships instead of buying them out, I'd say it's highly likely. There's no point in raising the taxes if you're not planning on spending that dust, I agree, but it also doesn't make sense to hoard it and waste precious turns trying to build stuff in low-industry systems.
0Send private message
12 years ago
Aug 23, 2012, 4:36:03 PM
Regarding influence improvements, Ive noticed there is stat related to distance from, I'm guessing the home planet, is there some way this variable could determine if these buildings should built.



Related to tonnage I'm assuming that the AI refers to maxweight assigned to each hull type. This is then modified through various variables - heh - which is then applied in order to determine tonnage allowances. Has anyone tried a modifier tha directly adjusts maxweight rather then applying an indirect adjustment?
0Send private message
12 years ago
Aug 23, 2012, 4:52:05 PM
I'm pretty sure the AI does buyout, but I think what happens is, that the amount of dust it uses to do so is limited by something.



Thing is there's still a lot of stuff in the XMLs, that we just don't have any clue what it actually does.

For example this here:



1.5

1.5

1.5

1

1

1



It seems like variables that affect taxation. There might or might not be a connection to how much it buys out.

So you say that the ships despite the tonnage-change I made, still not have the amount of stuff on them that they should? I don't really remember how I tested it to conclude that it would work. Now if you are right, then this is a serious issue.
0Send private message
12 years ago
Aug 23, 2012, 5:03:07 PM
Ail wrote:
So you say that the ships despite the tonnage-change I made, still not have the amount of stuff on them that they should? I don't really remember how I tested it to conclude that it would work. Now if you are right, then this is a serious issue.




Yup, confirmed it twice. At least they're using the tonnage support modules, that helps a bit, but they're adamant on staying below the default hull threshold. Iblise's suggestion may hold water.
0Send private message
?

Click here to login

Reply
Comment