TheSuperHackers / GeneralsGamePatch

Community Patch to fix and improve original Generals Zero Hour 1.04
Other
63 stars 20 forks source link

Some projectiles do not collide with allied buildings #817

Open ThePredatorBG opened 2 years ago

ThePredatorBG commented 2 years ago

Most projectiles such as Crusader tank weapon collide with neutral and enemy structures but not allied ones. This can be abused by players by force-firing through their own buildings and hitting enemies on the other side of the building. However, Tomahawk missile, for example, collides with any structure owned by anyone.

xezon commented 2 years ago

Uh. Never saw this being abused before. Probably engine bug, no?

ThePredatorBG commented 2 years ago

Uh. Never saw this being abused before. Probably engine bug, no?

There should be a way to tackle it via .ini modifications because some projectiles, e.g. tomahawk missile collide with allied structures normally. It should be a matter of finding what's responsible for it and apply the changes to all projectiles unless that change comes with unintended behaviors.

xezon commented 2 years ago

Another issue here is that the Crusader shoots through the building in the first place. Ideally tanks would only start shooting when they have clear sight. That may be Engine issue.

xezon commented 2 years ago

Seems it is not (solely) related to Projectile. I copied everything from Object TomahawkMissile into Object GenericTankShell and it still flies through structure.

alanblack166 commented 2 years ago

There is a ProjectileCollidesWith parameter with the following inputs:

;-------------------------------------------- ProjectileCollidesWith parameters [Weapon Collide Masks]: ;--------------------------------------------

ALLIES ENEMIES STRUCTURES SHRUBBERY PROJECTILES WALLS SMALL_MISSILES BALLISTIC_MISSILES CONTROLLED_STRUCTURES

xezon commented 2 years ago

In Weapon CrusaderTankGun I changed RadiusDamageAffects = ALLIES ENEMIES NEUTRALS to RadiusDamageAffects = SELF ALLIES ENEMIES NEUTRALS NOT_SIMILAR like Tomahawk, but it did not change it either.

alanblack166 commented 2 years ago

That does not determine collision, only damage. The ProjectileCollidesWith parameter determines what overall types of objects a projectile may collide with.

xezon commented 2 years ago

In Weapon CrusaderTankGun I changed ProjectileCollidesWith = STRUCTURES WALLS to ProjectileCollidesWith = ALLIES ENEMIES STRUCTURES WALLS And now projectile collides with friendly structure.

xezon commented 2 years ago

Side Effects

ProjectileCollidesWith = ALLIES

https://user-images.githubusercontent.com/4720891/183123044-89033d25-2363-409e-a20e-c365f04d90d4.mp4

ProjectileCollidesWith = CONTROLLED_STRUCTURES (or ALLIES)

https://user-images.githubusercontent.com/4720891/183123092-f9fcfc97-e5af-4d53-a169-69ac77a2d5b3.mp4

xezon commented 2 years ago

Fixing this with collision could be risky. The real fix is to not have them shoot until clear sight.

ImTimK commented 2 years ago

Same how Tanks can fire over Supply Docks, this is used in matches to harass workers with Nuke Battle Masters for example.