Author Topic: AI Battlechatter  (Read 2560 times)

Offline Darman

  • FH-Betatester
  • ***
  • Posts: 242
    • View Profile
AI Battlechatter
« on: 02-12-2011, 19:12:23 »
Hey guys, I'm new to this forum and hope you can help me with this:

The battles in Bf2 Coop or SP often don't create a real atmosphere because the bots, especially in FH2, don't talk that much. I already added the commander orders on com for "attack here" or "defend here" in the fh2/ai/radiomessages file, but apart from that or some "Charge" or "Deeeeeuuuutschland" calls at the beginning of a round there's not much communication. I know there are some numbers in the radiomessages file that control the usage of the different speaks but I don't know how to change them with the aim, that they're used more often.
I also added the Medic call in that file but an Fh2 Bot never uses that call ingame, just like the "get in" or "get out" command.
Furthermore FH2 adds multiple new possabilites of battlechatter, but Bots never use them ("Stay here", "Attacking", "Go for the flag" etc).

So is there a way to increase battlechatter or even add these additional commands/calls to the game (Bots using them)?

Hope someone knows an answer to this. Thx in advance!

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI Battlechatter
« Reply #1 on: 02-12-2011, 23:12:22 »
Welcome friend.

Well, you are right. There isn't.

Radio comms are limited in FH2 ever since the change from standard commo-rose to the FH2 specific one in order to accomodate the FH1 voice overs. Imagine it like a tree having been removed and replanted, the roots are ripped, so, in this case, they need to be put back in place.

Commo-rose is a specific type of AI that not many are either conversant with or have time to do.

It is something I plan to focus AI community work on, but sadly, thus far, nothing has yet been done. Once bots start obeying orders, you will notice alot more radio chatter like in BF2 vanilla.

For starters, bots will call for vehicles, say thank you, sorry, yes, no, etc and when you block them in vehicles or sit idle when they are passengers, they will call for 'charge' etc. Currently however, we need to make do with what we have.

It will, even then, be a balance between immersion and radio spamming. We dont want the latter.

Thanks for bringing this problem to the foreground.

Offline Darman

  • FH-Betatester
  • ***
  • Posts: 242
    • View Profile
Re: AI Battlechatter
« Reply #2 on: 02-12-2011, 23:12:15 »
Well... so there's actually nothing that i can do to improve the situation on my own?

Offline ballard44

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: AI Battlechatter
« Reply #3 on: 03-12-2011, 01:12:49 »
Try editing the airadiomessages.ai file.
It's in the ...Battlefield 2\mods\fh2\ai folder

Lots of things missing from the FH2 version that could help.
Compare it to the vBF2 version to understand.

Offline Darman

  • FH-Betatester
  • ***
  • Posts: 242
    • View Profile
Re: AI Battlechatter
« Reply #4 on: 03-12-2011, 10:12:59 »
Like I've wrote in my first post, I already edited it, but it doesn't seem to work that well. So this is, what it looks like:
aiComm.addAIRadioMessage    "move"             10      10          1
aiComm.addAIRadioMessage    "bail_out"          10      20          10
aiComm.addAIRadioMessage    "need_ammo"          10      20         20
aiComm.addAIRadioMessage    "PLAYER_TACTICS_gogogo"    10      10          10
aiComm.addAIRadioMessage    "PLAYER_TACTICS_followme"    10      10          10
aiComm.addAIRadioMessage    "attack_position"      10      2          10
aiComm.addAIRadioMessage    "medic"          10       10         20
aiComm.addAIRadioMessage    "get_in"          10      20          20
aiComm.addAIRadioMessage    "req_pickup"          10       20         10
aiComm.addAIRadioMessage    "defend"          10      10          1
aiComm.addAIRadioMessage    "roger_that"          10      5          10
aiComm.addAIRadioMessage    "negative"          10      2          10

Bots never use "medic!" when they're wounded, the never say "get in" or "bail out" (actually this commands doesn't seem to work at all in FH2, when I say it, AIs don't don anything) and they never require a pickup. The only thing that works is the Commander/Squadleader message "Attack here" or "defend our position" and the call "Gogogo" when you enter a vehicle and a bot is waiting for you to step on it.

Offline ballard44

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: AI Battlechatter
« Reply #5 on: 03-12-2011, 11:12:54 »
I apologize, didn't read where you had already tried.

Probably the issue is there is nothing linking those commands to the various HUD files.
Meaning the needed coding has been taken out in FH2???

I remember in Project Reality, our former 'leader' discovered if you added the "req_pickup" code to a certain file, bots would actually stop to pick you up.
Not even vBF2 had this 'activated'.

No idea how it works or how he did it, but I know the file(s) to change are in the menu_server.zip
Inside the 'communication' folder, perhaps???




Offline Darman

  • FH-Betatester
  • ***
  • Posts: 242
    • View Profile
