Jump to content


Photo

AI Q & A


  • Please log in to reply
111 replies to this topic

#21 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 11 June 2007 - 11:45 PM

I wasn't sure if this was better posted here or at BfME2, but here it is:

The AIBehavior for Attack/Defense as well as TeamRecruitment and UpgradePriorities are severly flawed for BfME2. Altering the entries in the few AI ini files has been a hassle with no notable changes.

Now. I want to ask if anyone has tried to implement the BfME1 Scripts for these things into BfME2. It would be grand to reinstall that much control over AI strategy as BfME1 had. Before i try anything in that area i would appreciate any comment on these things.

At least 4 library files are being read and used: ai_men of the west.map, multiplayer_start_teams.map, multiplayer_human.map and music_musicscripts_single.map. Not all of it's contents seem to be relevant, as there are still some Gondor/Rohan/ElderRaces references left. Also the whole object-definitions are not complete, so i guess they are not used either.

The SpellPurchase-Scripts in ai_men of the west.map seem to work. The music-scripts work 100% as i have been restructuring this script collection intesively and all of my new scripts take effect. But that was no surprise as it had been redesigned using the new 'MultiSound' definitions.

I am a bit at a loss with this stupid AI. :p

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."


#22 Radspakr Wolfbane

Radspakr Wolfbane

    The John Farnham of modding

  • Members
  • 7,722 posts
  • Location:less than 5 meters from my bed
  • Projects:Comeback tour
  •  The Retired Beard

Posted 14 June 2007 - 05:53 AM

I'm just guessing but the AI should work if you put in there and refernce it though you might have to remove the coded AI.But since I am a novice at BFME2 this is just me guessing as the it runs on the same engine it should work try it out and post back with the results.

Break dancing into the hearts of millions


#23 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 14 June 2007 - 06:37 AM

Would i simply have to remove any unit and hero references in the skirmishAI-file to deactivate the hardcoded AI? Is it that simple? :p Well i am certainly going to try this. It will be weeks before i get to it. If i should get the first simple things to run on a sample map i will get back to you. Hopefully all yo BfME1-AI coders can answer any questions i have. Now it doesn't look so daunting anymore. ;)

Thx for the hint, 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."


#24 Radspakr Wolfbane

Radspakr Wolfbane

    The John Farnham of modding

  • Members
  • 7,722 posts
  • Location:less than 5 meters from my bed
  • Projects:Comeback tour
  •  The Retired Beard

Posted 14 June 2007 - 11:46 AM

make sure you back up the files becaise I could be wrong but it should work.

Break dancing into the hearts of millions


#25 Hebblewhite

Hebblewhite

    Artificially Intelligent

  • Project Team
  • 131 posts
  • Location:North Wales, UK
  • Projects:WOP-AI (bfme AI plugin), Darkness Rising, Rhovanian Alliance
  •  Mysterious AI Guy...

Posted 18 June 2007 - 03:24 PM

Hey guys!

Here's my AI tip of the day:

To improve the efficiency of Isengard Explosive Mine usage, simply remove the "NOT_AUTOACQUIRABLE" from the KindOf list in the "IsengardDeployedExplosiveMine" object.

This allows AI controlled beserker units to target the bombs with their torch ability (something that does not happen by default!). It's also the reason why AI opponents simply dance around your deployed mines whilst waiting for you to set them off instead of attacking them during skirmish matches... Enjoy!


Cheers,

Hebblewhite.
Reassuringly Expensive...

Blade with whom I have lived,
Blade with whom I now die,
Serve right and justice one last time,
Seek one last heart of evil,
Still one last life of pain,
Cut well old friend, and then... farewell


Posted Image

#26 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 18 June 2007 - 04:48 PM

Thx! :) I'll give it a try.

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."


#27 Lord_GoCha

Lord_GoCha
  • New Members
  • 1 posts

Posted 28 July 2007 - 09:26 PM

Hi all
>>>I found no AI Tutorial <<<
So theres my Question :
Has anyone a AI Tutorial??
It should be a AI for my own mod so also for new added factions and I'm new in AI modding and so it should be for beginners. I heard it shouldnt be easy, but i want to try it and i would be very pleased if anyone could help me .
:lol: And im sorry for my bad english :good:

Thanks for replys

#28 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 28 July 2007 - 09:47 PM

welcome to T3A :lol:

AI master Hebblewhite has posted some tutorials on the website. Check them out here
Software is like sex; it's better when it's free ~Linus Torvald

#29 Hebblewhite

Hebblewhite

    Artificially Intelligent

  • Project Team
  • 131 posts
  • Location:North Wales, UK
  • Projects:WOP-AI (bfme AI plugin), Darkness Rising, Rhovanian Alliance
  •  Mysterious AI Guy...

Posted 30 July 2007 - 09:09 AM

As it happens I'm working on a new "Custom Factions & AI" tutorial for BFME1. If anyone has any special requests in terms of instructional content I'll try to oblige!

