Jump to content
Sign in to follow this  
Ravendark

LineDamage vs Lineardamage and railgun effects

Recommended Posts

So i've been playing arround with the linedamagemodule in the effort of creating a scything railgun efffect similar to tiberian sun's railguns.

 

I used to do this with the Lineardamage module (the sonic turret/terraforming station weapon)...it has its up and downs, and i was looking for another (maybe better) method.

 

Enter the LineDamage weapon segment. Used in RA3 by Natasha, this piece of code is in TW/KW aswell. I just never touched it because...reasons i guess.

 

So after experimenting with it i just want to share my results, iirc Madin was interested in this particular code aswell.

-------------------------------------

 

I used the lineardmg module in combination with a custom particle FX(projected particles across a vector with a speed) to create the railgun scything effect. The downside was that due how the linear "wave" travels from sender to target, aim direction and actual wave direction didnt always perfectly match up, specialy if the aim weapon uses scatter.

 

Now with the linedamage weapon component, seeing as everything happens inside the weapon itself, the line damage ...well lines up perfectly with the direction of every shot itself.

The downside is the coding used to set beginning and end effect of the linedamage isnt fixed like it was for the lineardmg module, but is relative to the target. Depending on the lead in size, if the target is to close to the shoot the damage effect will even propogate behind the shooter. Also neither tracer draw or projectile draws will propogate past the target, they stop at the target unlike in RA3 where the tracer draw compensates for the lead in and out coding.

One verry lucky, altho probably un intentional benefit this linedamage coding has: it will clear garrisons, per unit..it visualy looks like a railgun hits a individual unit behind the walls. the downside of this..i cant think of a way to disable the anti garrison effect atm...so its a take it or leave with this coding.

I remember tho that (not sure if was Styx or Madin) one of them wanted a linear damage effect for their disruptors that could clear garrisons....this seems like its a easy way to do it.

 

But due to not being able to have a projectile or tracer draw propogate past the initial target...i had to fall back to my particle FX to simulate a railgun effect...i basicly use a directional particle FX trigggered from the weaponFireFx setting in the weapon to simulate my railgun penetration fx.

 

Just wanted to share my early findings as iirc their was interest in something like this.

 

below video displays the linedamage weapon in effect, on the apc it shows the lack of visual penetration past the point of fire, on my commandos it shows my custom particles visually simulating a railgun shot and at the end of the video i kill the engineer behind my commando due to how the leadin/leadout is relative to the target area and not the firing object. Also i have the line widt set to really narrow (less then 5 iirc) so i need to adjust a few times with force fire to line up the damage hence why it looks why the commando isnt hitting anything the firs 5 shots or so.

 

Edited by Ravendark

Share this post


Link to post

Very interesting work.

It seems that there are too many issues with using this method (the weapon killing units in the reverse direction is particularly bad).

 

Once again do you have some weapon code?

Share this post


Link to post
<WeaponTemplate
        id="OSR_DeltaRifle2"
        Name="OSR_DeltaRifle2"
        AttackRange="250.0"
        WeaponSpeed="999999.0"
        FireSound="GDI_Commando_Weapon1FireMS"
        FireSoundPerClip="GDI_Commando_Weapon1Fire"
        FireFX="OSR_RailGunLaunchEffect"
        FireVeteranFX="OSR_RailGunLaunchEffect"
        RadiusDamageAffects="ALLIES ENEMIES NEUTRALS"
        ClipSize="10"
        CanFireWhileMoving="true"
        AcceptableAimDelta="10d"
        >

        <!--         FireSoundPerClip="GDI_Commando_Weapon1Fire" -->
        <!-- ;;;;; CanFireWhileMoving is TEMP !!!!!!!!!!!!!!!!! -->
        
        <FiringDuration
            MinSeconds="1.0s"
            MaxSeconds="1.1s" />
        <ClipReloadTime
            MinSeconds="2.1s"
            MaxSeconds="2.1s" />
        <Nuggets>
        
            <LineDamageNugget
                 LineWidth="5"
                 LineLengthLeadIn="250"
                 LineLengthLeadOut="250"
                Damage="500.0"
                Radius="0.0"
                DamageType="GUN"
                DamageFXType="GDI_MACHINEGUN"        
                DeathType="EXPLODED" >
            </LineDamageNugget>
            <SuppressionNugget
                Radius="10.0"
                Suppression="25"
                DurationSeconds="5s">
            
            </SuppressionNugget>
        </Nuggets>
    </WeaponTemplate>
 