Re: AI Battlechatter
« Reply #6 on: 03-12-2011, 11:12:42 »
Thank you, I think I already browsed through this once, but didn't want to change anything. There are also the files which contain the new messages of FH2, but when I added them to my AIradiomessages it crashed.
But does anybody here know which numbers in the AIradiomessages file i have to increase/decrease to increase the amount of AI battlechatter?

Offline Void

  • Moderator
  • ***
  • Posts: 162
  • AI Dev
    • View Profile
    • ESAI at Moddb
Re: AI Battlechatter
« Reply #7 on: 04-12-2011, 02:12:29 »
Look inside menu_server to get started.

Hope you know python though. The AI Comms are python hooked.

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: AI Battlechatter
« Reply #8 on: 04-12-2011, 03:12:13 »
The bots in AIX will stop and pick you up.

Might be worth having a look at what they did... :-\

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI Battlechatter
« Reply #9 on: 04-12-2011, 08:12:18 »
AIX uses the vanilla layout. Bots never picked people up in FH2 probably because then AI dev, Bizness must have accidentally broken that.

Offline Darman

  • FH-Betatester
  • ***
  • Posts: 242
    • View Profile
Re: AI Battlechatter
« Reply #10 on: 04-12-2011, 11:12:46 »
So... Do I have to change something in the python files or just replace some files with the vanilla ones? And I still got no answer on which numbers to change to enable comms more often. Does anybody know?

EDIT: I just browsed through the menu_server again, but as far as I can say, there's just located, how you can use them, what's there position on your HUD and which soundfiles will be played on a command.
Nothing about AI.
« Last Edit: 04-12-2011, 12:12:16 by Darman »

Offline ballard44

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: AI Battlechatter
« Reply #11 on: 05-12-2011, 01:12:02 »
So... Do I have to change something in the python files or just replace some files with the vanilla ones? And I still got no answer on which numbers to change to enable comms more often. Does anybody know?
There is no more often. Either it works or it doesn't.

The numbers in the airadiomessages.ai mean...
1st column = radius/diameter (in meters?) in which the call can be heard by bots
2nd column = length of time this call will remain/remembered before expiring
3rd column = length of time this call will remain on the 'chat board' in game

Not 100% sure about these (especially the 3rd one) but should be close.

Quote
EDIT: I just browsed through the menu_server again, but as far as I can say, there's just located, how you can use them, what's there position on your HUD and which soundfiles will be played on a command.
Nothing about AI.
The AI for this is all in the airadiomessages.ai file.
If everything works properly, this is what happens...

You need pickup and call for it.
The HUD files work together to link this command to the chat area. It appears.
At the same time, a sound file linked to this command plays, "Pick me up!" or something to that affect.
These are mostly included for human interaction between each other.

At the same time, the "req_pickup" code that is added/stored in the HUD files activates the same code in the airadiomessages.ai file.
This is the AI interaction part.
The bot can 'hear you', stops for the allotted time for you to get.

-------------------------------------------------------------------------------------

As far as how to fix it for FH2, trail and error.
But as Void stated, looks like PYTHON is involved in FH2s HUD creation so...good luck.
Would be a nice addition.

Offline Darman

  • FH-Betatester
  • ***
  • Posts: 242
    • View Profile
Re: AI Battlechatter
« Reply #12 on: 05-12-2011, 16:12:14 »
Thanks for the info. I'll give it a try. I get what some of the python files say, but I'm no programmer. And beside that, I first would have to know where I have to look, cause there are many of those files and they aren't always short.

Offline YaPh1l

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: AI Battlechatter
« Reply #13 on: 05-12-2011, 18:12:17 »
It seems like these three Python files make.py, comm.py and data.py in menu_server.zip\HUD\HudSetup\Communication\Comms\ just generate some .con files used for the HUD, but they do not contain any code that acutally interacts with BF2.
I am a programmer (well, it's just a hobby), however I am not very familiar with Python, so I might be wrong.

Best regards, Phil.

Offline Darman

  • FH-Betatester
  • ***
  • Posts: 242
    • View Profile
Re: AI Battlechatter
« Reply #14 on: 05-12-2011, 19:12:12 »
ok. If you'd like to take a look at "data.py" - I changed something but am not sure about how or if it works. I think the fh2 command for requesting a pickup is "FH2_REQUEST_pickup". In data.py, under the header "commands_sm" (sm=squadmember) there is a originally this: 'SquadInterface.selectOrder 3', (3=Number of the "transport" command). I changed this line to" lm('FH2_REQUEST_Pickup')," (lm=local team and enemys), "lm", beacause I don't know the shortcut for "localvehicle" that is used for the transport command in vanilla bf2 (not in a python, those pythons we're talking about doesn't seem to exsist in vanilla Bf2). But it still doesn't seem to have an effect. I just can't find the link to the AI.