Page 1 of 1

Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-20 22:00
by Valmont
I would like to hear ideas from the community on how they think the devs could improve the Ai behaviour so they seem more "human like".

Some/all ideas might prove imposible to implement but as long as they are good ideas that might improve the Ai then it is accepted and added to this first post.

As the Devs deem some ideas imposible/already tried then I will mark them.

For example:

1) The Ai don't react to being fired upon: they do not run for cover nor have any suppression/penalty effect.

Idea #1: Label the bullets on coop as a vehicle/grenade making the bots believe bullets are vehicles/grenades so when you shoot at the bots they will run away just like they do when a vehicle is about to hit them or grenade is about to explode.

Idea #2: Make the bullets drop an invisible grenade where they impact. This grenade should not blow up but "fool" the Ai into running away.

2) Bots don't defend/take cover.

Idea #1: Add special emplacements for bots on the coop maps that look like roadblocks, any cover or just invisible for the player but will fool the bots into staying into strategic locations "looking like" they are "defending" and taking cover on buildings, on windows, rooftops etc.

The bots should grab these emplacements when they come near them but not necessarily spawn on them or perhaps can spawn on them once the flag is taken for their team but on a very long timer so bots do not spawn there immediately after the previous bot using the emplacement is killed.

PS: I think this suggestion is already being implemented by Fastjack to some degree on his maps but this could make into the official PR if backed by a Dev.

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-20 22:10
by Mineral
https://www.realitymod.com/forum/f388-p ... lines.html

This section is for WIP work only. Suggestions and discussions have their own forum.

