Jump to content


Photo

[BFME2] Make AI work with the BFME I bases


  • Please log in to reply
69 replies to this topic

#1 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 27 September 2009 - 01:33 PM

Hi!

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. :p

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 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 27 September 2009 - 02:14 PM

Post what codes you now have in SkirmishAIData

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 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 27 September 2009 - 07:06 PM

Hi JUS_SAURON :popcorn:

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 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 27 September 2009 - 07:38 PM

AI with the changes:
- Men and mordor AI get bases unpacked on all maps (BFME1 and custom maps) = GOOD :popcorn:

- Mordor AI then attacks with the heroes and the starting units (but it does NOT build any buildings or does something else)

Change this :



CODE
DisableBaseBuilding = Yes ; No
DisableEconomyBuilding = No
DisableUnitBuilding = No
DisableScienceUpgrading = No
DisableUnitUpgrading = No
DisableTacticalAI = No
DisableTeamBuilding = No
DisableWallBuilding = No


or even DisableBaseBuilding = No

and see what it does

#5 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 28 September 2009 - 02:36 PM

Tried both.

No considerable increases of the AI activity.

#6 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 28 September 2009 - 02:40 PM

How about removing the Uppercase (B,S,D,A) letters? :popcorn:
Ridder Geel

#7 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 28 September 2009 - 02:54 PM

Effect of lowercase: AI does seems to do less (e.g. Mordor AI does not build heros anymore).

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 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 28 September 2009 - 03:00 PM

im not sure but i think you also need to edit...
\data\ini\default\SkirmishAIData.ini :popcorn:
Ridder Geel

#9 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 29 September 2009 - 03:47 PM

No, i don't think so.

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 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 29 September 2009 - 05:12 PM

Its worth a try, but if you say thats not the problem then... find something else :huh: (some other AI file) maybe the buttons need to be changed and such? :p
Ridder Geel

#11 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 29 September 2009 - 10:58 PM

Aidata.ini

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 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 01 October 2009 - 05:30 PM

Yeah, could try the thing making the BFME2 AI using the Commandset of the building plots. But then the AI would always build the same buildings. If it worked it would only be a 2nd-class solution.

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:

Player_1/l_Econ - Current Construction Site Buildable = 1

BFME2:

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 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 01 October 2009 - 05:39 PM

Hi Rimli, nice for you to pop in (which i am doing as well after several months absence).
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.

bannerreal01mittelit3.jpg
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 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 01 October 2009 - 06:01 PM

Hi Sûl!

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 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 02 October 2009 - 04:19 PM

Changed the script above for test purposes so that also in BFME2 Current Construction Site Buildable flag toggles to 1:

*** 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 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 02 October 2009 - 08:37 PM

I'll reinstall my games in the next week. I can tell you more after having a good look at the libraries. My guess is that the scripts can't find the potential construction site and so is unable to assign the pointer 'AI_CURRENT_CONSTRUCTION_SITE' to any location.
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.

bannerreal01mittelit3.jpg
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 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 02 October 2009 - 10:41 PM

Hmm sounds difficult and I hardly understood something. ^^

I also guessed that something with the CURRENT_CONSTRUCTION_SITE does not work but I had no more idea to tackle the problem.

#18 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 30 October 2009 - 06:10 PM

Hey Sûlherokhh!

Did you look at the AI in the meantime?
Would be nice to hear from you again (no matter what you will say ...) ;)

#19 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 30 October 2009 - 06:59 PM

No, i just got back into modding and so i am not yet in the place where i do more than guess around and start small. I just modded-in a new button for S.E.E. in an hour and with that took my third step back into business. I'll try to focus on that for now, but sure as hell i will always have the AI in my mind. Mostly it concerns other things than reviving SkirmishAI_1. Until next year at least.

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.

bannerreal01mittelit3.jpg
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 Rimli

Rimli
  • Hosted
  • 117 posts
  • Location:Germany
  • Projects:BfME 1½ Mod

Posted 01 November 2009 - 12:04 AM

OK, thanks for the answer.

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users