This leads me to my second point... I'm working on a "WOP-AI Builder" plugin for BFME1 that will be a tool used to automatically generate worldbuilder script files... my plan is to firstly incorporate the AI systems of my WOP-AI mod and then release it as a general tool for everyone else to use with own stuff.

I'm looking for common trends and sripts etc that are worth setting up templates for... so any ideas at this poin are welcome!


Cheers!

Hebblewhite.
Reassuringly Expensive...

Blade with whom I have lived,
Blade with whom I now die,
Serve right and justice one last time,
Seek one last heart of evil,
Still one last life of pain,
Cut well old friend, and then... farewell


Posted Image

#30 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 17 August 2007 - 02:43 PM

Just found out something about testing the AI of BfME2.

- Start skirmish with at least three teams. You play solo on your team.
- Right at the start, demolish your fortress.
- The 'Defeated' screen comes up, but the game still continues with you being able to see everything. You can click on units/buildings as if they were your own and see upgrades and everything (including mouseover text). But you can't press any buttons. But you see exactly what the AI is building or if it just used any button and it is recharging.
- Sweet, eh?

Maybe this works for BfME1 as well.

:p

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."


#31 Radspakr Wolfbane

Radspakr Wolfbane

    The John Farnham of modding

  • Members
  • 7,722 posts
  • Location:less than 5 meters from my bed
  • Projects:Comeback tour
  •  The Retired Beard

Posted 17 August 2007 - 03:02 PM

yeah this happens it happens when bases don't work it cool to see how the AI plays.

Break dancing into the hearts of millions


#32 Radspakr Wolfbane

Radspakr Wolfbane

    The John Farnham of modding

  • Members
  • 7,722 posts
  • Location:less than 5 meters from my bed
  • Projects:Comeback tour
  •  The Retired Beard

Posted 20 August 2007 - 06:37 PM

A quick question my AI when using spawn abilities ignores range and can summon them anywhere on the field is there a way to fix this.

Break dancing into the hearts of millions


#33 Hebblewhite

Hebblewhite

    Artificially Intelligent

  • Project Team
  • 131 posts
  • Location:North Wales, UK
  • Projects:WOP-AI (bfme AI plugin), Darkness Rising, Rhovanian Alliance
  •  Mysterious AI Guy...

Posted 28 August 2007 - 01:40 PM

A quick question my AI when using spawn abilities ignores range and can summon them anywhere on the field is there a way to fix this.


Hmmm. I've never seen my AI system ignore ranges before. Are you sure you haven't missed something in your INI code ? If you play as that character yourself, you definitely can't summon your stuff anywhere on the map...? (Just asking really... because my AI system has never done that before...).

Anyhow, you can exert some control over whats going on in other ways. It's all about where you "direct" the unit to summon the objects. I'd recommend something like this:

*** IF ***
	 Team '<This Team>' has Greater Than threat level 10.00 within radius 200.00
	*AND*  Player '<This Player>''s Team '<This Team>' are ready to use Ability 'Command_SpawnElrondElves' (at least one member).
*** THEN ***
   Player '<This Player>' fire Special power 'SuperweaponSpawnElrondElves' on nearest object of 'CombatAreas' to Team '<This Team>'

Since we're using a threat assessment as the main deciding factor, there needs to be a credible threat at a relatively close distance to the character before the action end of the script is activated. This helps us to avoid the tendancy for long ranged attacks/summons...

Also, the above script will force the character to summon a bunch of elves at the nearest Combat Area on the map. This one is probably most appropriate for you, since it forces the summon at the NEAREST combat node... this means that it's impossible for the summon to occur on the other side of a map due to the relative spread of combat nodes... give it a whirl, I reckon it should solve your problem.

Alternatively, if you want to be more sneaky, you could go with this:

*** IF ***
	 Player '<This Player>''s Team '<This Team>' are ready to use Ability 'Command_SpecialAbilitySarumanRainOfFire' (at least one member).
	*AND*  Player '<This Player>''s Team '<This Team>' are ready to use Ability 'Command_SpecialAbilitySarumanRainOfFire' (at least one member).
*** THEN ***
   Player '<This Player>' fire Special power 'SpecialAbilitySarumanRainOfFire' at enemy's most costly area.

The above summons your objects right at your opponents most costly area... this usually means on top of large gatherings of units :p

This doesn't necessarily help you with the range factor here of course... but there's nothing like a meaty surprise attack to get things going nicely! :)


Cheers,

Hebblewhite.
Reassuringly Expensive...

Blade with whom I have lived,
Blade with whom I now die,
Serve right and justice one last time,
Seek one last heart of evil,
Still one last life of pain,
Cut well old friend, and then... farewell


Posted Image

#34 cahik_

cahik_

    Sage engine ruler

  • Project Team
  • 1,896 posts
  • Location:Czech Republic
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member and Crazy animator

Posted 28 August 2007 - 02:54 PM

i love that guy. from what you say AI looks so easy and understandable which it isnt unfortunatly :)