- Moved from Community Modding to the Suggestions Forums

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-21 00:56
by Rhino
Valmont wrote:Idea #2: Make the bullets drop an invisible grenade where they impact. This grenade should not blow up but "fool" the Ai into running away.
Can't give you much feedback about your ideas since I don't know much about the AI code but I can tell you that this idea isn't possible as you can't have an explosion spawn another projectile (best you can do is spawn a mesh with the impact/explosion effects but bots wouldn't "see" this). This is how we have wanted to do our SOFLAM lasers for years, which is have the projectile from the laser designator, travel at super fast speeds, then when it impacts the target it, it "explodes" spawning the laser target, but this simply isn't possible with the BF2 engine and we have had many coders spend a lot of time trying to get this idea to work but all without success.

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-21 16:24
by Jabil_One
Coop Improvements: By Mapping and Codding

All attack bot choppers :

Remove the wire/laserguided missiles and replace it with a dummy weapon that fires dumbmissiles.
So the botgunner would be able use it.

Vehicles with 7/8 seats are rollin caskets and only feeding heavy assets operators.
Turn such vehicles into 2 or 3 seaters. The bots would have more boots on the ground.

Bipods : I love them :twisted:

Modified bipods with armorcomp (makes them destructable) and dont allow exit (bot cannot exit it).
Such Bipods can be placed EVERYWHERE! No Navmesh required. Server cant crash because bot cannot exit it.
I used this method and it's amazing. Bots on roofs, balconies, treestands , mosque tower, all places where you only expect human players.
Some testers reported intense firefights and said " NOW ITS AN CHALLENGE !" That's one way to GO.

Only one problem can happen. SPAWNWAVES on the bipods.
To prevent this i made them destroyable. When you tweak it weak, excample that 20 shots of a rifle / 10 shots from a Machinegun / one 40MM grenade / etc. can destroy it, only few bots would be able to spawn on it.
Less pits of dead bot bodies.

ATM placements. See above "Bipods"

I did that on lashkar. After a while we got used to it to warn the apc when we heared it coming.
Missile fired!!! APC MOVE !!! BooM -???- Shit he aimed at the chopper Funny mumble moments. You know, in coop, you start laughing when you see those things happen - when you see such things on Deployment, you going toxic.

That's the part what the codder and mapper can do.

Coop Improvements: By Pythonscripts
A random spawnscript (like the ammocache) for bipods, botmortars, hideouts_sp, static AT's, fixed rallypoints, AA emplacements etc.
The problem with static defense, placed by the mapper, is that they are always at the same spot when you start a Round.
After a while playing the layer, you know where they spawn. Easy to remind.

With a randomcode each Round would be unique and every player is forced to keep the eyes open and move with more caution. Isn't that what people preaching in Deployment? Check surrounding area, cover this , cover that bla bla bla ???

This randomness gives coop the illusion of human behaviour. Spawn onetime here, onetime there and onetime far off.

Coop Improvements: By ai codders - Mapstrategies

You can do nice things with it! You can force the bots to follow caporder is one excample. It's called createAreaCondition. You can force bots to use bipods or whatever without spawning them in it. You can anchor such things in the mapstrategies.

When you want to create a new AI gamemode, it can only be done with Mapstrategies and not with python. Doesn't matter what gamemode, Insurgency, AAS4, Objective Mode and with a randomcode for Fobs the CnC gamemode.
Only problems i see are the high and different temperature values of PR Objects.ai's.
Such settings making Mapstrategies nearly impossible to code. 1 enemy tank and 2 additional soldiers can ruin every calculated decision that the ai commander made because this 3 things have alone a temperature value of 500 when i remember correct as i checked last time.

I could write more wall of text but ....... nevermind

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-21 16:39
by Valmont
[R-DEV]Rhino wrote:Can't give you much feedback about your ideas since I don't know much about the AI code but I can tell you that this idea isn't possible as you can't have an explosion spawn another projectile (best you can do is spawn a mesh with the impact/explosion effects but bots wouldn't "see" this). This is how we have wanted to do our SOFLAM lasers for years, which is have the projectile from the laser designator, travel at super fast speeds, then when it impacts the target it, it "explodes" spawning the laser target, but this simply isn't possible with the BF2 engine and we have had many coders spend a lot of time trying to get this idea to work but all without success.
Thank you for all your detailed replies and inside information Rhino, it is very impressive just how much work you Devs do that the public never gets to know/appreciate.

Also, I wanted to share a very fun video about Fastjack's Insurgency Coop that shows just how much fun and how much teamwork it requires to play against bots when they are set up so that they seem more human:


Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-21 17:11
by Valmont
Jabil_One wrote:Coop Improvements: By Mapping and Codding

All attack bot choppers :

Remove the wire/laserguided missiles and replace it with a dummy weapon that fires dumbmissiles.
So the botgunner would be able use it.

Vehicles with 7/8 seats are rollin caskets and only feeding heavy assets operators.
Turn such vehicles into 2 or 3 seaters. The bots would have more boots on the ground.

Bipods : I love them :twisted:

Modified bipods with armorcomp (makes them destructable) and dont allow exit (bot cannot exit it).
Such Bipods can be placed EVERYWHERE! No Navmesh required. Server cant crash because bot cannot exit it.
I used this method and it's amazing. Bots on roofs, balconies, treestands , mosque tower, all places where you only expect human players.
Some testers reported intense firefights and said " NOW ITS AN CHALLENGE !" That's one way to GO.

Only one problem can happen. SPAWNWAVES on the bipods.
To prevent this i made them destroyable. When you tweak it weak, excample that 20 shots of a rifle / 10 shots from a Machinegun / one 40MM grenade / etc. can destroy it, only few bots would be able to spawn on it.
Less pits of dead bot bodies.

ATM placements. See above "Bipods"

I did that on lashkar. After a while we got used to it to warn the apc when we heared it coming.
Missile fired!!! APC MOVE !!! BooM -???- Shit he aimed at the chopper Funny mumble moments. You know, in coop, you start laughing when you see those things happen - when you see such things on Deployment, you going toxic.

That's the part what the codder and mapper can do.

Coop Improvements: By Pythonscripts
A random spawnscript (like the ammocache) for bipods, botmortars, hideouts_sp, static AT's, fixed rallypoints, AA emplacements etc.
The problem with static defense, placed by the mapper, is that they are always at the same spot when you start a Round.
After a while playing the layer, you know where they spawn. Easy to remind.

With a randomcode each Round would be unique and every player is forced to keep the eyes open and move with more caution. Isn't that what people preaching in Deployment? Check surrounding area, cover this , cover that bla bla bla ???

This randomness gives coop the illusion of human behaviour. Spawn onetime here, onetime there and onetime far off.

Coop Improvements: By ai codders - Mapstrategies

You can do nice things with it! You can force the bots to follow caporder is one excample. It's called createAreaCondition. You can force bots to use bipods or whatever without spawning them in it. You can anchor such things in the mapstrategies.

When you want to create a new AI gamemode, it can only be done with Mapstrategies and not with python. Doesn't matter what gamemode, Insurgency, AAS4, Objective Mode and with a randomcode for Fobs the CnC gamemode.
Only problems i see are the high and different temperature values of PR Objects.ai's.
Such settings making Mapstrategies nearly impossible to code. 1 enemy tank and 2 additional soldiers can ruin every calculated decision that the ai commander made because this 3 things have alone a temperature value of 500 when i remember correct as i checked last time.

I could write more wall of text but ....... nevermind
OMG, such amazing feedback and even tested... imagine if more PR players were like this then the devs would have a much easier task nailing down issues and improving gameplay.

I've posted a video on the kind of gameplay we can expect from your work and it is simply amazing! Great way to teach medics and squad leaders how to play the game effectively as a team before going into full PVP.

This seems like a time when new breakthroughs are happening on the Refractor Engine.

First it was the HD Fonts, it is sad that so few people know about it but hopefully it will make into the PR in the next versions and certainly make a huge difference on make PR feel more up to date.

Then there are new sky settings that look amazing like thunderstorms and clouds that move and partially block the sun etc.

Then there is the stuff Rhino is working on that include Battleships/Carriers that once into the PR I am sure the mappers will make use of it ALOT.

Imagine a game mode where the teams spawn on their moving battleships/carriers and their objective is to destroy the other team's carrier. To do so the need to secure the airfield/port inland so they can field special planes and ships to destroy the enemy battleship/carrier much like Titan mode in BF 2142. So both team are constantly trying to control an in land locations and hurt the enemy ship before they sinks theirs.

For WW2 you could have a similar mode where on Omaha beach for example the Allies get 2 battleships and the germans get 2 artillery pieces. The objective of the Americans is to secure the beach first so they can land heavy assets like tanks and then storm inland to destroy the artillery pieces before the german artillery can destroy the american battleships.

The Artillery pieces can use the random spawner that currently the insurgency cache uses so that their location is not always known to the americans and the battleship should be able to move slowly to make it harder for the arty to hit them. These american ships should not be able to move too close to the beach not too far outside of the range on the german arty. The germans rely on spotters to tell the arty crew the coordinates of the american battleships while the americans need to use the noise and the projectile tracers of the arty shots to find them and destroy them.

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-28 02:47
by Valmont
I've just found this article:

Weapon AI Templates Explained | Classic Battlefield Modding Wikia | FANDOM powered by Wikia

It says at the end:

bots aiming/shooting through windows?
The AI uses the bullet collision model to determine if they can see/shoot through a particular piece of geometry. So if YOU can really shoot through the window, then the bots can see you and will shoot you, and if you can't really shoot through the window, then they won't see you.


That basically means that giving the bushes/smoke grenades a collision the bots won't shoot through it.

Perhaps the collision could be made so that bullets penetrate them but still make the bots not shoot through them!

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-28 11:15
by Jabil_One
Terrible solution.

- Human jump in a bush, see bot step forward - shoot , step backward, repeat. Use leafbush as massive cover.

Also the server performance would drop down to whatever.

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-28 11:34
by Jabil_One
Sorry for Offtopic:

@Outlawz:

As i said. Same behaviour i described on muttrah's mosque cornerfence.
Problem with the bridge is it needs an ai.template with the min and maxcorners when you navmesh the map (bridge).

ObjectTemplate.aiTemplate fence
ObjectTemplate.usedByAi 1
ObjectTemplate.initiallyWalkable 0
ObjectTemplate.minCorner -2.8/-1.6/-1
ObjectTemplate.maxCorner 2.8/1.6/1

The minCorner, maxCorner defines a box and inside this box the navMesh will be tesselated and those triangles will then be made walkable or not depending on the state of the destructible object. If it is like a bridge where the navMesh should be walkable while the object is whole the initiallyWalkable property should be set to 1. If it's walkable only after the object is destroyed, like the fence, it should be set to 0. If there is an object in their way that is not affecting the navMesh then the bots should just try to run through it until they suicide. If an aiTemplate static blocked path is the only path, then the bots will wait. If it is a destroyed bridge and no other path available, they will wait.

Edit :

I think this min/max corner values can be used for destroyable doors like on kokan or fallujah. Same values from the corrugated broken fence parts ai.
ObjectTemplate.minCorner -0.7/-1.4/-0.5
ObjectTemplate.maxCorner 0.7/1.5/0.5

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-28 16:10
by Rhino
Valmont wrote:Perhaps the collision could be made so that bullets penetrate them but still make the bots not shoot through them!
The biggest issue with that is tank shells, missiles etc will all then explode on contact with the leaves of a bush/tree :p

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-28 18:31
by Valmont
[R-DEV]Rhino wrote:The biggest issue with that is tank shells, missiles etc will all then explode on contact with the leaves of a bush/tree :p
Yeah, unless you also give those projectiles a slight penetration enough for the bushes but not enough for any other structure/vehicle.

But sounds like a lot of work...

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-28 20:28
by Rhino
Valmont wrote:Yeah, unless you also give those projectiles a slight penetration enough for the bushes but not enough for any other structure/vehicle.

But sounds like a lot of work...
As far as I'm aware that isn't possible.

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-28 20:55
by Jabil_One
There are better ways to nerf bots and firing through foliage. Also improving performance at all.

The collisionmeshs for foliage doesn't work because the engine had to much to calculate when all projectiles that get fired hitting collisionmeshes. Mortar P>RX round hit 30 tree & bush collisons with one round, to name a excample.

Grenades would bounced back on a leafbush like hitting a wall. Unrealistic accidents WILL happen.

Grappling hook exploits.

Lazing targets would be nearly impossible or the treecollisions would protect a lasertarget vehicle when it drives near a treegroup that wouldn't be realistic anymore.

Mortars are only effective when shells fired in the open. Trees or bushes can be exploited as SHIELDS.

And you must ssee it also from the humanplayer side. You fire at a bot and your projectiles STUCK in a drybush.

APC support fire into a wood like on fools road wouldn't work anymore.

Collisionmeshes for foliage on kashan could work well but on maps like yamalia, kozelsk, korengal in coop ..... nah.

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-29 12:38
by AlonTavor
[R-DEV]Rhino wrote:As far as I'm aware that isn't possible.
I don't know, why are they different than tin walls? I've killed APCs with AP through walls.

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-09-29 17:05
by Rhino
[R-DEV]AlonTavor wrote:I don't know, why are they different than tin walls? I've killed APCs with AP through walls.
tank shells might, although they do still appear to "explode" on first impact.

Pretty sure missiles etc will not penetrate and doubt there is any way to stop grenades from bouncing off leaves and the other issues Jabil mentioned.

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-10-01 22:15
by Valmont
Guys, I've just come up with another idea on how to fix the "Bots firing trough bushes/smoke issue".

This potential solution starts with the BF2 weapontemplates files.

This fix probably requires to add "Bot specific" versions of the weapon template files for every weapon that the Ai can use.

There is a parameter in the weapon templates:

.setFiresThroughTransparent - Basically it defines if that weapon's projectile size fit through a chain-link fence? 0 = no / 1 = yes, so the bot will/won't fire that weapon at you through the fence.

The idea for this fix is to give all the "bots weapons" a .setFiresThroughTransparent of 0 so that their bullets cannot pass through "fences".

Then make the smoke from the smoke grenade and some bushes (the bigger ones) a "fence".
ObjectTemplate.aiTemplate fence
ObjectTemplate.usedByAi 1
ObjectTemplate.initiallyWalkable 1

Since human players have .setFiresThroughTransparent set to 1 then human weapon's bullets will still pass through this new smoke/bush while the bots' weapons bullets won't.

Any Dev tried this? Willing to give it a try?

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-10-01 22:21
by Valmont
I've also found this:

.setExplosionRadius - When a projectile impacts whatever, this variable tells the bots (foe or friendly) the effective damage zone, and the bots if they detect this projectile will attempt to evade out of that radius (grenades for example). I think this evading action only applies to soldiers on foot.

Does that means that adding a .setExplosionRadius higher than 0 to a bullet would make a bot try to evade it if it is impacting nearby? (Therefore creating the effect of a bot taking cover?)

Is .setExplosionRadius just for the bots or it also affects human players?

Re: Brainstorming on ideas to improve the immersion with the Ai Bots

Posted: 2017-10-08 06:44
by yrand24
Improve AI on vehicle in coop not like in bf2 AI are accurate and they kill all enemies on their sight but in pr the AI even stare at enemies and theyre driving is bad they always bump at each others vehicle on tank the when AI use the main cannon they circle the main cannon like nuts and I even use contact message to shoot at enemies PLS fix this...