Variable that controls AI responce distance?

Making or wanting help making your own asset? Check in here
Post Reply
PRbear
Posts: 24
Joined: 2019-12-04 17:11

Variable that controls AI responce distance?

Post by PRbear »

Does anyone know if there is a modable setting, that will allow to control AI response distance?
It is common in AI code, to have a variable that sets the max distance, that the AI should react to other AI' and most important, the player.
If this can be done in BF, it opens for new gameplay possibilities
I fear it is hardcoded, after reading con-file after con-file. I would love to be wrong.
Fastjack
PR:BF2 Contributor
Posts: 525
Joined: 2011-09-04 19:47

Re: Variable that controls AI responce distance?

Post by Fastjack »

What you mean with RESPONSE?

You mean when bots start firing at longer distance at players/bots?

When you mean this, look into the weapon.ai. There exististing values from minimum distance to maximum distance.
Fastjack
PR:BF2 Contributor
Posts: 525
Joined: 2011-09-04 19:47

Re: Variable that controls AI responce distance?

Post by Fastjack »

2 things have hardcodded base value settings but i dont remember the exact numbers.
viewdistance : infantry 200 / vehicles 300 and that can be overridden in the map ai.
When this values arent defined in the map ai the upper values kicks in.

Excample:
aiSettings.setViewDistance 500
PRbear
Posts: 24
Joined: 2019-12-04 17:11

Re: Variable that controls AI responce distance?

Post by PRbear »

Fastjack wrote: viewdistance : infantry 200 / vehicles 300 and that can be overridden in the map ai.
Excample:
aiSettings.setViewDistance 500
I thought so, but it does not
I used

Code: Select all

rem ai settings
aiSettings.overrideMenuSettings 1
aiSettings.maxBotsIncludeHumans 0
aiSettings.setMaxNBots 9
aiSettings.setBotSkill 1
aiSettings.setViewDistance 5
The idea behind this was to be able to make SP-maps with high dense undergrowth, where opponents literary could walk pass each-other with less than 10 m distance.
Famously was the case in the campaign in the Cyrillic-isle, where the battle in the 3 m high grass got to be known as 'battle of the bloody grass'.
It would be a very intense map-experience to 'walk' your avatar through high dense undergrowth, listening for footsteps.

Code: Select all

[i]aiSettings.setViewDistance[/i]
does not work that way. Bots are aware of both other bots and players position, and shoot from long distance.
Outlawz7
Retired PR Developer
Posts: 17261
Joined: 2007-02-17 14:59

Re: Variable that controls AI responce distance?

Post by Outlawz7 »

Try aiTemplatePlugIn.cullDistance
Image
T.E.D.F4257845
PR:BF2 QA Tester
Posts: 57
Joined: 2011-06-12 09:31

Re: Variable that controls AI responce distance?

Post by T.E.D.F4257845 »

From weapons_server, look for weapons/handheld/weapon_ranges. There you can select whichever weapon type you want and then change the values in the weapon.ai file. Change the min and max range from there. You can also get the AI to use rifles or other weapons on ground assets like tanks and APC by changing the Strenght value if you want.
"Never underestimate the power of BRDMs in large groups"
PRbear
Posts: 24
Joined: 2019-12-04 17:11

Re: Variable that controls AI responce distance?

Post by PRbear »

Outlawz7 wrote:Try aiTemplatePlugIn.cullDistance
Is there an aiTemplatePlugIn. for AI-bots? Is that paramter not for vehicles?
Can you tell me the name of the con-file for the bots?

T.E.D.F4257845 wrote:From weapons_server, look for weapons/handheld/weapon_ranges. There you can select whichever weapon type you want and then change the values in the weapon.ai file.
Well that is not the same. The AI perception is what should be changed
'Awareness' is commonly done by ray-casting. The AI casts a ray in the known direction of TPC. Solids will cut off the ray and the ray has a finite length. It is the length of the ray casted, that should be shortened
Fastjack
PR:BF2 Contributor
Posts: 525
Joined: 2011-09-04 19:47

Re: Variable that controls AI responce distance?

Post by Fastjack »

The ray cast is also called SensingAgentPattern

C:\Program Files (x86)\Project Reality\Project Reality BF2\mods\pr_edit\ai

aibehaviours ai-file

aiSettings.addSensingAgentPattern Infantery Soldier
aiSettings.addSensingAgentPattern Fixed Turret

You welcome to figure out about the BAPS language. I never found any Intel ressources about this in the Internet.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: Variable that controls AI responce distance?

Post by Arab »

A good tip for testing bot response while having them not move (Known info from BF2:SP modding community):

In aibehaviours.ai, replace aiSettings.setBehaviour 1 MoveTo with aiSettings.setBehaviour 1 Idle and that prevents bots from moving except with TakeCover (Grenade thrown), Revive etc in which you can replace them with Idle as well to test.

Very useful for testing weapon ai view distances granted that you place spawn points in a flat test map and also to test soldier material damage :D
Image
PRbear
Posts: 24
Joined: 2019-12-04 17:11

Re: Variable that controls AI responce distance?

Post by PRbear »

Fastjack wrote:The ray cast is also called SensingAgentPattern
C:\Program Files (x86)\Project Reality\Project Reality BF2\mods\pr_edit\ai
aibehaviours ai-file
aiSettings.addSensingAgentPattern Infantery Soldier
aiSettings.addSensingAgentPattern Fixed Turret
You welcome to figure out about the BAPS language. I never found any Intel ressources about this in the Internet.
That could actually be interesting!
Arab wrote: In aibehaviours.ai, replace aiSettings.setBehaviour 1 MoveTo with aiSettings.setBehaviour 1 Idle
Very good tip! Thanks!
Post Reply

Return to “PR:BF2 Community Modding”