how do the bot commands work

Discussion in 'Support' started by TheAmethystDuke, Aug 28, 2009.

  1. blizzerd

    blizzerd Member

    Messages:
    10,552
    Likes Received:
    60
    Trophy Points:
    0
    empires Ai for the commander woudl be VERY easy to do if you make it so he just does things and place buildings when people ask it, and decides when to comply on building a barracks etc by looking at the resources and other vars

    in AI creating th I is the hardest to make, but you can easily use players to make intelligent decisions for the AI, and just trust him with the (more important, but easier to make) decisions of when to build a barracks by hardcoding popular strategies into it


    it will still be a lot of work, but its not like its impossible to do to create a usable AI commander, and once you have the framework the actual intelligence should not be rocket science
     
  2. Mkvenner

    Mkvenner Member

    Messages:
    109
    Likes Received:
    0
    Trophy Points:
    0
    For bots on the ground being commander controled wouldn't be too tough, one of the main problems that i forsee would be the class changing and upgrading system, terrain, LOS and target priority sort of stuff.
    If i could get the mod set up stuff done then I could probably get them to do something useful
     
  3. Z100000M

    Z100000M Vithered Weteran

    Messages:
    9,120
    Likes Received:
    70
    Trophy Points:
    0
    stupid bots to fill up servers? i dont know if anyone would want a bot that eats tickets faster then any noob and is incapable of doing any squad tactics

    edit: simple bots to learn commanding etc, yes, but not any player replacements..
     
  4. Mkvenner

    Mkvenner Member

    Messages:
    109
    Likes Received:
    0
    Trophy Points:
    0
    for testing purposes it might be useful to implement some really stupid bots that can follow simple "go to" commands, and im sure some sort of printf can be implemented to display damage caused.
    one of the main problems with using people for weapon tests is they inevitably end up messing about
     
  5. Caelo

    Caelo Member

    Messages:
    2,371
    Likes Received:
    5
    Trophy Points:
    0
    making an AI commander that even remotely compares to a human commander is impossible.
    Hell they cant even program a mouse brain let alone something complicated like a strategy-making AI.

    well... in theory it might be doable but game AI has anothher limitation and that is:
    A) limited proccessing power and resources in general
    B) time constraints

    games like Civ 4 already stretch the strategy-making to its limits for games on the hardware we have now. And you have to realise that the AI in civ4 has like 100 times more time to make its decisions than the AI in any RTS game would have.



    *EDIT*
    I forgot to add that for commercial games its normal for the AI team (3-4 people) to start working the moment the ground rules are done.. They need a good 3 years (or whatever the release schedule is) to create a decent AI.
    There's no way you would be getting decent AI for empires withing the next 6 years. Decent AI being a AI that MIGHT be fun to play against and even then I have a hard time believing anyone would play against the AI isntead of a team of REAL players.
     
    Last edited: Sep 7, 2009
  6. blizzerd

    blizzerd Member

    Messages:
    10,552
    Likes Received:
    60
    Trophy Points:
    0
    all of this is true, but i was more thinking about a pre-recorded action script with some variables in it that check if certain buildings are still up

    very doable, only if you find a weak spot you can exploit it every time

    but since players come in effect, they can compensate for this

    basically empires does not need a real "retail game smartness" AI for the commander, since its a game where as a commander you never ever have to interact with the players and everything is as scriptable as it can be

    for example, a flowchart in pseudocode for a very basic AI commander (sloppy i know)

    on start,

    -do "refplacing"
    -do "radarbuild"
    -do "research"

    do untill never
    -if no research
    --do "research"
    -endif
    -wait 10si
    -do "refplacing"
    -wait 10si
    -do "orders"
    -wait 10si
    -do "radarbuild"
    -wait 10si
    -do "barracksbuild"
    -wait 10si
    -do "underattack"
    -wait 10si
    -if no research
    --do "research"
    -endif
    endwhiledo

    end

    module "refplacing"
    -
    -if "refinery1 in range" and resources >100
    --place refinery1 on "mapdefinedarea1"
    -endif
    -
    -if "refinery2 in range" and resources >100
    --place refinery1 on "mapdefinedarea2"
    -endif
    -
    -if "refinery3 in range" and resources >100
    --place refinery1 on "mapdefinedarea3"
    -endif
    -
    -if "refinery4 in range" and resources >100
    --place refinery1 on "mapdefinedarea4"
    -endif
    -
    -if "refinery5 in range" and resources >100
    --place refinery1 on "mapdefinedarea5"
    -
    endmodule

    module "radarbuild"
    -if "resources" >600 and radar exists is false
    --build radar ontop of "mapdefinedareaX"
    -endif

    endmodule

    module "basebuild"
    -if "barracks1 in range" and resources >400
    --build barracks ontop of "mapdefinedarea1"
    -endif
    -
    -if "barracks2 in range" and resources >400
    --build barracks ontop of "mapdefinedarea2"
    -endif
    -
    -if "barracks3 in range" and resources >400
    --build barracks ontop of "mapdefinedarea3"
    -endif
    -
    -if "barracks4 in range" and resources >400
    --build barracks ontop of "mapdefinedarea4"
    -endif
    -
    -if "barracks5 in range" and resources >400
    --build barracks ontop of "mapdefinedarea5"
    -endif
    -
    -if "vehiclefactory1 in range" and resources >400
    --build vehiclefactory ontop of "mapdefinedarea1"
    -endif
    -
    -if "vehiclefactory2 in range" and resources >400
    --build vehiclefactory ontop of "mapdefinedarea2"
    -endif
    -
    -if "vehiclefactory3 in range" and resources >400
    --build vehiclefactory ontop of "mapdefinedarea3"
    -endif
    -
    endmodule

    module "research"
    -if "noradar"
    --do "radarbuild"
    endif
    -if "resources" > "predetermined requirement"
    --research "predetermined path"
    --unlock vf
    -else
    --lock vf
    endif

    endmodule


    module "under attack"
    -if starting base buildings under attack OR commander under attack OR enemy closer to commander then 300 units
    --unlock vf
    --spam "/say killspawn to main"
    --
    -endif
    endmodule

    module "orders"
    -if "refinery1 in range" is placeable
    --do "refplacing"
    --else alpha move to mapdefinedarea1
    --do "radarbuild"
    -endif
    -
    -if "refinery2 in range" is placeable
    --do "refplacing"
    --else alpha move to mapdefinedarea2
    --do "radarbuild"
    -endif
    -
    -if "refinery3 in range" is placeable
    --do "refplacing"
    --else alpha move to mapdefinedarea3
    --do "radarbuild"
    -endif
    -
    -if "refinery4 in range" is placeable
    --do "refplacing"
    --else alpha move to mapdefinedarea4
    --do "radarbuild"
    -endif
    -
    -if "refinery5 in range" is placeable
    --do "refplacing"
    --else alpha move to mapdefinedarea5
    --do "radarbuild"
    -endif
    -
    endmodule


    "refineries in range" = a res node that is not blocked, with a player close enough to build a refinery
    "mapdefinedareaX" = an info_target that the mapper places in his map where he wants bots to build stuff, they should be named something like bot_nf_barracks1 so the bot knows what and when to place it
    "predetermined path" would be some prescripted orders of researches that progress into the trees each time it is called for combined with resource management, its a bad decision to script research as random, so its best to make 5 or so research orders and the bot picks one randomly at start and sticks to it
    "predetermined requirement" is the amount of resources the wanted research needs

    all the rest should make sense if you know your way around pseudocode
     
    Last edited: Sep 7, 2009
  7. Empty

    Empty Member

    Messages:
    14,912
    Likes Received:
    11
    Trophy Points:
    0
    You could easily code slaughtered AI.

    Just record the motions of a 20v20 match and replay them, "it's just like the real thing!"
     
  8. flasche

    flasche Member Staff Member Moderator

    Messages:
    13,299
    Likes Received:
    168
    Trophy Points:
    0
    didnt you do something similar on your map anyway? why would you need an AI for this then, when you just could have a trigger doing the same?
     
  9. blizzerd

    blizzerd Member

    Messages:
    10,552
    Likes Received:
    60
    Trophy Points:
    0
    triggers ask more computer resources to work

    its better to code it into the game itself with "some" support in the form of map entities
     
  10. flasche

    flasche Member Staff Member Moderator

    Messages:
    13,299
    Likes Received:
    168
    Trophy Points:
    0
    nah AI takes up way more resources

    bet?
     
  11. Gammer400

    Gammer400 Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    how do you access the admin console or type those?
     
  12. ScardyBob

    ScardyBob Member

    Messages:
    3,457
    Likes Received:
    30
    Trophy Points:
    0
    Hit ~ to open the console. However, you have to enable it via the options (I think its under advanced options in the multiplayer option menu, just check mark 'enable developers console').

    After that
    sv_cheats 1
    bot_add

    They don't do much besides walk around.
     

Share This Page