Re: Forthwind.AI (Version 1.51)
Posted: Mon Apr 19, 2021 6:17 pm
When updating your AI, it is good to drop an extra post because most people will otherwise not notice.
- REACTIVE-GATHERING is defconsted once, and then it is also defconsted inside the individual population-dependent constants. I commented out the first instance.
- #load-if-defined POPULATION-CAP-200 is true even for 225 pop cap!
For all those populations you can also add an extra line:
#load-if-defined POPULATION-CAP-EXTENDED
My personal advice is to replace this system with a goals system: up-get-fact resource-amount amount-unit-limit gl-pop-cap
and then do maths with it. You may want to not do this right now, but keep the idea in mind.
So, I added the ...EXTENDED line once, surrounding all pop caps > 200, and kept on debugging.
- In Gathering.per, line 1268 rule too long. I split it in two.
- Camps.per, line 98, town-center-foundation is not defconsted.
So, I took a load of constants from The General, and I also put a line to load UserPatchConst.per. This is included with Userpatch download, but it is basically in the folder of practically every UP AI.
Surprisingly, I discovered that you have defconsted Condottiero and Slinger. I recommend that you do not defconst already defconsted things (like Castle, Villager, Mill, and in the case of DE, Condottiero).
I commented out all those things. You could perhaps rename these constants, or simply let them be with their unitID. But it is a troublesome part of the code and you should have a look. Most of these constants are already defconsted units, but a bunch of them are not. For those, you need to come up with an idea to avoid possible interactions.
For example (defconst feudal-skirmishers elite-skirmisher).
Since this constant is used in strategy selection (I think), then all you need is it to not overlap with other constants in this area. elite-skirmisher is not a value of any other constant of this group
I then discovered that you have condottiero and condottiero-placeholder defconsted again (this time with their true unit ID). I removed them since I believe they are not needed.
Then, I saw that in Gathering.per, line 1134, goal ARCHER shows ARCHER as invalid.
Well, guess what, a goal ID cannot be 0. Archer ID is 0.
I stopped at this point.
- REACTIVE-GATHERING is defconsted once, and then it is also defconsted inside the individual population-dependent constants. I commented out the first instance.
- #load-if-defined POPULATION-CAP-200 is true even for 225 pop cap!
For all those populations you can also add an extra line:
#load-if-defined POPULATION-CAP-EXTENDED
My personal advice is to replace this system with a goals system: up-get-fact resource-amount amount-unit-limit gl-pop-cap
and then do maths with it. You may want to not do this right now, but keep the idea in mind.
So, I added the ...EXTENDED line once, surrounding all pop caps > 200, and kept on debugging.
- In Gathering.per, line 1268 rule too long. I split it in two.
- Camps.per, line 98, town-center-foundation is not defconsted.
So, I took a load of constants from The General, and I also put a line to load UserPatchConst.per. This is included with Userpatch download, but it is basically in the folder of practically every UP AI.
Surprisingly, I discovered that you have defconsted Condottiero and Slinger. I recommend that you do not defconst already defconsted things (like Castle, Villager, Mill, and in the case of DE, Condottiero).
I commented out all those things. You could perhaps rename these constants, or simply let them be with their unitID. But it is a troublesome part of the code and you should have a look. Most of these constants are already defconsted units, but a bunch of them are not. For those, you need to come up with an idea to avoid possible interactions.
For example (defconst feudal-skirmishers elite-skirmisher).
Since this constant is used in strategy selection (I think), then all you need is it to not overlap with other constants in this area. elite-skirmisher is not a value of any other constant of this group
I then discovered that you have condottiero and condottiero-placeholder defconsted again (this time with their true unit ID). I removed them since I believe they are not needed.
Then, I saw that in Gathering.per, line 1134, goal ARCHER shows ARCHER as invalid.
Well, guess what, a goal ID cannot be 0. Archer ID is 0.
I stopped at this point.