Page 5 of 16 FirstFirst 123456789101112131415 ... LastLast
Results 81 to 100 of 309

Thread: Ask and Answer all about Campaign AI stuff

  1. #81

    Default Re: Ask and Answer all about Campaign AI stuff

    Quote Originally Posted by Junaidi83 de Bodemloze View Post
    Here some breaking discovery i get from Sir Opus, its appear we may able to control BAI via scripting ,here current pm he sent to me

    AI routing modifier
    ;-) Solved the units routing problem in battle when outnumbered:

    script/lib/lib_battlemanager.lua: down under routmanager:

    -- rout manager performs its internal check
    function battle_manager:check_rout_manager()
    local alliances = self:alliances();


    local non_routing_enemy_units = num_units_routing(alliances:item(2));
    local non_routing_allied_units = num_units_routing(alliances:item(1));

    if non_routing_enemy_units < self.rout_threshold and non_routing_allied_units > non_routing_enemy_units * 2.5 then
    return true;
    end;


    return false;
    end;

    Change the 2.5 in any bigger number you want..

    Greetz.


    While this stuff itself for help BAI, its clearly give us new world to explore, perhaps one of this script contain the cure to fix AI Hun problem that refused to attack walled settlement despite other AI can done it. I suspect there is value that prevent Hun to do that, i already search db but never found it,even almost give up seaching it.

    I ask every one of you to look on Data.pack and located the script tables, which contain many lib file, perhaps from one of this there is one that contain the answer. Even there is no fix , maybe we can find another new discovery to modify AI behaviour from script as well.

    You know turn AI into chicken perhaps, abrakadabra
    Are you going to implement this into your mod? Or suggest to Radious/FOTE teams? WE MUST USE ALL THE INFORMATION!

    (Feel I made a reference there but didn't understand it. )
    Last edited by Delicate Strawberry; May 16, 2015 at 03:42 PM.

  2. #82
    Junaidi83 de Bodemloze's Avatar Dont Mess With Me
    Join Date
    Feb 2011
    Location
    Indonesia
    Posts
    2,616

    Default Re: Ask and Answer all about Campaign AI stuff

    Already to late too implement it for now sadly, perhaps on next update. This is actually BAI part, which most people believe unmoddable, perhaps we just dont know where the location to edit it. Anyways like Columbus , Sir Opus already found new world, worthy to doing exploration in this uncharted territory.

    Who know what will we found.
    Modding is like accursed wine, you try a sip and you ended empty the whole glass
    Under Proud Patronage of Shankbot de Bodemloze

  3. #83

    Default Re: Ask and Answer all about Campaign AI stuff

    It could be dangerous and better left undiscovered.

    Sir Opus, you're our only hope.

  4. #84
    SharpEyed's Avatar Be Fair and Thankful!
    Join Date
    Oct 2013
    Location
    the Vale of Tears
    Posts
    3,384

    Default Re: Ask and Answer all about Campaign AI stuff

    Quote Originally Posted by Delicate Strawberry View Post
    It could be dangerous and better left undiscovered.
    That's why you will always lose! -.-


  5. #85

    Default Re: Ask and Answer all about Campaign AI stuff

    Quote Originally Posted by SharpEyed View Post
    That's why you will always lose! -.-

    Thankfully I'm joking, exploration can only lead to great things.

  6. #86

    Default Re: Ask and Answer all about Campaign AI stuff

    Does the better missiles/artillery need updated every time new Radious units come out, or is it a general effect that is applied to every unit and won't need updated?

    Forgive my lack of modding knowledge. I look forward to the day I can finally mod something myself and contribute.

  7. #87
    Junaidi83 de Bodemloze's Avatar Dont Mess With Me
    Join Date
    Feb 2011
    Location
    Indonesia
    Posts
    2,616

    Default Re: Ask and Answer all about Campaign AI stuff

    Nope, unless Radious create new custom made missile type every time he release units.Which i doubt it he will do that
    Modding is like accursed wine, you try a sip and you ended empty the whole glass
    Under Proud Patronage of Shankbot de Bodemloze

  8. #88

    Default Re: Ask and Answer all about Campaign AI stuff

    Ah, thank you. I assumed it would be that way. I shall be keeping it activated then.

  9. #89

    Default Re: Ask and Answer all about Campaign AI stuff

    Modding Routing behaviour of units:

    You can edit the battle.script in Script/lib/lib_battlemanager.lua and you can change also the routing or attacking behaviour under the ROUTE MANAGER (all the way down, f.e. change the 2,5 in any number you like agressive or passive units behaviour.

    This is the subroutine for routing you are looking for:

    -- rout manager performs its internal check
    function battle_manager:check_rout_manager()
    local alliances = self:alliances();


    local non_routing_enemy_units = num_units_routing(alliances:item(2));
    local non_routing_allied_units = num_units_routing(alliances:item(1));

    if non_routing_enemy_units < self.rout_threshold and non_routing_allied_units > non_routing_enemy_units * 2.5 then
    return true;
    end;


    return false;
    end;

  10. #90

    Default Re: Ask and Answer all about Campaign AI stuff

    Modding battlebehaviour of units:

    lib_script_ai_planner.lua. Here you can change all kinds of attackoptions, active behaviour, distance, time between attacks and reorder attacks, create your own booleans, triggers (need also export.triggers) and callbacks. The Ai is scripted to attack every 15 seconds if a platoon still has units left and status standing around its reorderd at 30 secs for defenders. You can changes this to 45 seconds by "reorder_interval"=45000 f.e. Note : This will slow down the whole battle btw.

    The defend radious is 25 mtrs from the startingvector.position. You can change this to 20,15 whatever so units want go to far from the defence line (seemngly coutnerattacking).


    This is the subroutine that changes the defenders into attackers:

    function script_ai_planner:attack_force(enemy_force, reorder, defend_radius)


    -- should we attack or actually defend
    local function_name = "attack_force()";
    local should_defend = false; ****** If true; defenders defend QQ

    if should_defend then ****** True; defenders defend QQ
    self.current_order = SCRIPT_AI_PLANNER_DEFEND_FORCE;
    self:defend_position_of_sunit(closest_enemy, defend_radius, nil, true);
    else
    self.current_order = SCRIPT_AI_PLANNER_ATTACK_FORCE;
    self:move_to_position_of_sunit(closest_enemy, nil, false, true);
    end;

    To make things more difficult the script AI_Planner_Defend_force is set to attack (subroutine 10):

    "
    function script_ai_planner:defend_force(enemy_force, radius) self:attack_force(enemy_force, false, radius);
    end;
    "
    So this seems on purpose or I am missing a reference to another routine from the move to position routines.

  11. #91

    Default Re: Ask and Answer all about Campaign AI stuff

    Defending radius:

    This routine seems to let the defenders go out 25 mtrs from their initial (pos, radius) starting defending point before returning back to ther inital pos/radios/nil/vector. Maybe you can lower this too f.e. 15 mtrs and see the effect.

    Routine:
    Name "function script_ai_planner:defend_position_of_sunit(sunit, radius, rout_callback, internal)"


    Context:
    -- watch for our target unit moving and update if it moves too far away from our current destination
    self.bm:watch(
    function()
    return sunit.unit:position():distance(self.current_dest) > 25
    end,
    0,
    function()
    self:defend_position_action(sunit.unit:position(), radius)
    end,
    self.name

  12. #92

    Default Re: Ask and Answer all about Campaign AI stuff

    Making agressive AI. No passive factions (half agressive, 1/2 defensive and with differences in expansion and opportunist behaviour. I tested this and it gives a whole different gameplay. From the start of the game fe. Geats conquer Jutes. Danes help Jutes, Danes conquer Capital Geats, Geats conquers capital Danes.Langobards have conquered Marcomans and a Roman City. The passive puppetstates from Sassanid and ERE are fighting alongside with their majorallieforces. Picts have finally smashed (their old good oh so boring passive friend) Caledonians and is now the major power in Britian next to Britiain itself. WRE keeps reconquering their cities. Septimania and Gaul allied and hold their ground. No faction is passive anymore, the Target Coaltion works marvelous. so multiple forces attack together from different factions all over the place.

    The mainbehaviour of these Factions is organised in CAI_personalities, column 12 to 24. I am using the Oeconomiamod and the Better-AI mod from Bodemloze and finetuned the tables. The taskgeneratorprofilecolumn has the most effect as also the Column that organises the Character of a Nation Expansionist, Opportunist, Defensive, agressive, and all sorts of combinations of these characeristics. These characteristics also show up in the prescription when you click on a Faction in Game. You can ofcourse leave some friendly or diplomatic_friendly but than adjust the agressiveness and budget, so they are not steamrolled and are capable of joining/helping you in battles.

    Furthermore I edited some battlescripts and the Startposvariables (CAI_variables) so Factions disable_resettle=false and can and are resettling in my game and I enabled the Agression Ramp in CAI_VARIABLE_AGRR_RAMP_ENABLED = 1

    Well so far I am enyoying my game a lot because of all the new things that are happening and the world looks different from every othter Attilla game I have played before. For the modders you might try some of this, if you don't already have...

    Greetz
    T
    Last edited by OpusDei; May 17, 2015 at 12:21 PM.

  13. #93

    Default Re: Ask and Answer all about Campaign AI stuff

    There is a scripterror somewhere in the original game that makes Armies, lots of stacks not attack Cities with strong walls. So far I have not found this entry, script or db settings, will look further into it.

  14. #94
    Junaidi83 de Bodemloze's Avatar Dont Mess With Me
    Join Date
    Feb 2011
    Location
    Indonesia
    Posts
    2,616

    Default Re: Ask and Answer all about Campaign AI stuff

    Keep doing what you doing mate
    Modding is like accursed wine, you try a sip and you ended empty the whole glass
    Under Proud Patronage of Shankbot de Bodemloze

  15. #95
    SharpEyed's Avatar Be Fair and Thankful!
    Join Date
    Oct 2013
    Location
    the Vale of Tears
    Posts
    3,384

    Default Re: Ask and Answer all about Campaign AI stuff

    Quote Originally Posted by OpusDei View Post
    There is a scripterror somewhere in the original game that makes Armies, lots of stacks not attack Cities with strong walls. So far I have not found this entry, script or db settings, will look further into it.
    that's what we need to find, alongside 'lots of stacks not attacking horde armies' problem

    and good job for managing to let Germanic/Celtic etc factions fight with each other (which they don't do mostly, unless some of them are Hordes, instead settled), for Better CAI mod there is only Agressive and Expansionist faction leader traits atm, no Defensive nor Opportunist, but your test shows we do need them

    btw is it possible for you to share changed parts of the mod in submod section?
    Last edited by SharpEyed; May 17, 2015 at 02:11 PM.

  16. #96

    Default Re: Ask and Answer all about Campaign AI stuff

    Will do sharp, but coming days work and next weekend on a familytrip. But in between maybe I can extract some tables, scripts and post them on mediafire and a link in the submod section.

    greetzz

  17. #97
    SharpEyed's Avatar Be Fair and Thankful!
    Join Date
    Oct 2013
    Location
    the Vale of Tears
    Posts
    3,384

    Default Re: Ask and Answer all about Campaign AI stuff

    Quote Originally Posted by OpusDei View Post
    Will do sharp, but coming days work and next weekend on a familytrip. But in between maybe I can extract some tables, scripts and post them on mediafire and a link in the submod section.

    greetzz
    ah ok have a good trip mate

    Btw I've also seen defense script/s, and obviously that's not working as well as Rome 2's, idk if you/we can fix it or anyone else (this modder seem to be experienced about it http://www.twcenter.net/forums/showt...1#post14517011)
    dammit man too much to fix, CA was suppose to be doing these fixes in the 1st place.

  18. #98

    Default Re: Ask and Answer all about Campaign AI stuff

    I was just thinking that it may have to do with the limitation of armies that can engage, the other stacks than will be seen as obsolete in the chance calculation.

  19. #99

    Default Re: Ask and Answer all about Campaign AI stuff

    I think CA has improved a lot, they have a new programmer that is very smart and logical programming the subroutines and variables. The defence routine shows that passive defending is no more... so i think a step ahead, but to get it right it takes a lot of testing. Also the battleprogrammer from CIA left a whole lot open for modding. So I gues that is now our job..

  20. #100
    SharpEyed's Avatar Be Fair and Thankful!
    Join Date
    Oct 2013
    Location
    the Vale of Tears
    Posts
    3,384

    Default Re: Ask and Answer all about Campaign AI stuff

    Quote Originally Posted by OpusDei View Post
    I was just thinking that it may have to do with the limitation of armies that can engage, the other stacks than will be seen as obsolete in the chance calculation.
    Might be, idk, but one thing is certain for sure: They tried to make a Better Ai, but ended up making even worse..
    And much more complex, so things are much harder to fix, tons of related things, you find one but you need to find other ones to fix completely.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •