Questions about PR modding to improve COOP gameplay

Making or wanting help making your own asset? Check in here
Post Reply
Valmont
Posts: 159
Joined: 2014-10-21 13:43

Questions about PR modding to improve COOP gameplay

Post by Valmont »

Hello fellow modders, dear DEVS

I wanted to ask a few simple questions regarding how some things work on the PR engine so I can check if what I have in mind to fix a very long COOP issue is posible/viable.

GOAL: Make bots seeing and shooting trough foliage not viable for them.

Questions:

1) How does penetration on some materials like wooden walls work in PR?
2) Is it posible to add a penetration value to things like bushes, tree leaves, high grass etc?
3) Is it posible to give the bots custom weapons with no penetration at all?

My idea is to have bushes and other foliage with very low penetration values so that all human weapons including explosives pass trough them but give bots weapons a penetration value of 0 so that their bullets cannot even penetrate the bushes and other foliage and therefore make forest maps viable for COOP gameplay.

Bots will still try to shoot though bushes but their bullets will stop there.

PS: Another benefit of giving bots custom weapons is to reduce their suppression effect so COOP becomes more fun.
AlonTavor
PR:BF2 Developer
Posts: 2991
Joined: 2009-08-10 18:58

Re: Questions about PR modding to improve COOP gameplay

Post by AlonTavor »

1 - Don't remember exactly. You can configure how materials (bullets) interact with other materials (walls), applying damage modifiers/penetration. There isn't much in PR that is penetrable. Mostly just Wood shacks, Afghan mud houses and tin walls.

2 - No. They do not have a "material", or hit detection. Only solid bush/tree branches do.

3 - That means making a copy bullet type with a copy weapon type, and a copy kit type. This is extra things to make and for the engine to load. We do the same with many vehicles because bots are hardcoded for specific physics.

PR uses BF2's hardcoded bots. They don't really work well with PR. They don't use cover, they don't build fobs or use rally points. Coop will never be more than a shooting gallery.
Valmont
Posts: 159
Joined: 2014-10-21 13:43

Re: Questions about PR modding to improve COOP gameplay

Post by Valmont »

Thank you Alon!

I agree that the COOP Ai kinda sucks but I also believe the bots can still be improved to suck a little less :razz:

Fastjack has been doing some groundbreaking work on the bots making them work on the insurgency game mode and all those improvements could possibly be ported back to COOP mode. Basically it makes the Ai work more like a team, patrol and defend more like players would, spawn on buildings and using better navmeches that make them seem more human (they seem like almost taking cover etc).

If you add those improvements with some fixes like the "see trough foliage" and the "too much suppression effect" and I strongly believe COOP and INSURGENCY will make a much finer training ground for new and even slow connection players or just those who can't endure the heart stopping rush that PVP can sometimes be. :)

PS: What FastJack and the Veteran Gaming community have achieved was also one day considered imposible jet somehow they still did :-o

Gaza Insurgency server test - Project Reality Lab - VETERANS-GAMING
Last edited by Valmont on 2017-09-05 16:38, edited 1 time in total.
Jabil_One
Posts: 135
Joined: 2017-03-11 18:01

Re: Questions about PR modding to improve COOP gameplay

Post by Jabil_One »

[R-DEV]AlonTavor wrote: PR uses BF2's hardcoded bots. They don't really work well with PR. They don't use cover, they don't build fobs or use rally points. Coop will never be more than a shooting gallery.
You can make that bots camping areas.
You can make them to have snipers, machine guns, RPG's on roofs, balconies or other spots where you only expects humans.
You can let it look like they placed fobs on different locations each round - same for rally's, mortars, mg nests, practically everything you can spawn via objectspawner.
You can let it look like they placed IED's or mines and also on different places each round.

All of this i write here could be done without changing 1 ai codeline.

All you need is a python randomcode for objectspawners for the stuff i listed above and adding some tweaklines to things you want.

There is also no ai stuff itself like aibehaviour changes.

Coop could be 100 times better when the DEVs should also put more love into Coop and not only the codders and mappers, also the pythonscripters. Is here maybe someone in the forum who is interrested at all in gamemode/gameplay improvement for PR, who see the coop part as a part of the whole game?

