[BFME2] Make AI work with the BFME I bases
#1
Posted 27 September 2009 - 01:33 PM
I've a big problem. I took the BFME I bases back to BFME II.
The problem is, that the BFME II AI does not work anymore with the bases.
I read the tutorial from Sûl about the BFME II AI carefully and finally deactivated everything of the BFME II AI in the skirmishaidata.ini and recopied the entries for the BFME I libraries in the playeraitypes.ini
Now the AI gets bases on every map, the Mordor AI does also use the Eye-spell and builds heroes and then attacks with the heroes and starting units. But there are no buildings build by the AI, neither by the gondor AI nor by the mordor AI. :(
Do you have an idea which scripts I have to change? Is it useful to deactivate the BFME II AI at all and try the BFME I AI or would prefer to change the BFME II AI that it builds on the building plots (acutally I noticed that the BFME II AI does NOTHING when it does not have a BFME II fortress ...)
Would be happy for help.
#2
Posted 27 September 2009 - 02:14 PM
is this the only file you've changed ??
I've not done AI Coding but is willing to help as I also have used BFME1 bases in my maps
#3
Posted 27 September 2009 - 07:06 PM
Ok, here a up-to-date state about the AI with the mod:
When I change nohting the BFME2-AI does unpack bases for men (gondor) on original BFME1 maps. Mordor gets no base unpacked -> instant loss of the AI player.
Men get no base unpacked on custom maps -> instant loss of the AI player.
The men AI on the BFME1 maps does not show any reaction: it does not use any spells, does not build buildings or units.
Then I changed some ini-files:
- Added the BFME1 libraries to the mod.big
- Deactivated the BFME2 AI in the skirmishaidata.ini
;---------------------------------------------------------------------------------------------------- ; System Toggles ;---------------------------------------------------------------------------------------------------- DisableBaseBuilding = Yes;No DisableEconomyBuilding = Yes;No DisableUnitBuilding = Yes;No DisableScienceUpgrading = Yes;No DisableUnitUpgrading = Yes;No DisableTacticalAI = Yes;No DisableTeamBuilding = Yes;No DisableWallBuilding = Yes;No
- Replaced the BFME2 playeraitypes.ini with the playeraitypes.ini from BFME1 with the links to the BFME1 libraries:
PlayerAIType GondorAI LibraryMap = "Libraries\AI_Gondor\AI_Gondor.map" End PlayerAIType GondorSkirmishAI LibraryMap = "Libraries\AI_GondorSkirmish\AI_GondorSkirmish.map" End PlayerAIType GondorSPSAI LibraryMap = "Libraries\AI_GondorSPS\AI_GondorSPS.map" End PlayerAIType MordorAI LibraryMap = "Libraries\AI_Mordor\AI_Mordor.map" End PlayerAIType MordorSkirmishAI LibraryMap = "Libraries\AI_MordorSkirmish\AI_MordorSkirmish.map" End PlayerAIType MordorSPSAI LibraryMap = "Libraries\AI_MordorSPS\AI_MordorSPS.map" End PlayerAIType RohanAI LibraryMap = "Libraries\AI_Rohan\AI_Rohan.map" End PlayerAIType RohanSkirmishAI LibraryMap = "Libraries\AI_RohanSkirmish\AI_RohanSkirmish.map" End PlayerAIType RohanSPSAI LibraryMap = "Libraries\AI_RohanSPS\AI_RohanSPS.map" End PlayerAIType IsengardAI LibraryMap = "Libraries\AI_Isengard\AI_Isengard.map" End PlayerAIType IsengardSkirmishAI LibraryMap = "Libraries\AI_IsengardSkirmish\AI_IsengardSkirmish.map" End PlayerAIType IsengardSPSAI LibraryMap = "Libraries\AI_IsengardSPS\AI_IsengardSPS.map" End PlayerAIType IsengardSPSAI_DL0 LibraryMap = "Libraries\AI_IsengardSPS_DL0\AI_IsengardSPS_DL0.map" End PlayerAIType IsengardSPSAI_DL1 LibraryMap = "Libraries\AI_IsengardSPS_DL1\AI_IsengardSPS_DL1.map" End PlayerAIType Multiplayer_Human LibraryMap = "Libraries\Multiplayer_Human\Multiplayer_Human.map" End
- changed the AI link in playertemplate.ini for faction men:
DefaultPlayerAIType = GondorSkirmishAI;MenSkirmishAI
AI with the changes:
- Men and mordor AI get bases unpacked on all maps (BFME1 and custom maps)
- Men AI still does not show any reaction
- Mordor AI uses the Eye-Spell and builds witchking and custom hero
- Mordor AI then attacks with the heroes and the starting units (but it does NOT build any buildings or does something else)
#4
Posted 27 September 2009 - 07:38 PM
- Men and mordor AI get bases unpacked on all maps (BFME1 and custom maps) = GOOD
- Mordor AI then attacks with the heroes and the starting units (but it does NOT build any buildings or does something else)
Change this :
DisableEconomyBuilding = No
DisableUnitBuilding = No
DisableScienceUpgrading = No
DisableUnitUpgrading = No
DisableTacticalAI = No
DisableTeamBuilding = No
DisableWallBuilding = No
or even DisableBaseBuilding = No
and see what it does
#5
Posted 28 September 2009 - 02:36 PM
No considerable increases of the AI activity.
#6
Posted 28 September 2009 - 02:40 PM
#7
Posted 28 September 2009 - 02:54 PM
Hmm i think the first important thing is that the AI should build buildings.
Nobody here who knows about the AI scripts in the worldbuilder?
For example I wonder how exactly the AI knows what the "CURRENT_CONSTRUCTION_SIDE" is etc.?
#8
Posted 28 September 2009 - 03:00 PM
\data\ini\default\SkirmishAIData.ini
#9
Posted 29 September 2009 - 03:47 PM
There are only settings for the BFME2 skirmish AI, all I can do there is deactive some sections of the BFME2 AI in order to replace these with scripts from the BFME1 AI.
#10
Posted 29 September 2009 - 05:12 PM
#11
Posted 29 September 2009 - 10:58 PM
StructureSeconds = 0.0 ; Ai tries to build a new structure every N seconds.
TeamSeconds = 10 ;Ai tries to build a new team every N seconds.
Wealthy = 7000 ; Number of resources for the AI to consider itself wealthy
Poor = 2000 ; Number of resources for the AI to consider itself poor
ForceSkirmishAI = No ; Use skirmish instead of solo ai. For development till the skirmish ui is finished.
RebuildDelayTimeSeconds = 30 ; Delay this many seconds when a base building is destroyed or captured before attempting rebuild.
Maybe mess with some of these ....
In Bfme 1 the Building were on BuildPlots
Bfme2 is a build anywhere system
And now you are trying to get best of both worlds
In WB scripts I think you can set a button to unpack a building
You can use it to unpack / Build a barracks in the RohanCastleNE etc
Maybe bfme1 maps were script based as well ...
Try getting the Ai to USE the COMMANDBUTTONS that allow then to UNPACK / Build
a Building
Edited by JUS_SAURON, 29 September 2009 - 11:11 PM.
#12
Posted 01 October 2009 - 05:30 PM
All the codes you posted affect the BFME2 AI in general. Does not think that this would change the particular building issue.
As I mentioned a added the BFME1 libraries to BFME2 and deactivated the BFME2 AI.
Today I started a skirmish on the BFME1 Rohan map in both games and compared the script activity using "-scriptdebug2".
There is one interesting point in the script variables:
BFME1:
BFME2:Player_1/l_Econ - Current Construction Site Buildable = 1
Player_1/l_Econ - Current Construction Site Buildable = 0
That could be essential. I will try to get more to know about this variable.
#13
Posted 01 October 2009 - 05:39 PM
It's good to see you experimenting with AI stuff that i never got around to try. It's a big topic, so let me mention just one thing for now.
You put all 'DeactiveStuff' setting to 'yes'. That means all the other data in 'skirmishaidata.ini' is probably going to be irrelevant. Since you inserted the references to the old BfMe1 libraries, you will now have to adjust them.
Unit production is one example. Every single unit's and horde's Object-Name (e.g. RohanRohirrimHorde) needs to be listed in the Object-Lists of the libraries. In the production sections of every faction you will need to insert them as well. For that to work you will need to know exactly what every damn script actually does, so my advice: Install BfMe1 and play with the library BEFORE adpating any scripts to BfMe2.
Good luck for now...
Sûl.
Axed Head and A.I. Coder for S.E.E. and ... stuff
".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."
#14
Posted 01 October 2009 - 06:01 PM
Thanks for your answer.
I deactivated the whole BFME2 AI as it does NOTHING wihtout the fortress, but there will be surely no fortresses in my mod so I thought i try the BFME1 AI and as the BFME2 AI should not intervene, I deactivated it totally, as I read it on your big AI tutorial.
I already changed the BFME1 AI, you could look here: http://forum.modding...4.html#msg95574
I changed a script of the BFME1 AI:
*** IF *** Can player Player '<This Player>' build at base Unit 'AI_CURRENT_CONSTRUCTION_SITE' *** OR *** Flag named 'AI_On' IS TRUE *** THEN *** Set Flag named 'l_Econ - Current Construction Site Buildable' to TRUE *** ELSE *** Set Flag named 'l_Econ - Current Construction Site Buildable' to FALSE
but the Current Construction Site Buildable stays set as 0.
EDIT:
P.S. It's very brave to think that I could have not installed BFME1 and could have to install it before I can try the BFME1 AI. ^^
Edited by MotWlRimli, 01 October 2009 - 06:06 PM.
#15
Posted 02 October 2009 - 04:19 PM
*** IF *** Can player Player '<This Player>' build at base Unit 'AI_CURRENT_CONSTRUCTION_SITE' *** THEN *** Set Flag named 'l_Econ - Current Construction Site Buildable' to TRUE *** ELSE *** Set Flag named 'l_Econ - Current Construction Site Buildable' to TRUE
But the AI does still not build any buildings. Very annoying ... :-/
I add the logs from BFME2 and BFME1 when starting a skirmish on the BFME1 Rohan-Map, perhaps you want to have a look at it and notice something interesting.
Attached Files
#16
Posted 02 October 2009 - 08:37 PM
This may be a problem of correctly labelling the sites, on either the battle-map (for farms and lumbermills) or on the 'castle/outpost'.bse map file.
Axed Head and A.I. Coder for S.E.E. and ... stuff
".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."
#17
Posted 02 October 2009 - 10:41 PM
I also guessed that something with the CURRENT_CONSTRUCTION_SITE does not work but I had no more idea to tackle the problem.
#18
Posted 30 October 2009 - 06:10 PM
Did you look at the AI in the meantime?
Would be nice to hear from you again (no matter what you will say ...)
#19
Posted 30 October 2009 - 06:59 PM
But i encourage you to report on the things you are trying, and report on how they are failing (or how they are working! ). To that i can always comment, or even give advice.
One thing at least i can say about activating the old scripts: They must be reworked extensively.
- There are a lot of references to AI objects. Those objects need to be added (and named) to your test map (and to all other maps of course).
- The object lists must be updated with the actual object names used in the mod, so that categories like anti-archer make sense.
- Use the old libraries from BfMe1, not the files of BfMe2, which is missing a few vital scripts.
- All units need attack priorities. Those lists need to be updated with the current Object Names (or Object Lists).
- Objects need actual threat values (via the Object's Ini file or via a macro). EA set them all to a value of 1, and then used the AttackChains.
I'm watching and listening.
Sûl.
Axed Head and A.I. Coder for S.E.E. and ... stuff
".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."
#20
Posted 01 November 2009 - 12:04 AM
I am at the moment translating the mod into english but balancing and first bugfixing is fnished and then I will return to the AI again and post here what I perhaps will find out.