Posted Image

Posted Image
Posted Image


#35 Hebblewhite

Hebblewhite

    Artificially Intelligent

  • Project Team
  • 131 posts
  • Location:North Wales, UK
  • Projects:WOP-AI (bfme AI plugin), Darkness Rising, Rhovanian Alliance
  •  Mysterious AI Guy...

Posted 28 August 2007 - 04:08 PM

i love that guy. from what you say AI looks so easy and understandable which it isnt unfortunatly :)


LoL. I'm not quite sure how to take that! :p
Reassuringly Expensive...

Blade with whom I have lived,
Blade with whom I now die,
Serve right and justice one last time,
Seek one last heart of evil,
Still one last life of pain,
Cut well old friend, and then... farewell


Posted Image

#36 Radspakr Wolfbane

Radspakr Wolfbane

    The John Farnham of modding

  • Members
  • 7,722 posts
  • Location:less than 5 meters from my bed
  • Projects:Comeback tour
  •  The Retired Beard

Posted 29 August 2007 - 04:47 AM

Thanks I think I may have fixed the problem a couple of days ago but I haven't gotten around to testing.
Though that last thing did give me some ideas.
From my expereince AI isn't too hard it's just really time consuming... really really time consuming it especially bad when you have 14 factions to do :p.

Break dancing into the hearts of millions


#37 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 15 November 2007 - 05:17 PM

Please take a look at this:

AIScripts.jpg

Yes, you are right, it's Mordor's AI for BfMe1. So i have a couple of questions regarding this collection of scripts.
- There are a lot of uneditable 'imported' scripts. Yes i saw that some of them get overridden depending on the existence of Faction specific variant (inside the top folder). What i don't quite get is how you set this kind of status for scripts/folders. If i export scripts and then import them into another map-file, the scripts don't show up as uneditable or even as imported. This might not seem really important, but i'd still like to know how this is done. If any of you have an idea or even a definite solution, please do tell. :thumbsupsmiley:
- Although the scripts show clearly how Spells are purchased, there is no indication how the AI figures out when and where to use them. This is rather strange considering that every other object under the AI's control uses scripts to collect them into teams, to set their status and general behavior and formations, to trigger their special powers, everything (as can be glimpsed at by you just by reading the imported library-folders' names). How does the AI use the spells, which are basically SpecialPowers of one of the 'SpellBook' objects?? I'd very much appreciate it, if you could share your knowledge on those. At least it would be nice if you could give me a hint where to look for the trigger and target conditions.

Thanks for reading. This might help me get EM1's MoriaAI working, finally. :rolleyes:


...
This leads me to my second point... I'm working on a "WOP-AI Builder" plugin for BFME1 that will be a tool used to automatically generate worldbuilder script files... my plan is to firstly incorporate the AI systems of my WOP-AI mod and then release it as a general tool for everyone else to use with own stuff.
...
Hebblewhite.


This is a great plan! Is it still current, or have you abandoned the project? I would really like something cool like that to be released. When i am done building a custom AI on my own, i might be knowledgable enough to help you out on this one. :)

Sûl.

Edited by Sûlherokhh, 15 November 2007 - 05:19 PM.

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."


#38 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 15 November 2007 - 06:15 PM

Hehe, i am so stupid. It seems the uneditable, imported scripts are taken directly from the libraries in the main game folder upon load. If i go directly into bfme1's spell-libraries, the execution scripts are right there. :thumbsupsmiley: (Note: i don't have BfMe1 installed, only BfMe2)

That still leaves the question of how i can tell a map-file's script collection to import current existing libraries upon load automatically. The system is quite good since the singular components are dynamically incorporated, but i still have no idea how.


Edit: I am more and more convinced that it is quite practical to implement BfMe1's scripted AI for BfMe2 step by step, even though some elements are bound to be pretty difficult (Economy for instance, and Strategies with maps missing most of the tactical flags and areas that all BfMe1 maps contain, but not BfMe2's).

Edited by Sûlherokhh, 15 November 2007 - 06:22 PM.

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."


#39 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 18 November 2007 - 05:52 AM

This is just to let you know that i successfully implemented sections of the BfMe1 AI to BfMe2. I am sure the rest is likely to follow without much problems in the future. As mentioned, Economy and Basebuilding may prove hard to tackle, but i have the feeling it should work too. Wish me luck. That's gonna be a long time project.

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."


#40 Radspakr Wolfbane

Radspakr Wolfbane

    The John Farnham of modding

  • Members
  • 7,722 posts
  • Location:less than 5 meters from my bed
  • Projects:Comeback tour
  •  The Retired Beard

Posted 18 November 2007 - 02:52 PM

Nice work.
Getting the AI to build buildings will be rather difficult but it should be possible.
Scripted AI is more flexible then Coded AI but is a lot harder.
I'm curious to see if you can improve on the AI for BFME2.

I don't do much for BFME2 but do you think it's possible to code the AI for BFME?.

Break dancing into the hearts of millions





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users