But what shall i say. It's the unloved coop (TRAINING) mode. Flying on PRTA is far better way to learn flight physics and assset handling.
B4rr3l
Posts: 259
Joined: 2017-01-19 20:44

Re: Questions about PR modding to improve COOP gameplay

Post by B4rr3l »

Yes that woulb be lovely, but all the PR purpose is team work, I think Alpha project, AIX, Armored kill or NAW are more Singleplayer focused..

I'm interested about how to make different penetrations for different objects btw any more insight on it?
Jabil_One
Posts: 135
Joined: 2017-03-11 18:01

Re: Questions about PR modding to improve COOP gameplay

Post by Jabil_One »

So it works.

Mostly everything has materials.
BF2 engine handle it so : attacking material vs. defending material

Attacking material : a bullet tweak, Material 3556

Code: Select all

ObjectTemplate.create GenericProjectile 556_45_r
ObjectTemplate.material 3556
ObjectTemplate.damage 39
ObjectTemplate.minDamage 0.4
ObjectTemplate.DistToStartLoseDamage 400
ObjectTemplate.DistToMinDamage 1000
ObjectTemplate.gravityModifier 0.3
include projectiles_common.tweak
include projectiles_tracer_r.tweak 5
Defending Material : a human bodyarmor Material 23

Code: Select all

Material.active 23
Material.name "Human_bodyarmour"
Material.type 4
Material.friction 1.2
Material.elasticity 0
Material.resistance 0.01
Now we look how both materials reacting together when they meet ingame : Materialmanagersetting.con

Code: Select all

MaterialManager.createCell 3556 23
MaterialManager.damageMod 1
MaterialManager.setEffectTemplate 0 e_bhit_s_sold_bodyarmor
MaterialManager.setDecalTemplate 0 decal_l_blood
MaterialManager.setSoundTemplate 0 S_Impact_Kevlar_Vest
The 556_45_r / 3556 projectile causes 39 damage points to a human in body armor 23 under 400 meter.

What the attributes of the materials exactly means, i dunno

Material.type ???
Material.friction ???
Material.elasticity ???
Material.resistance - ???
Material.damageLoss - explains itself
Material.minDamageLoss - explanes itself
Material.maxDamageLoss - explains itself
Material.penetrationDeviation ???
Material.overrideNeverPenetrate - sounds like it can penetrate. For sure, used in kiowa cockpit glass
Material.isSeeThrough - seems like you can see through it. Used in Leaf and barbwires
Material.projectileCollisionHardness ???
Material.isOneSided - used by destroyable objects, where the object can only be destroyed from one side. Kokan compound gates as excample

You have to create your own materials catalogue or modify existing one and add them those materials to your object tweaks.
Valmont
Posts: 159
Joined: 2014-10-21 13:43

Re: Questions about PR modding to improve COOP gameplay

Post by Valmont »

B4rr3l wrote:Yes that woulb be lovely, but all the PR purpose is team work, I think Alpha project, AIX, Armored kill or NAW are more Singleplayer focused..

I'm interested about how to make different penetrations for different objects btw any more insight on it?
Hey B4rr3l! First let me tell you I am a huge fan of your work on the HD mod.

You are right about PR being about team work but great team work can happen on a COOP match too!

In some COOP servers I've seen human commanders issuing orders to bot squads and they following the orders effectively and bot teams with human Squad Leaders moving around and playing a lot more like a squad on a PVP server would.

As I am sure you are very aware by now, judging by all your advancements and engine breakthroughs you had with your mod, that there is still a lot of untapped potential on the BF engine.

PR has been for quite some time now the tip of the spear when it comes to these engine advancements. Here are some important facts:

1) PR is currently the only game on the market featuring this level of teamplay and scale that still has bot support for online matches. (So COOP is one of the many features that makes PR unique).

2) Current and previous PR Devs have already spent hundreds of hours bringing COOP mode to most of their maps including NAV, testing, balancing, kits, bug fixes etc.

3) PR has had its share of Ai breakthroughs like the Bot mortar teams, Ai commanders issuing smarter orders etc.

