project reality header
Go Back   Project Reality Forums > PR:BF2 Mod Forums > PR:BF2 Feedback > Coop & Singleplayer
31 Oct 2024, 00:00:00 (PRT)
Register Developer Blogs Members List Search Quick Links
Coop & Singleplayer Suggestions and feedback pertaining to Project Reality Single Player.

Reply
 
Thread Tools Display Modes
Old 2019-08-15, 17:23   #21
[R-CON]​Fastjack
PR:BF2 Contributor

Fastjack's Avatar
Default Re: [COOP] Fix for Bots shooting trough foliage.

And that is what i found in Project Reality Game C:\Program Files (x86)\Project Reality\Project Reality BF2\mods\pr\ai\esai\docs\fromdecompile

Code:
Extracted from BF2.exe (1.41)

IT Flags: (27 total)

000000521108   000000922108      0   ITHasCarHorn
000000521118   000000922118      0   ITObstacle
000000521124   000000922124      0   ITHasWreck
000000521130   000000922130      0   ITHelicopter
000000521140   000000922140      0   ITNoTemperature
000000521150   000000922150      0   ITObstructedView
000000521164   000000922164      0   ITSoldier
000000521170   000000922170      0   ITVegetation
000000521180   000000922180      0   ITBiological
000000521190   000000922190      0   ITStructure
00000052119C   00000092219C      0   ITLowPriority
0000005211AC   0000009221AC      0   ITUnmanned
0000005211B8   0000009221B8      0   ITMobile
0000005211C4   0000009221C4      0   ITCover
0000005211CC   0000009221CC      0   ITFixed
0000005211D4   0000009221D4      0   ITArtillery
0000005211E0   0000009221E0      0   ITTransportation
0000005211F4   0000009221F4      0   ITAirfield
000000521200   000000922200      0   ITRadar
000000521208   000000922208      0   ITControlpoint
000000521218   000000922218      0   ITNaval
000000521220   000000922220      0   ITGround
00000052122C   00000092222C      0   ITAir
000000521234   000000922234      0   ITUnit
00000052123C   00000092223C      0   ITRepair
000000521248   000000922248      0   ITAmmunition
000000521258   000000922258      0   ITProduction
Small joke. I know that's in there because PR added ESAI and Void added the whole stuff for us ai codders. He helped me much longtime ago.

The red marked ones having my attention.

1 or 2 of them will help me to get ammocache defense for Coop-Insurgency done via mapstrategies.

From TK

Quote:
The first step is to create the strategic areas and their relations. Once this is done, I consider the different plausible scenarios of the map. Almost all maps will work well with a standard strategy that runs most of the time, one strategy if the team is dominating the map, and one strategy if the team is being dominated. This setup will make the map play decently in most circumstances. If this turns out to be too stiff and repetitive, it may be a good idea to add one or two more strategies for the normal situation on the map. These strategies aims to create situations where one team may concentrate on one flank, one spear head attack, or spread wide to try and capture badly defended areas. Once I know what I want to achieve, I write the strategies and add flags to the strategic areas so that I know that the strategies only will activate when I want them. The same thing goes for the modifiers. If I want the bots to attack a certain strategic area, I make sure that the flags for that strategic area are unique so that I can add modifiers that guarantee that that strategic area is the one with the highest temperature.
About Coop Insurgency, i cannot use ITFlags for the SA Layouts combined with mapstrategies to get the bots to the ammocache zones.

But i can use TTN modifiers in a mapstrategy with an ammocache-ai to increase the temperature of the specifiec SA where the ammocache spawned.


About ITCover:

The BF2 Developers said the ITCover behaviour isn't used anymore in BF2 but they asking themself why vehicles still having the codelines.

I believe it's still inside but no vanilla staticobject has an ai.template with any objects.ai to tell the bots that it can be used as cover. Only one object, corrugated_fence_destroyable_part, has an ai template and when used and correctly navmeshed the bots will not jump anymore against that objects that isn't in destroyed condition.

And sorry Valmont for Hijacking your thread but you said you want learn to speak our language.
Fastjack is offline Reply With Quote
Old 2019-08-19, 19:28   #22
Valmont
Default Re: [COOP] Fix for Bots shooting trough foliage.

Quote:
Originally Posted by Arab View Post
For bots being stationary @Valmont, I have an experimental vehicle code that allows bots to stay stationary using the stand LCVP animation from WW2 Beta and with the prevented exit vBF2 code, allows you to setup ambushes and allow mappers to spawn AI-only spawns in capture points. No vehicle model is used, and the bot can do a 360 around although the legs don't move when rotation left and right.

It's experimental as in there's technically 2 seats which is required otherwise the game crashes. I think I know the issue and i'll work on it again later.
Currently focusing on v1.6.
That is just AMAZING! I love how you managed to use vehicle code to achieve what would be a somewhat realistic defensive ai behavior! Can't wait to see it being further developed after 1.6!

Quote:
Originally Posted by Fastjack View Post
And sorry Valmont for Hijacking your thread but you said you want learn to speak our language.
Hey! I am learning a LOT and besides this forums belongs to you guys the DEVs! We mortals just enjoy your creations and mess things up!

And every three years we come up with some "actually useful" suggestions that you could use to make your creations even better!
Valmont is offline
Last edited by Valmont; 2019-08-19 at 19:47..
Reply With Quote
Old 2023-03-12, 01:54   #23
[R-DEV]​Arab
PR:BF2 Developer
Supporting Member

Arab's Avatar
Default Re: [COOP] Fix for Bots shooting trough foliage.

