Logo Platform
logo amplifiers simplified

AI Modding

Reply
Copied to clipboard!
12 years ago
Aug 23, 2012, 5:11:12 PM
Please do look into the thread: /#/endless-space/forum/37-modding/thread/15742-summary-of-findings-on-ai



The dev team has specifically stated they plan to include "some" of the changes into the next rev. Let us help motivate them to get the right ones. I believe we agree that ail's tonnage changes are a clever hack, and the right solution is to fix the bug preventing AI's from using the full tonnage. If you have any other comments/corrections on my post there, please update ASAP.
0Send private message
12 years ago
Aug 23, 2012, 5:20:34 PM
Nope. That is exactly what the original tonnage-techs did.

I think there could be a second variable that holds the value that is allowed to be used. But it gets not updated and thus always stays at the base-values.



WTF... I just found something really, really, disturbing!



When I press enter in rapid succession the AI won't do the same things that it does when it has more time. They would not move their scout, they would not suggest their offer. That's the 2 things I could clearly observe. As soon as I held in for a bit longer they did so. Maybe that is the same reason for why they had outdated ship-designs.

I really hope that what i just saw was a coincidence. Because the AI skipping parts of their turns by reducing their time to think would really be a big issue!



Merging fleets also is affected by that. End the turn and they won't merge. Wait some time and they will.
0Send private message
12 years ago
Aug 23, 2012, 5:33:12 PM
There's another thing I noticed. It seems that the AI uses three designations for its fleets...



- attack

- defense

- interception



... and that each "group" has at least one hero assigned to it.



The curious thing is that approximately 70% of its fleets are labeled with defense, which explains why the AI sits idly near their systems with most of their fleets whilst they're engaged in a war. Now, if there were a way to modify that, it'd be nifty.
0Send private message
12 years ago
Aug 23, 2012, 5:45:16 PM
Confirmed. The tonnage workaround actually does nothing. It looks like it works because the ships have like 417/425 Tonnage but as soon as you edit them, remove a module and add it again it refreshes with the real value and you can see that the ship only has 326/425.

Sorry for claiming to having made a workaround when it actually did not help afterall. smiley: frown



So this basically is still the biggest issue as to why the AI will never be able to compete in lategame-wars.
0Send private message
12 years ago
Aug 23, 2012, 6:03:20 PM
Yeah I clued in after I posted I have a copy of the xmls on my phone (just really slow to look at) and that is exactly what the orginal code did. Is there any point in trying to adjust the weight directly on the modules?
0Send private message
12 years ago
Aug 23, 2012, 6:08:25 PM
Ail wrote:
WTF... I just found something really, really, disturbing! When I press enter in rapid succession the AI won't do the same things that it does when it has more time. They would not move their scout, they would not suggest their offer. That's the 2 things I could clearly observe. As soon as I held in for a bit longer they did so.


I saw a mention of this as an exploit a while ago: the author wrote that if you keep pressing "end turn" as fast as possible, you can cripple the AI. I thought to myself "the game could not possibly be so stupid as to let the turn complete when the AI's are still moving". But I did not try to prove it. This is a major problem for our "fast test method" of just pushing the next turn button while not performing any moves. How do we know when the AI is really done, so we can push next turn safely? If this is the reason why putting the real ship names like Falcon into ShipDesignTemplates appears to not work, I will be so annoyed!
0Send private message
12 years ago
Aug 23, 2012, 6:09:56 PM
Ail wrote:
So this basically is still the biggest issue as to why the AI will never be able to compete in lategame-wars.


Well, it seemed like a good idea at the time. Hopefully the dev team will recognize this either from your tech support forum post, or my AI summary thread I have linked. I know the dev team will read that; if you have anything to add to my summary, please do.
0Send private message
12 years ago
Aug 23, 2012, 6:24:40 PM
@Insolentius: I don't think there's an issue there. The AI will label all it's fleets as "Defense" when they have no war. Once they send them to attack they use the same ships but relabel them. The percentage they use as offense depends on how strong their enemy is. In my case (1-planet test game) they sent in a single 5/19 fleet to take me out, which, in this case was totally sufficient.

But from normal games, where I have more fleets, they will also send in more attack-fleets.