4) PR currently also has the biggest community of players, being constantly updated and standalone, so any improvements done here have the capacity to reach more people.

5) PR has among its ranks some of the best and most experienced coders, mappers, animators and artists currently working on the engine.

6) Following PR's Spirit of continued refinement and because of all the points mentioned before there is no reason for the PR or community teams not to continue this trend of improving all of its features including COOP and potentially also adding bot support for other game modes (Insurgency) and for submods like WW2 and Falkan.

As Jabil said, most of the Ai's remaining biggest issues can be fixed by a good python coder with some cleaver ideas just like he and his team have achieved wonders with the objectspawner.

Hell, perhaps one day we will be able to issue orders via commo-rose like "hold fire" or "follow me" etc and the bots would react accordingly.
Last edited by Valmont on 2017-09-06 21:45, edited 2 times in total.
Valmont
Posts: 159
Joined: 2014-10-21 13:43

Re: Questions about PR modding to improve COOP gameplay

Post by Valmont »

Jabil_One wrote:So it works.

Mostly everything has materials.
BF2 engine handle it so : attacking material vs. defending material

You have to create your own materials catalogue or modify existing one and add them those materials to your object tweaks.
Great discovery Jabil!

I guess all we have to do now is add some penetration resistance to a bush and/or a tree, give yourself a kit with a weapon with no penetration and test if the bullet can still hit someone behind it or if it successfully stops the bullet like we want.

If it works then it is a matter of giving all the bots these kits with weapons with no penetration and maybe also no suppression effect. :wink:
Jabil_One
Posts: 135
Joined: 2017-03-11 18:01

Re: Questions about PR modding to improve COOP gameplay

Post by Jabil_One »

As Jabil said, most of the Ai's remaining biggest issues can be fixed by a good python coder with some cleaver ideas just like he and his team have achieved wonders with the objectspawner.
The Objectspawner thingy is all done by the Devteam. The only thingy i did was having the idea for an coop-insurgency gamemode and mounting the insurgency python into the gpm_coop.py and abused the hardcodded ai part of BF2 (bots going for SA's).
Ok, converting maps and placing ammocaches on valid (navmeshed) locations and adding the non-controlpoint related SA's isn't quick done.

The pythoncodder wouldn't fix ai issues. He would let bots impersonate human behaviour and their tactics like camping. The randomcode for such things like bipods, mortarpits, spg's/tows would teach the players to cover/check their surroundings like roofs, balconies etc. before they entering hostile areas.

It would be an improvement for both coop gamemodes. Starting a coop round and never know where the first static defenses are spawned is a new gameplay experience.
Would also minimize backstabbing the whole botteam in the mortarpits/bipods and yelling "Best Squad" in loading screen.
B4rr3l
Posts: 259
Joined: 2017-01-19 20:44

Re: Questions about PR modding to improve COOP gameplay

Post by B4rr3l »

That's great Jabil thanks, but I mean about the penetration itself, how do I set it's parameter, and must be done in every defending material?

Nice, Valmont, I have always admired PR for all of those features, one of my best friends was a huge fan of the gameplay.

What about that ESAi? Does it help making the bots smarter? I actually find standard BF2 Ai with well created Strategic areas unbelievable great Ai already, they do stuffs that even human players usually don't.

One of my first Coop online match was on Aix, that was very fun killing thousands of bots with your friends lol
Valmont
Posts: 159
Joined: 2014-10-21 13:43

Re: Questions about PR modding to improve COOP gameplay

Post by Valmont »

If anyone is interested, I found a post on the Battlefield single player forums where there is a fix for the Ai shooting trough the smoke grenade. Perhaps the fix can be ported to PR and to bushes and materials other than the smoke grenades.

Dnamro's Lost files - Battlefield SinglePlayer Forum

http://www.battlefieldsingleplayer.com/ ... screen.zip
User avatar
ALADE3N
PR:BF2 Developer
Posts: 577
Joined: 2016-02-13 17:34
Location: Philippines

Re: Questions about PR modding to improve COOP gameplay

Post by ALADE3N »

Valmont wrote:If anyone is interested, I found a post on the Battlefield single player forums where there is a fix for the Ai shooting trough the smoke grenade. Perhaps the fix can be ported to PR and to bushes and materials other than the smoke grenades.

Dnamro's Lost files - Battlefield SinglePlayer Forum

http://www.battlefieldsingleplayer.com/ ... screen.zip
i think this one is already or was used in PR , but i think bots can still shoot through?
Image
Jabil_One
Posts: 135
Joined: 2017-03-11 18:01

Re: Questions about PR modding to improve COOP gameplay

Post by Jabil_One »

https://www.realitymod.com/forum/f311-c ... right.html
Start reading post #6 - there a re also problems with those kinds of smokenades.
Valmont
Posts: 159
Joined: 2014-10-21 13:43

Re: Questions about PR modding to improve COOP gameplay

Post by Valmont »

Jabil_One wrote:https://www.realitymod.com/forum/f311-c ... right.html
Start reading post #6 - there a re also problems with those kinds of smokenades.
So the modified smoke grenade's "smoke" can be hooked by the hook because of the material it uses?

But the Hook cannot be hooked to a vehicle right? So perhaps the invisible object in the smoke grenade could be labeled a "vehicle" so the hook doesn't work with it?

Perhaps the material used to block the smoke could be one that the bots have the lowest or no priority to shoot at.. like an invisible giant round plane or something :)