Idd the code is a bit fickle at best.....from the top of my head i was more thinking along the line of its use being: sort of a overpenetrator weapon, able to hurt anything slightly infront and slightly behind the intended target (think anti material sniper ), at best the LineLengthLeadIn="250" part would need to be matched with a minimum range component to not fire behind the unit. All by all i still personaly prefer the linedamage component over the lineardamage module i used before....it behaves more reliable then the lineardamage module imo. Also the ability to hit garrisonned units can come inhandy, where as other line damage mimicing coding usualy involves secondary components or spawns to hit garrisoned units.

 

Now on a sidenote...my vision for a railgun weapon wasnt asmuch as a full line weapon. i always wanted more along the line of a forcefull impact with a damage area infront and behind the intended target. Altho the linedamage nugget could do that i was thinking of using the damage arc atribute in the damagenugget, along the lines of:

 

 

<xs:attribute name="DamageArc" type="Angle" default="360d" />
<xs:attribute name="DamageArcInverted" type="SageBool" default="false"/>
 

the idea i have is to have a narrow path of damage infront of the unit hit by the railgun round, wich does high damage. while using a broad fanlike area hit behind the unit hit, mimicing high velocity exit wound spraying shrapnell behind the unit hit, lower damage but over a wider area.

 

something like:

 

 

<Nuggets>
        
            <DamageNugget
                DamageArc="60d"
                Damage="100.0"
                Radius="100.0"
                DamageType="GUN"
                DamageFXType="GDI_MACHINEGUN"        
                DeathType="EXPLODED" >
            </DamageNugget>

             <DamageNugget
                DamageArc="10d"
                DamageArcInverted="true"
                Damage="500.0"
                Radius="50.0"
                DamageType="CANNON"
                DamageFXType="GDI_CANNON"        
                DeathType="NORMAL" >
            </DamageNugget>
           
        </Nuggets>
 
Edited by Ravendark

Share this post


Link to post

Interesting, thanks!

 

At some point in the future I will be trying to do a Tiberian Sun style rail weapon, so this is of interest to me.

Share this post


Link to post

This is my mod' weapon just like Natasha snipeshot

	<WeaponTemplate 
		id="UmagonLinearSnipeGun"
		Name="UmagonLinearSnipeGun" 
		AttackRange="450.0" 
		MinimumAttackRange="10" 
		WeaponSpeed="999999.0" 
		RadiusDamageAffects="ALLIES ENEMIES NEUTRALS"
		AcceptableAimDelta="0d"
		FireFX="FX_GDISniperFire"
		FireVeteranFX="FX_GDISniperFireHeroic"
		ClipSize="1">
		<PreAttackDelay
			MinSeconds="0.5s"
			MaxSeconds="0.5s" />
		<FiringDuration
			MinSeconds="0.5s"
			MaxSeconds="0.5s" /><!--2s-->
		<ClipReloadTime
			MinSeconds="3.0s"
			MaxSeconds="3.0s" />
		<Nuggets>
			<ActivateLinearDamageNugget Lifetime="0.65s" />
		</Nuggets>
	</WeaponTemplate>	
	<WeaponTemplate
		id="UmagonSweepWeapon"
		Name="UmagonSweepWeapon"
		RadiusDamageAffects="ENEMIES NEUTRALS">
		<Nuggets>
			<DamageNugget 
				Damage="1000.0" 
				Radius="2" 
				DamageType="GUN" 
			/>
		</Nuggets>
	</WeaponTemplate>

 

Edited by ztz2019

Share this post


Link to post

Yours is the LineDamage, and mine is the LinearDamage, which is better if used in TS style railgun? Or the Natasha-like snipegun?

 

Another, have you got an idea about Jarmen Kell or Natasha's pilot-kill shot? Now I could just make a special die style and create new husk unit replace the being shot unit.

Share this post


Link to post

LineDamage is more like a railgun.

Imagine LinearDamage more like a projectile that travels a certain distance and does damage around it at a certain interval (1/5s).

Share this post


Link to post

Yours is the LineDamage, and mine is the LinearDamage, which is better if used in TS style railgun? Or the Natasha-like snipegun?

 

Another, have you got an idea about Jarmen Kell or Natasha's pilot-kill shot? Now I could just make a special die style and create new husk unit replace the being shot unit.

 

LineDamage is more like a railgun.

