No damage with Rocket, RocketMk2, WarShell, ShockProj, ...

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

No damage with Rocket, RocketMk2, WarShell, ShockProj, ...

Post by Barbie »

While testing the collision cylinder of pawns with a bigger DrawScale I found that projectiles, that uses function HurtRadius() while exploding, do not do damage if the pivot point of the enemy is outside the sphere with the damage radius. For example: set DrawScale=5 for a queen and fight against it with a Rocket Launcher - you cannot win the battle (see attachment).

Possibly Solution: add Other.TakeDamage() in function ProcessTouch() if the distance between Instigator and projectile exceeds the damage radius.
Example for WarShell (untested):

Code: Select all

function ProcessTouch (Actor Other, Vector HitLocation)
{
	if (Other != instigator)
	{
		Explode(HitLocation, Normal(HitLocation - Other.Location));
		// my extension:
		if (Role == ROLE_Authority && VSize(Other.location - location) > DamageRadius)
			Other.TakeDamage(Damage, instigator, HitLocation, MomentumTransfer * Vector(Rotation), MyDamageType);
	}
}
<edit>
Replaced instigator by Other
</edit>
Attachments
TestBigQueen.unr.7z
(3.96 KiB) Downloaded 52 times
Last edited by Barbie on Sat Jul 14, 2018 8:42 pm, edited 1 time in total.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: No damage with Rocket, RocketMk2, WarShell, ShockProj, .

Post by sektor2111 »

Barbie wrote:distance between Instigator and projectile exceeds the damage radius
Yes, but it's about Victim.Location too far from HitLocation and this distance is lower than damage radius initiated in HitLocation place - LOL mapping...
Reconfiguration different explained:

Code: Select all

//fake snippet
VSize(Victim.Location-HitLocation) > DamageRadius
Here goes ALL oversized useless Creatures which have total immunity at damage. I won't mention Momentum boosting making pawn still alive to be completely dropped out of damage radius.

... like in some RPG games, "Armor" protection was bigger than damage taken = NO damage = WASTE of time shooting at crap.

Here I have to ask WHY instigator must TakeDamage. Isn't Instigator the dude firing projectile ?
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: No damage with Rocket, RocketMk2, WarShell, ShockProj, .

Post by Barbie »

sektor2111 wrote:Here I have to ask WHY instigator must TakeDamage. Isn't Instigator the dude firing projectile ?
Yes, Instigator is the one responsible for damage. I have corrected above posting.

The underlying problem is that collision is detected by cylinder but damage by pivot distance. Both should be done by collision cylinder.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: No damage with Rocket, RocketMk2, WarShell, ShockProj, .

Post by Higor »

Just use XC_Engine's script patcher to replace HurtRadius.

Modify the damage calculation from:
>> Explosion Location <-> Actor center

To:
(case 1: hitlocation inside cylinder)
>> 0 distance

(case 2: hitlocation outside cylinder)
>> Explosion Location <-> Hitlocation (Trace from explosion to Actor)

With this the shock balls will be able to harm titans.
Bear in mind, this will alter the balance of the game, and may make large explosions use more CPU.
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: No damage with Rocket, RocketMk2, WarShell, ShockProj, .

Post by sektor2111 »

Hint me with some damage calculation, I cannot figure how goes damage in various damaging cases - not hitting actor/hitting actor...
This iterator

Code: Select all

foreach VisibleCollidingActors( class 'Actor', Victims, DamageRadius, HitLocation )
Has probably nothing when ShockBall is hitting a GiantGasbag because Actor is not localized in DamageRadius. This should be replaced with something collision based discarding DamageRadius crap, and if projectile does a direct HIT damage should go at maximum value, when it is exploding around it should compute this DamageRadius but taking in account a possible Victim colliding this DamageRadius - victim is supposed to get damage discarding stupid CollisionRadius deal - it's just touched by some damage if cylinder is affected by DamageRadius regarding to Location of victim which is out of DamageRadius produced at HitLocation.
User avatar
Acoma
Average
Posts: 73
Joined: Sun Jul 07, 2013 12:52 am
Location: Las Vegas☆

Re: No damage with Rocket, RocketMk2, WarShell, ShockProj, .

Post by Acoma »

wow that explains why some monsters become invulnerable when using monster size randomizer
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: No damage with Rocket, RocketMk2, WarShell, ShockProj, .

Post by sektor2111 »

No please excuse my bump here. I want to ask only a simple question: Can anyone post a snippet about fixing this or I'm going to solve this in my way using compatibility mode for conforming operation ?
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: No damage with Rocket, RocketMk2, WarShell, ShockProj, .

Post by sektor2111 »

Bump - Having something done but I have to see more various occurrences.
If damage it's in account nearby collision cylinder it looks like a new Momentum will drop creature in a ridiculous way by a ShockBall or other "strong" projectile like that, so I had to recompute momentum in other way. I have logged these to see Big Monster Vs DamageRadius and Damage Taken. In account that a very very Big Monster is discarded as long as an Elephant probably will not take damage at a K1 match against a tiny Worm, so ridiculously used big DrawScale will attempt to keep creature unaffected.

Code: Select all

ScriptLog: ShockProj7 taking damage using HurtRadius 70.000000 has damagescale = 1.000000 with DamageAmount = 55.000000
ScriptLog: ShockProj7 - Victim GiantGasbag1 damage = 55.000000 and CollisionRadius = 160.000000
...
//direct Hit VS Indirect Hit
ScriptLog: UT_Grenade0 taking damage using HurtRadius 200.000000 has damagescale = 1.000000 with DamageAmount = 80.000000
ScriptLog: UT_Grenade0 - Victim Titan2 damage = 80.000000 and CollisionRadius = 57.500000
ScriptLog: UT_Grenade0 taking damage using HurtRadius 200.000000 has damagescale = 0.119651 with DamageAmount = 80.000000
ScriptLog: UT_Grenade0 - Victim Titan0 damage = 9.572072 and CollisionRadius = 57.500000
...
//Direct Hitting
ScriptLog: ShockProj0 taking damage using HurtRadius 70.000000 has damagescale = 1.000000 with DamageAmount = 55.000000
ScriptLog: ShockProj0 - Victim StoneTitan4 damage = 55.000000 and CollisionRadius = 115.000000
ScriptLog: ShockProj1 taking damage using HurtRadius 70.000000 has damagescale = 1.000000 with DamageAmount = 55.000000
ScriptLog: ShockProj1 - Victim StoneTitan4 damage = 55.000000 and CollisionRadius = 115.000000
...
//Combo Shock
ScriptLog: ShockProj1 taking damage using HurtRadius 250.000000 has damagescale = 0.873527 with DamageAmount = 165.000000
ScriptLog: ShockProj1 - Victim Tentacle1 damage = 144.132004 and CollisionRadius = 28.000000
ScriptLog: ShockProj2 taking damage using HurtRadius 250.000000 has damagescale = 0.918867 with DamageAmount = 165.000000
ScriptLog: ShockProj2 - Victim Tentacle1 damage = 151.612991 and CollisionRadius = 28.000000
That's all so far...
Post Reply