project reality header
Go Back   Project Reality Forums > PR:BF2 Mod Forums > PR:BF2 Community Modding
03 Jun 2020, 00:00:00 (PRT)
Register Developer Blogs Project Reality Members List Search Today's Posts Mark Forums Read
PR:BF2 Community Modding Making or wanting help making your own asset? Check in here

Reply
 
Thread Tools Display Modes
Old 2019-12-27, 00:38   #1
PRbear
Default Variable that controls AI responce distance?

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.
PRbear is offline Reply With Quote
Old 2019-12-27, 15:34   #2
[R-CON]​Fastjack
PR:BF2 Contributor

Fastjack's Avatar
Default Re: Variable that controls AI responce distance?

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 is online now Reply With Quote
Old 2019-12-28, 10:57   #3
[R-CON]​Fastjack
PR:BF2 Contributor

Fastjack's Avatar
Default Re: Variable that controls AI responce distance?

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
Fastjack is online now Reply With Quote
Old 2019-12-28, 13:49   #4
PRbear
Default Re: Variable that controls AI responce distance?

Quote:
Originally Posted by Fastjack View Post
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:
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:
aiSettings.setViewDistance
does not work that way. Bots are aware of both other bots and players position, and shoot from long distance.
PRbear is offline Reply With Quote
Old 2019-12-28, 14:01   #5
[R-DEV]​Outlawz7
PR:BF2 Developer

Outlawz7's Avatar
Default Re: Variable that controls AI responce distance?

Try aiTemplatePlugIn.cullDistance

Outlawz7 is offline Reply With Quote
Old 2019-12-28, 18:17   #6
T.E.D.F4257845
Default Re: Variable that controls AI responce distance?

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.
T.E.D.F4257845 is offline Reply With Quote
Old 2019-12-30, 09:11   #7
PRbear
Default Re: Variable that controls AI responce distance?

Quote:
Originally Posted by Outlawz7 View Post
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?


Quote:
Originally Posted by T.E.D.F4257845 View Post
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
PRbear is offline Reply With Quote
Old 2019-12-30, 15:29   #8
[R-CON]​Fastjack
PR:BF2 Contributor

Fastjack's Avatar
Default Re: Variable that controls AI responce distance?

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.
Fastjack is online now Reply With Quote
Old 2019-12-31, 22:43   #9
[R-DEV]​Arab
PR:BF2 Developer
Supporting Member

Arab's Avatar
Default Re: Variable that controls AI responce distance?

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



Check out my Ringtones
Arab is offline Reply With Quote
Old 2020-01-01, 11:28   #10
PRbear
Default Re: Variable that controls AI responce distance?

Quote:
Originally Posted by Fastjack View Post
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!

Quote:
Originally Posted by Arab View Post
In aibehaviours.ai, replace aiSettings.setBehaviour 1 MoveTo with aiSettings.setBehaviour 1 Idle
Very good tip! Thanks!
PRbear is offline Reply With Quote
Reply


Tags
ais, behavior, bot, reaction, response
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 12:53.