Imagine LinearDamage more like a projectile that travels a certain distance and does damage around it at a certain interval (1/5s).

 

Like Lauren said.

 

But if you read my starter post, there are drawbacks to all 3 methods:

 

Method 1: linear damage nugget+ module:

 

Basicly the drawback is that it will travel between 2 fixed points its minimum and maximum range, it also has issues with lining up the damage area with projicle/tracer paths specialy when rapidly targeting different contactpoints on the target.

I wouldnt use it for a railgun effect but more for a shockwave or a mazer/microwave projector weapon where you put those FXs in the fireweaponFX and use the linear to do fixed start to end damage.

Method 2: linedmg.

The good thing is the damge trajectory matches the projectile/tracer path. The drawback is that if you use a large leadin and you target a unit that is close then the leadin range, you will actually fire/do damage behind the unit firing the weapon. A added benefit or drawback depending on how you see it is that it can kill stuff in garrisons without the garrison clear nugget.

This one is better suited for the railgun, altho keep in mind the minimum leadin vs minimum fire range or expect funny damage effects.

 

Method 3:

Using the arc atributes in the standard damage nugget, you can mimic entry and exit wound/shrapnell splatter effects....if you use a real narrow arc you could even simulate a overpenetrator round effect by damaging things infront of the target and behind it. but again minimum range..keep it in mind to avoid weird damage zones.

 

the die/husk thing isnt that hard. Use one of the EXTRA_# deathtypes and couple that to objectdiecreate module, then spawn a exact copy of the vehicle but give it the husk kindof properties.

Edited by Ravendark

Share this post


Link to post

Method 3:

Using the arc attributes in the standard damage nugget, you can mimic entry and exit wound/shrapnel splatter effects....if you use a real narrow arc you could even simulate a over-penetrator round effect by damaging things in front of the target and behind it. but again minimum range..keep it in mind to avoid weird damage zones.

I just had a quick test using the damage arc method. For what I want (a Tiberian sun style Rail cannon), it will not do.

I was hoping that the 'DamageDealtAtSelfPosition' attribute was working, but apparently it does nothing (this was used in BFME for area of effect melee attacks, to indicate that the damage origin point is from the attacker, rather than the target).

With that attribute not working, I cannot get a consistent result.

 

With the Line damage module, because I am looking to have a weapon with quite a long range, I would need multiple versions of the weapon (to minimise the whole 'hitting targets that are behind the weapon' thing), and then I would need a way for the object to choose the right weapon depending on the target distance, that worked with the C&C3 turret system (ie it would have to be a 'PRIMARY' weapon).

 

Like you have stated, the Linear damage module is useless for this kind of weapon.

 

I am struggling to find a reason not to use a similar style 'WeaponFireUpdate' projectile solution as I have done on my Disrupter.

This is also not an ideal solution, but it is at least pretty simple, and does not require a complex work around.

Since I only want this type of weapon on one-of-a-kind type units or structures, I am looking into solutions for the whole 'hitting large items multiple times' and 'unit was so small it never got hit' issues.

 

In regards to potential 'stupidly complex' code based weapon switching.

As far as I know (and I don't know much!) the only area where lua code can be used to get the range of a target is inside a 'ScriptedModelDraw' (the 'CurDrawableGetCurrentTargetDistance(#)' function).

I was thinking that you could have various distances, trigger different ObjectStatus (CurDrawableObjectStatus(#)?) or model condition (CurDrawableModelCondition(string modelConditionName)) or something that can either directly get the correct weapon choosen (if you can set the object status), or get a scripted lua event triggered.

Share this post


Link to post

Ye that seems like a pickle. From the top of my head i can only think of a projectile that uses a fireweapon update....any other solution i can think of atm propegate past the initial target or have issues when the target closes in to the firing object. But the problem with a railgun is that the carrier projectile's speed is to fast for the fireweaponupdate to be proccing reliable...or atleast it has been in my little tests.

Share this post


Link to post

Ye that seems like a pickle. From the top of my head i can only think of a projectile that uses a fireweapon update....any other solution i can think of atm propegate past the initial target or have issues when the target closes in to the firing object. But the problem with a railgun is that the carrier projectile's speed is to fast for the fireweaponupdate to be proccing reliable...or atleast it has been in my little tests.

No, you are right, I was used to using it on much slower projectiles.

I will leave this for now, I would need to look into a multi weapon Line damage solution.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×