Whitley
Skirmisher
posted 03-18-17 06:59 PM EDT (US)
I've created new civilizations, and they work fine, but they do not (or very rarely) build the new units I've made, instead only building old units. Civilizations that do not have access to old units end up not building any units at all (except for settlers).
Is there something in the AI files that I have to modify to encourage these new units to be built more?
SkyOne578
Skirmisher
posted 03-22-17 03:00 PM
EDT (US)
1 / 23
Go to modding discussion, at the better ai project topic, and ask panmaster2014 for his zen master ai. It is by far the easiest to understand and to modify. But if you want, you can spend hours on searching a way to make the original AI to train your units. You can also use the triggers to control AI, but I'm not sure about what I say.
Panmaster2014
Skirmisher
posted 03-26-17 05:45 AM
EDT (US)
2 / 23
You have to manually define the new units and insert them into the training plans.
It is possible to code the computer player be able to train new units automatically with something like this:
for(I=0 ; < 10000)
{
if(kbProtoUnitAvailable(I))
{
//add detected unitID to array of available units
}
}
Panmaster2014
Skirmisher
posted 03-30-17 07:14 AM
EDT (US)
4 / 23
kbUnitPickSetPreferenceFactor seems to control most of the stock aiMain.xs unit choices.
Maybe you could try lowering the value for existing ones and adding your own:
kbUnitPickSetPreferenceFactor(gLandUnitPicker, cUnitTypeMyUnit, 0.9);
SkyOne578
Skirmisher
posted 03-30-17 03:12 PM
EDT (US)
5 / 23
Hey Panmaster2014 !
Did you continue your work with the Zen Master AI ? I saw your discussion with SimonBolivar85 and it seems both you two, you stopped working on AIs. I have downloaded your AI with the link you gave. For an AI that still is under development, it is really good! Thanks to you and your AI, I now understand much more stuf about AIs. Though I only understand but in the practice I suck in making good AI like yours. I'd be happy to see a new version of it uploaded in this website. Please post a reply. Thanks !
Panmaster2014
Skirmisher
posted 03-31-17 10:01 AM
EDT (US)
6 / 23
SkyOne, I have not given up working on it. I enjoy the problem solving.
I've made numerous improvements since the file I uploaded in November.
There's still many things on the to-do list.
SkyOne578
Skirmisher
posted 03-31-17 02:09 PM
EDT (US)
10 / 23
Then if I have a long list of techs that must be ignored by ai, I just create a rule that list them with the IF statement ? Is this method completely efficient ? Knowing that could be very useful.
I have another question : do you have a theory about why the original ai stops playing when it have attacked more than 4 or 5 times? I mean, the ai attacks you, you win, it attacks you again, you win again, and so on... Then after, it refuses completely to do anything, even making settlers to work. This is one of the reasons why I'm looking for new AI because this one seems impossible to solve.
Panmaster2014
Skirmisher
posted 03-31-17 05:21 PM
EDT (US)
11 / 23
Nested if statements are quite efficient.
Having if(A){ if(B){} } instead of if(A & B){} is optimal.
The original ai is a lost cause. It possibly runs out of resources or the attack plans are bugging out.
The ai by NuggetFung in the downloads section is far better.
Panmaster2014
Skirmisher
posted 04-02-17 11:14 AM
EDT (US)
13 / 23
I don't see anything special about the Hundred Days mod ai.
It has cTechANTIRUSH instead of cTechLevy to call minutemen. I can't find anything else interesting.
I need to fix my wall building rules and upload what I've done so far.
SkyOne578
Skirmisher
posted 04-03-17 02:33 PM
EDT (US)
14 / 23
Of course it's not interesting. It's boring and seems cheating with the HC cards. What I'm trying to say is that you have enough skills to improve it (building warehouses at the right place, choosing the right focus at age ups, using sappers to destroy enemies' buildings, building gabion, low walls,...) ? Maybe you're not interested, but it's just a suggestion that you may be the best member of the team if you join them as you can make the best ai from all around the web, with the only aoe3 mod that focuses totally in micromanagement.
Concerning your ai, I'd be happy to test it. What is the to-do list? What do you think to do next? And when do you think to finish it completely? The one that I have here stops the game sometimes, I don't know why. Also, it refuses to play on maps with water, changes very very rarely its deck, and attacks with unorganized armies. That's why I stopped using it and am waiting for the next version you'll release. However, I must say that it's far more better economically. You've done a very good work.
Panmaster2014
Skirmisher
posted 04-24-17 01:12 PM
EDT (US)
17 / 23
I've been lethargic lately making progress almost impossible.
I've noticed another critical issue for the AI when building more than one structure at once. All the settlers will go idle. I've seen it for mills as well as manors. I suspect it's related to the other limitation of build plans in how it randomly chooses the builders.
I have thought about assigning all settlers to an empty plan, such as the "hunt" plan or "work" plans that don't do anything, as a possible fix but I doubt it'll work.
Solving these problems is what makes it so challenging.
SkyOne578
Skirmisher
posted 04-27-17 04:19 AM
EDT (US)
18 / 23
But why don't you use aiTaskUnit to compensate ? What's the inconvenient with this method ?
Panmaster2014
Skirmisher
posted 04-28-17 01:19 PM
EDT (US)
19 / 23
There are at least 5 reasons why build plans are preferable over aiTaskUnitBuild:
1. You can't build wagons, trade posts or docks.
2. You can only assign one builder.
3. Other plans can override tasked units.
4. No way to directly know which settlers are builders until they start building.
5. The building rotation is always reversed.
The advantages being that aiTaskBuild doesn't have that weird bug, is 100% reliable under testing and I can assign the nearest builder rather than at random.
It just needs to keep track of which settlers are currently builders.
My latest idea is to create massive arrays to test the limit of how much memory can be used before the game crashes. Too bad the game can't use all 32Gb available and is likely limited to 3.25Gb.
SkyOne578
Skirmisher
posted 04-29-17 08:49 AM
EDT (US)
21 / 23
@Panmaster2014 : ah, that's why you said "lightweight" in the reference. I used to use this function in many scenarios to avoid doing complicated things. I imagine that using this function all the time is a bad idea for advanced AIs... So you'll not do anything else till you solved this issue ?
@Loggy : so, in your opinion, there's no fix to the build plans bugs ? I don't understand well.
@YouTwo : but why do you need to test memories ? I don't see how can it solve the problem (or I didn't understand something). Can you explain me ?
Panmaster2014
Skirmisher
posted 04-29-17 01:11 PM
EDT (US)
22 / 23
Most of the descriptions such as "lightweight" are straight from Ensemble themselves, most dating back to AOM.
@Loggy. Placements do work nicely. They use event handlers. I have used them with aiUnitTaskBuild() already although they always build backwards facing. Trying to manipulate placements created by build plans results in the build plans failing.
Knowing memory limits could be useful. There's all sorts of useful data that could be stored in arrays that would save on running queries. The game is barely using 350mb at the moment.