The -parameter might still have a word with this as probably being an upper limit. But it will not force the AI to ALL-IN on you when they can take you out with far less effort.



I think the way it works looks like it makes sense.



@iblise:

You mean something like that:











I say: No clue if that could work. Giving it a try won't hurt though.
0Send private message
12 years ago
Aug 23, 2012, 6:31:25 PM
Have you actually tried adjusting ship weight in the XML file and then checked if the AI actually uses that base weight to determine changes. If cranking that value up directly then you'll know for sure if that values adjustment affects AI tonnages. Yup that was how I was planning my miniaturation attempts for coding - yours was so clean though :s
0Send private message
12 years ago
Aug 23, 2012, 6:37:24 PM
davea wrote:
I saw a mention of this as an exploit a while ago: the author wrote that if you keep pressing "end turn" as fast as possible, you can cripple the AI. I thought to myself "the game could not possibly be so stupid as to let the turn complete when the AI's are still moving". But I did not try to prove it. This is a major problem for our "fast test method" of just pushing the next turn button while not performing any moves. How do we know when the AI is really done, so we can push next turn safely? If this is the reason why putting the real ship names like Falcon into ShipDesignTemplates appears to not work, I will be so annoyed!


It really looks like there are 2 kinds of tasks the AI does.

One of them is the "must do"s and the other is the optionals.



Expanding and Building their planets seems like it's in the must do-branch.

Diplomacy, sending around ships, designing new ships, merging or splitting fleets, picking attacks all seem to be optional. I think one of the most well observed thing in this is how they react to a fleet of you arriving in their system. They will react to this if they have the thinking-time to do so.



This is extreme! I made this test:

Declare war on enemy and take turns slowly. => 4 turns later their attack arrives

Reload savegame, do the same but hit enter as fast as possible. => no attack comes in for at least 10 turns, only when I held in a while and stopped spamming the enter key they eventually attack
0Send private message
12 years ago
Aug 23, 2012, 7:11:37 PM
iblise wrote:
Have you actually tried adjusting ship weight in the XML file and then checked if the AI actually uses that base weight to determine changes. If cranking that value up directly then you'll know for sure if that values adjustment affects AI tonnages. Yup that was how I was planning my miniaturation attempts for coding - yours was so clean though :s


I just tried the thing you suggested in your post before.

It is yet another way of realizing miniaturization, that works for the player but not for the AI.

The modules are shown with their original size but get shrunk as soon as you put them on the ship.

The Upgrade-Design-Button as well as the AI will now build ships like 306/450.



The miniaturziation works for the completed ships but not when building them.



I think I should have just gone with my original idea of replacing the tonnage-bonus with something as simple as a hitpoint-bonus. This might be better for balance anyways because as it is the fights seem to be very binary as in: If a ship has enough defenses it will survive without a scratch and if it doesn't it is killed almost instantly.



I will try directly increasing base-tonnage and see what the AI makes out of it.



Edit: Works, the AI will make use of the extra-tonnage if you initially give it to the hull.



I think the reason for why none of the workarounds or the original approach works is the same in all occassions: The ships are not yet existing when they are designed and thus none of the changes get applied to them. There's one last idea I have... There is this "Priority"-Thing you can add to your lines. Maybe that does something.



Edit: Nope, it doesn't.
0Send private message
12 years ago
Aug 23, 2012, 7:48:36 PM
I've increased all MaxWeight values by 50% and changed the +25 & +50 modules to +50 and +100, respectively. Granted, I will have to refrain from crossing the new default values to maintain balance, but it's better than the alternative, which is either abusing the AI's disability or staying below the default tonnage (which is nowhere near high enough to support a proper number of high-tech, heavier modules). It's like trying to heal a broken arm with a band-aid, but it'll have to do for now, or at least until our boy wonder (Ail) figures this one out. smiley: wink
0Send private message
12 years ago
Aug 23, 2012, 8:10:21 PM
Ail wrote:
I think I should have just gone with my original idea of replacing the tonnage-bonus with something as simple as a hitpoint-bonus.




Would replacing...



"MaxWeight" Value="0.10" OperationType="Percent" Path="ClassEmpire//ClassShip"/>



