Page 1 of 3 123 LastLast
Results 1 to 20 of 50

Thread: Dummy governors to prevent AI bug

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Dummy governors to prevent AI bug

    In my mod I have around 40 regions divided among 2 factions. 20 regions each. Each faction has about 11 or 12 generals. I wish them to be active in the field attacking enemy forces. Grandviz informed me that the first rule that campaign AI follows is that it must put a commander into every settlement. So what happens is that the general from each stack exits the stack and moves to the nearest town to become a governor. This leaves captains in command of every stack.

    To combat this I came up with a plan; Create 'dummy governors' that represent 'local government'. Each government would be added as a named character in the descr_strat to a settlement. The dummy governor would have 0 movement points so that he will live in settlement for as long as he is alive. They should help to prevent generals leaving stacks to become governors and also I presume that having them will stop the AI adopting so many generals.

    Now as far as I can see there should be no problem implementing this. The problem is that I would like the dummy governors to be given only to the AI faction.

    So my question is, is there a way to kill-off a list of named characters at turn 0 before the player starts to play?

    Cheers
    Last edited by AlphaDelta; September 02, 2008 at 06:33 AM.
    "I don't want to sit around Windsor because ermm .. I just generally don't like England that much" - Prince Harry, 3rd in Line for the British Thrown



    For King or Country - The English civil wars.

  2. #2

    Default Re: Dummy governors to prevent AI bug

    Quote Originally Posted by AlphaDelta View Post
    So my question is, is there a way to kill-off a list of named characters at turn 0 before the player starts to play?
    There are at least two ways to do that: kill_character, and send_character_off_map (I think only for kingdoms).

    It is very easy at the beginning of the campaign, as in such case you completely control the names of the characters.

    However, in any of those methods the problem is that only the character is killed, not the units (not sure about the bodyguards). Perhaps this is what you want and then the method is perfect.

  3. #3
    Caesar Clivus's Avatar SS Forum Moderator
    Join Date
    May 2007
    Location
    Australia
    Posts
    12,693

    Default Re: Dummy governors to prevent AI bug

    Does the kill_character command still work?

    edit: I see Monkwarrrior is on the same page

    Actually if spawning dummy governors with high chivalry and no movement points works, it could be a good way to stop settlements rebelling from the AI just because the AI doesn't know the meaning of the word garrison. But then again I guess high chivalry would cause unwanted population growth..perhaps the trait that reduced movement points to zero could also give a +law bonus :hmmm:
    Last edited by Caesar Clivus; September 02, 2008 at 06:56 AM.

    BftB2 UPDATED 22nd DECEMBER. Member of the Complete Byzantine Unit Roster team

  4. #4

    Default Re: Dummy governors to prevent AI bug

    Quote Originally Posted by Caesar Clivus View Post
    Does the kill_character command still work?
    Yes with names with only one word.
    I must test the advice of GrnEyedDvl about putting the two-words names inside quotes.

  5. #5
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Dummy governors to prevent AI bug

    Quote Originally Posted by Monkwarrior View Post
    Yes with names with only one word.
    I must test the advice of GrnEyedDvl about putting the two-words names inside quotes.
    Well what GrnEyedDvl said about quotes is right, keep in mind you have to do the same thing for adding traits/ancs in console command when a general has two names.

    Cheers,
    Augustus

  6. #6

    Default Re: Dummy governors to prevent AI bug

    Thanks for the quick replies. I implemented the dummy governors on one side and played as the other. So far the result is perfect. I haven't seen a single case of a General leaving his men and only one case of a general and stack entering a friendly settlement. The reason for that I think was that the settlement is almost surrounded by enemy settlements and the garrison is weak.

    Does anyone have any example code for killing off characters at turn 0? I presume it would into campaign script?

    Cheers
    "I don't want to sit around Windsor because ermm .. I just generally don't like England that much" - Prince Harry, 3rd in Line for the British Thrown



    For King or Country - The English civil wars.

  7. #7

    Default Re: Dummy governors to prevent AI bug

    Quote Originally Posted by AlphaDelta View Post
    Thanks for the quick replies. I implemented the dummy governors on one side and played as the other. So far the result is perfect. I haven't seen a single case of a General leaving his men and only one case of a general and stack entering a friendly settlement. The reason for that I think was that the settlement is almost surrounded by enemy settlements and the garrison is weak.
    Would you mind to share this method with us?

    I'm also interested in such kind of system, as my own campaign is also two-factions campaign with focus on military tactics, not on building and recruiting.

  8. #8
    Caesar Clivus's Avatar SS Forum Moderator
    Join Date
    May 2007
    Location
    Australia
    Posts
    12,693

    Default Re: Dummy governors to prevent AI bug

    I'm a noob when it comees to scripting (but I'm learning ) but I'm guessing it would go something like:

    monitor_event FactionTurnStart FactionType factionname1
    and I_TurnNumber = 0

    kill_character "character name 1"
    kill_character "character name 2"
    etc etc
    terminate_monitor
    end_monitor

    Rinse and repeat for all factions.

    I'm sure there's a better way of doing it though

    BftB2 UPDATED 22nd DECEMBER. Member of the Complete Byzantine Unit Roster team

  9. #9
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Dummy governors to prevent AI bug

    Quote Originally Posted by Caesar Clivus View Post
    I'm a noob when it comees to scripting (but I'm learning ) but I'm guessing it would go something like:

    monitor_event FactionTurnStart FactionType factionname1
    and I_TurnNumber = 0

    kill_character "character name 1"
    kill_character "character name 2"
    etc etc
    terminate_monitor
    end_monitor

    Rinse and repeat for all factions.

    I'm sure there's a better way of doing it though
    That should work but you also need to use "FactionIsLocal" condition or it will kill the AI as well, which he isn't looking to do.

    Cheers,
    Augustus

  10. #10

    Default Re: Dummy governors to prevent AI bug

    Thanks gents. I've got the killing working ok. There's only 2 problems. As soon as the campaign starts you hear:

    "Arghhhhhhhhhhhhhhhhhh"

    No I'm not kidding!

    And because the AI has 20 more generals they get a huge wage increase. I fixed this by scripting the AI money worth the same value.

    However, in any of those methods the problem is that only the character is killed, not the units (not sure about the bodyguards). Perhaps this is what you want and then the method is perfect.
    It's killing the unit assigned to the named character also.

    Cheers
    Last edited by AlphaDelta; September 02, 2008 at 09:52 AM.
    "I don't want to sit around Windsor because ermm .. I just generally don't like England that much" - Prince Harry, 3rd in Line for the British Thrown



    For King or Country - The English civil wars.

  11. #11

    Default Re: Dummy governors to prevent AI bug

    Quote Originally Posted by AlphaDelta View Post
    It's killing the unit assigned to the named character also.
    Do you mean the unit working as bodyguard?
    It's curious. When I killed admirals, the fleet (1 boat only) remained intact. Only the name changed (admiral chosen among the sailors present in the boat).

  12. #12
    Opifex
    Join Date
    Feb 2005
    Location
    New York, USA
    Posts
    15,154

    Default Re: Dummy governors to prevent AI bug

    Do two things:

    Send_character_off_map will not cause any "Aaaargh!" sounds; and to prevent the off_map char from showing in your family_tree, create him as a general instead of family_member.

    Or move the characters off to a far corner of the map when you kill them, and then the sounds will not be heard.


    "If ye love wealth greater than liberty,
    the tranquility of servitude greater than
    the animating contest for freedom, go
    home from us in peace. We seek not
    your counsel, nor your arms. Crouch
    down and lick the hand that feeds you,
    and may posterity forget that ye were
    our countrymen."
    -Samuel Adams

  13. #13
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Dummy governors to prevent AI bug

    Quote Originally Posted by Monkwarrior View Post
    Do you mean the unit working as bodyguard?
    It's curious. When I killed admirals, the fleet (1 boat only) remained intact. Only the name changed (admiral chosen among the sailors present in the boat).
    Admirals function different than Generals, more like Captains. When you assassinate a Captain on the battle map, a new captain is put in place, the same works for admirals. This captain unit, and the admiral unit, are just any ol' boat/unit from the group that the captain is supposed to be in. The Bodyguard unit however doesn't exist without the General, which is where the difference lies, and why they go together.

    Cheers,
    Augustus

  14. #14

    Default Re: Dummy governors to prevent AI bug

    I've just remarked that it happens the same with any named character, even in case the bodyguard unit assigned is not a truly bodyguard. For example, I have some characters whose bodyguards are merchant cavalry militia, and the unit also disappears. This seems to be linked to the fact that the killed is a named character.

  15. #15
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Dummy governors to prevent AI bug

    This is the second time I have posted similar advice, you guys are thinking about this from the wrong direction. I wish I knew what caused that so I could fix it. Dont start from the end and work backwards, start at the beginning and work forwards, just like you do everything else in life.

    While doing it the way you are can be done, its MUCH easier to spawn new characters than to kill ones already in the game, and you wont get their death screams either.

    Start every faction with only a few generals, whatever you would want the player to start with.

    Then at FactionTurnStart FactionIsLocal check the faction ownership, and spawn new generals for all the other factions. You can stick them straight into the cities you want them in, and the code will be shorter. You dont have to know names, you can assign them random_name. Make sure you use the terminate_monitor so it only runs once.

  16. #16

    Default Re: Dummy governors to prevent AI bug

    Yes, you're right. But in my case I would like the kill_character command won't be used, because it is a sort of "punishment" for human player if he doesn't follow the instructions I'm giving him.

    In the case of admirals I need to kill them to prevent the human to use them again once they have been used for the right purpose.

  17. #17
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Dummy governors to prevent AI bug

    Right you are Monk. In that case doint something similar is the way to go. I just wanted to throw a few general logic principles in here.

  18. #18
    Caesar Clivus's Avatar SS Forum Moderator
    Join Date
    May 2007
    Location
    Australia
    Posts
    12,693

    Default Re: Dummy governors to prevent AI bug

    Quote Originally Posted by GrnEyedDvl View Post
    I just wanted to throw a few general logic principles in here.
    Logic? What is this "logic" that you speak of?

    Yeah spawning more makes a lot more sense than killing off existing ones. Got caught up in the whole stabby-stabby-kill-kill mentality of the game

    BftB2 UPDATED 22nd DECEMBER. Member of the Complete Byzantine Unit Roster team

  19. #19

    Default Re: Dummy governors to prevent AI bug

    I can live with the "aghhhh!" but I can't live without the custom portraits.

    Send_character_off_map will not cause any "Aaaargh!" sounds; and to prevent the off_map char from showing in your family_tree, create him as a general instead of family_member.
    Won't they still show up on the army scroll? I tried to create these governors as generals but they didn't show the custom portrait.

    Then at FactionTurnStart FactionIsLocal check the faction ownership, and spawn new generals for all the other factions. You can stick them straight into the cities you want them in, and the code will be shorter. You dont have to know names, you can assign them random_name. Make sure you use the terminate_monitor so it only runs once.
    I know all of the names, they are "GovernorSettlementX", "GovernorSettlementY" etc. Can a custom portrat be assigned when you create the character through the campaign script?

    Cheers
    Last edited by AlphaDelta; September 02, 2008 at 07:05 PM.
    "I don't want to sit around Windsor because ermm .. I just generally don't like England that much" - Prince Harry, 3rd in Line for the British Thrown



    For King or Country - The English civil wars.

  20. #20
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Dummy governors to prevent AI bug

    I believe so. Just use the portrait line just like in descr_strat.

Page 1 of 3 123 LastLast

Posting Permissions

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