Did a test.

The vBF2 static object fence_corrugated_3x12m_broken_parts has an AI attached to it.
It's a DestroyableObject, meaning that it has HP and disappears after the set HP amount is depleted.

This static can be found in Strike at Karkand, outside of the US base where the fence is on the right.

Code:
rem *** Plugins ***
aiTemplatePlugIn.create Physical fence_corrugated_3x12m_broken_partsPhysical
aiTemplatePlugIn.setStrType Infantry

rem *** AITemplate ***
aiTemplate.create fence_corrugated_3x12m_broken_parts
aiTemplate.addType ITStructure
aiTemplate.degeneration 50
aiTemplate.allowedTimeDiff 2
aiTemplate.basicTemp 1
aiTemplate.commonKnowledge 1
aiTemplate.addPlugIn fence_corrugated_3x12m_broken_partsPhysical
ITStructure from what I observe is just to tell bots to ignore and not go through an object that is meant to be destroyed until it is destroyed - thus preventing bots from crowding the object, thinking they can go through it.

Once it is destroyed, it signals to the bots that they can go through an object.
Safe to say, it only works for DestroyableObjects. This would fix bots crowding on certain statics that doesn't have this code applied to it - like in Asad Khal.

It only triggers the AI behavior if the navmesh is in the direction of the static.

I tested in Strike at Karkand if the bots can't see the player when hiding behind it and they still target the player behind it. But I did notice some form of invisibility.

To test this out, load Strike at Karkand with 64 bots and play as MEC side. Then proceed to the middle, go to the left - closest to the road and hill of the US base and then hide behind the fence object.

.tweak:
Code:
rem *** Generated with Bf2Editor.exe [created: 2005/5/2 17:30]
GeometryTemplate.maxSkip3pLods 3
GeometryTemplate.setSubGeometryLodDistance 0 0 35
GeometryTemplate.setSubGeometryLodDistance 0 1 55
GeometryTemplate.doNotGenerateLightmaps 1
GeometryTemplate.lightmapOverride 0
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
ObjectTemplate.activeSafe DestroyableObject fence_corrugated_3x12m_broken_parts
ObjectTemplate.creator ENI-2:eni
ObjectTemplate.modifiedByUser ful
ObjectTemplate.setNetworkableInfo BasicInfo
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.isDestructable 1
rem ---BeginComp:Armor ---
ObjectTemplate.createComponent Armor
ObjectTemplate.armor.maxHitPoints 50
ObjectTemplate.armor.hitPoints 50
ObjectTemplate.armor.defaultMaterial 97
ObjectTemplate.armor.waterLevel -0.3
ObjectTemplate.armor.wreckHitPoints 50
ObjectTemplate.armor.addArmorEffect 0 e_destruction_FenceBoards -0.28/-0.52/0 0/0/0
rem ---EndComp ---
ObjectTemplate.geometry fence_corrugated_3x12m_broken_parts
ObjectTemplate.setCollisionMesh fence_corrugated_3x12m_broken_parts
ObjectTemplate.mapMaterial 0 wood 59
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
ObjectTemplate.aiTemplate fence_corrugated_3x12m_broken_parts
ObjectTemplate.usedByAi 1
ObjectTemplate.initiallyWalkable 0
ObjectTemplate.minCorner -0.7/-1.4/-0.5
ObjectTemplate.maxCorner 0.7/1.5/0.5
From reading the BF2 wiki, min and max corner is calculated by placing a dummy object like a decal in the BF2 Editor on the bottom-left corner and top-right corner to get the x/y/z co-ordinates, then add it to min and max corner commands.

Also the collision mesh needs col 3 (AI) obviously for it to work.

ObjectTemplate.initiallyWalkable 0 means that bots can walk through it. ObjectTemplate.initiallyWalkable 1 is only applied to bridges as they are not preventing players from crossing it.

Would be nice to find a way to hack/trick the AI system to destroy an object without attaching an underground enemy spawn point to the object. There was one attempt which had mixed results somewhere in this forum.

Is interesting how bots engage in destroying bridges as they rarely do it until certain conditions are met.
They also have the bridge ai attached to it. Operation Clean Sweep is one example of a map that does have it.

Simply can load all .tweaks of staticobjects and look for AiTemplates. It's interesting stuff.

Codes tested with fence_corrugated_3x12m_broken AI which has no effect:
ITVegetation
ITStructure
ITObstructedView
ITObstacle

Arab is offline
Last edited by Arab; 2023-03-12 at 03:20..
Reply With Quote
Old 2023-03-12, 10:54   #24
Outlawz7
Retired PR Developer

Outlawz7's Avatar
Default Re: [COOP] Fix for Bots shooting trough foliage.

Quote:
Also the collision mesh needs col 3 (AI) obviously for it to work.
How do you know this?

Outlawz7 is offline Reply With Quote
Old 2023-07-01, 13:22   #25
[R-DEV]​Arab
PR:BF2 Developer
Supporting Member

Arab's Avatar
Default Re: [COOP] Fix for Bots shooting trough foliage.

Quote:
Originally Posted by Outlawz7 View Post
How do you know this?
Well, honestly I'm just assuming.

Arab is offline Reply With Quote
Old 2023-07-01, 13:42   #26
Outlawz7
Retired PR Developer

Outlawz7's Avatar
Default Re: [COOP] Fix for Bots shooting trough foliage.

col3 is only for navmesh generation. AI uses col0 to see. I tested it.

Outlawz7 is offline Reply With Quote
Reply


Tags
bots, coop, fix, foliage, immersion

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 17:47.