I am sure there must be a work around for this! :-o
Valmont
Posts: 159
Joined: 2014-10-21 13:43

Re: Questions about PR modding to improve COOP gameplay

Post by Valmont »

Valmont wrote:If anyone is interested, I found a post on the Battlefield single player forums where there is a fix for the Ai shooting trough the smoke grenade. Perhaps the fix can be ported to PR and to bushes and materials other than the smoke grenades.

Dnamro's Lost files - Battlefield SinglePlayer Forum

http://www.battlefieldsingleplayer.com/ ... screen.zip
Dear [R-DEV] melonmuncher, according to Rhino you are our COOP hero!

Have you ever seen/tried this fix on PR before?
Jabil_One
Posts: 135
Joined: 2017-03-11 18:01

Re: Questions about PR modding to improve COOP gameplay

Post by Jabil_One »

Nah, it works like this.

The grenade spawns also a projectil collisionmesh. The bots cannot see through this mesh and dont shoot sofar i understood. Problem is the hook is also a projectil and interacts with the collsionmesh. Missiles, RPG'sm rockets, 40mm grenades also collide with this mesh and explode and the whole smoked area get the splashdamage.
It has also negative sideffects.

It can also be abused like spamming smoke grenades and the bots stop shooting. Normally in PR, when you use smoke, the opposite team start shooting into that area to scare the medics or getting a lucky shot.

Here an excample how the smoked PR world looks



Sorry to say that but noway with defensive smoke moves in coop.
Valmont
Posts: 159
Joined: 2014-10-21 13:43

Re: Questions about PR modding to improve COOP gameplay

Post by Valmont »

Jabil_One wrote:Nah, it works like this.

The grenade spawns also a projectil collisionmesh. The bots cannot see through this mesh and dont shoot sofar i understood. Problem is the hook is also a projectil and interacts with the collsionmesh. Missiles, RPG'sm rockets, 40mm grenades also collide with this mesh and explode and the whole smoked area get the splashdamage.
It has also negative sideffects.

It can also be abused like spamming smoke grenades and the bots stop shooting. Normally in PR, when you use smoke, the opposite team start shooting into that area to scare the medics or getting a lucky shot.

Here an excample how the smoked PR world looks

Sorry to say that but noway with defensive smoke moves in coop.
Allright, and what about making the smoke grenade spawn a giant invisible friendly body with like 1.000.000 hit points (unkillable) instead of that projectil collisionmesh. Bots will shoot at this invisible enemy because they are bots and will still see it as an enemy. Bullets will hit the body and not get though... also missiles, RPGs and 40MM grenades mostly do not explode on bodies... Regular grenades are no problem because they could be thrown "over" the invisible body. This invisible body gets deleted then the smoke expires.

I've seen helicopters hit invisible walls in the air before so maybe invisible bodies are also posible. =)
Post Reply

Return to “PR:BF2 Community Modding”