Forgotten Hope Public Forum

Forgotten Hope 2 => Singleplayer and Coop => Topic started by: Darman on 02-12-2011, 19:12:23

Title: AI Battlechatter
Post by: Darman 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!
Title: Re: AI Battlechatter
Post by: djinn 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.
Title: Re: AI Battlechatter
Post by: Darman on 02-12-2011, 23:12:15
Well... so there's actually nothing that i can do to improve the situation on my own?
Title: Re: AI Battlechatter
Post by: ballard44 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.
Title: Re: AI Battlechatter
Post by: Darman 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.
Title: Re: AI Battlechatter
Post by: ballard44 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???



Title: Re: AI Battlechatter
Post by: Darman 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?
Title: Re: AI Battlechatter
Post by: Void 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.
Title: Re: AI Battlechatter
Post by: cannonfodder 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... :-\
Title: Re: AI Battlechatter
Post by: djinn 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.
Title: Re: AI Battlechatter
Post by: Darman 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.
Title: Re: AI Battlechatter
Post by: ballard44 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.
Title: Re: AI Battlechatter
Post by: Darman 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.
Title: Re: AI Battlechatter
Post by: YaPh1l 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.
Title: Re: AI Battlechatter
Post by: Darman 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.
Title: Re: AI Battlechatter
Post by: YaPh1l on 05-12-2011, 19:12:38
But it still doesn't seem to have an effect.
I was a bit unclear: If I'm right, these python scripts will never get called from BF2. They were used by the devs to generate the HUD's .con files and were left in the zip file, but are never actually used by BF2. This means you can ignore these files 'cause they won't affect anything.
I just can't find the link to the AI.
I looked around in the .con files, but I couldn't find anything that looked like AI. But I don't know the BF2 engine very well.

Best regards, Phil.
Title: Re: AI Battlechatter
Post by: Darman on 05-12-2011, 20:12:09
These files (communication/comms/) must be used by the engine. Otherwise your Hud would look like in vanilla BF2, i think. The files under /communication seem to be more or less the vanilla ones.
Title: Re: AI Battlechatter
Post by: YaPh1l on 05-12-2011, 20:12:23
Yes, the .con files are used, but the .py are not. That's what I tried to say.  ;)

Best regards, Phil.
Title: Re: AI Battlechatter
Post by: Darman on 05-12-2011, 20:12:22
Ok, got it^^

But Now I nearly tried everything - actually I just replaced the whole communications folder with the vanilla one. Result: klicking the "Pickup" button has no effect, not even a call.
Title: Re: AI Battlechatter
Post by: Darman on 06-12-2011, 13:12:30
Any idea how I can change it???