... with, for example, this...



"MaxHealth" Value="50" OperationType="Addition" Path="ClassEmpire//ClassShip"/>



... work?
0Send private message
12 years ago
Aug 23, 2012, 8:28:39 PM
Alright so the issue is the AI cannot calc tonnage correctly when it is a theortical weight. Therefore can you create a new variable at the empire level that is linked to ship weights, actually you'd need to create variables for each ship class weight to which modifiers are applied. That value should be dynamically updated allowing the AI the ability to calc tonnages. Or im just talking out of my ass hah
0Send private message
12 years ago
Aug 23, 2012, 8:44:27 PM
iblise wrote:
Alright so the issue is the AI cannot calc tonnage correctly when it is a theortical weight. Therefore can you create a new variable at the empire level that is linked to ship weights, actually you'd need to create variables for each ship class weight to which modifiers are applied. That value should be dynamically updated allowing the AI the ability to calc tonnages. Or im just talking out of my ass hah


Adding variables to other classes is for us modders to calculate things.

The case is not that the operation is not working. It does because otherwise we would suffer from the same problem as the AI. It just obviously is somehow applied after the ship is designed by the AI.

Most likely one of the devs has to just swap 2 lines of sourcecode and it will work just fine.
0Send private message
12 years ago
Aug 23, 2012, 8:47:05 PM
I highly recommend to let the dev team sort out the tonnage problem in the source code, and move onto some other areas. Is the StarSystemImprovement ... improvement done? What are some other areas where we could improve AI play?
0Send private message
12 years ago
Aug 23, 2012, 9:00:46 PM
It's really hard to move away from the thing that sounds most important. ^^



Well, I have an improved StarSystemImprovements but I'm not really happy with those improvements as they do not improve enough. I could upload it anyways but I doubt there is a noticable improvement.



Thortillas came up with some input about how certain things can be done. Haven't started on trying those out yet. But I think that at least for food and dust more maths needs to go into when to build them.



I think I will also try to get rid of different System-managers as that makes it just more complicated to set up good build-orders. For example the Industry-guy wants to build Industry2 too early but with your Industry lt 50 it often comes to late. When only the "balanced"-guy remains AIParametersBuilding.xml could help to have more control about the buildorders. But things like the Sower-Affinity add difficulty to that, as many people have pointed out.
0Send private message
12 years ago
Aug 23, 2012, 9:11:22 PM
Testing/improving the system-managers seems useful. The next full game I play out (probably tomorrow, using Hissho evasion battle cards) I will try using only the governors.
0Send private message
12 years ago
Aug 23, 2012, 10:17:38 PM
Yes, the thing to consider is that the AI will run different governors and this creates different results. When they all would act the same it would be better to test. Because I optimized everything i did so far for the balanced one but the ai acted differently than I wanted them to because they used a variety of them.
0Send private message
12 years ago
Aug 23, 2012, 11:55:32 PM
Here's a little standalone mod. It should actually work like a mod should and can be loaded from the Mod-Menu.



It is basically the known AI-changes with some additions to spice it up and make it different from the community-mod.

Most of it is only tested if it works not how it really plays.



So here is what it has:



Ship-Tonnage-Bonus is replaced by Ship-Hitpoint-Bonus (since the tonnage bonus did not work and this sounds better than nothing)

You cannot retreat anymore (if the AI can't do it, why should the player be allowed to?)

AI-Empires are now way more aggressive (probably I overdid it)

General Improvements to AI from AI-Mod (with some most likely not very noticeable changes)



Edit: To be fair, here is a small warning about what is likely to happen about the AI's diplomacy:



Your direct neigbours will sooner or later hate you. Giving them what they want may delay it.

If you are stronger than someone, they will hate you.

If you are too weak... they will hate you too.

Only way to make them really like you is to declare war on their enemies.

Getting an alliance with any faction should be impossible without being at war with an enemy of them.

Just having peace with someone will not make them like you any more.

Of course they will also go for eachothers throats aswell. A circumstance you might want to benefit from.

So you actually cannot count on having a peaceful game.
Evil.zip
0Send private message
?

Click here to login

Reply
Comment