Jump to content
Sign in to follow this  
Madin

Questions regarding weapon damage code

Recommended Posts

I am interested in some insight has to what certain pieces of the code mean.

  1. DamageArc
  2. DamageSubType (what does this do?)
  3. DamageTaperOff (I know that this means that damage decreases from the centre of impact the further out you go, but what is the relationship from the 'DamageTaperOff' number to its effect? eg what is the difference between a figure of 1 versus 50? another example, the vapour bomb has a figure of 5, but the nuke has a figure of 5000, that kind of difference does not make any quantitative sense to me).
  4. VictimShroudRevealer type="GameObjectRef (I do not fully inderstand this).

Thanks for any help!

Share this post


Link to post

Iirc..this was something more used in bfme type games

 

DamageArc...instead of doing radius dmg (360), you can set a different radius (going from the schematic)..to create a cone like area of effect...think maybe flame tank or swordslash (bfme like) infront of a unit

  • Upvote 1

Share this post


Link to post

DamageArc

What Raven said, though most prominent example would be Sauron's Mace.

DamageSubType

I don't quite remember and don't have the xml here, so feel free to correct me, I think this was one way of setting up suppression or something, could be totally wrong as said, might check tomorrow if I remember to..

DamageTaperOff

This should be the damage at the border of the circle or the amount subtracted at that point. Though this is bugged since it's introduction in Generals, sometimes damaging stuff at the edge more than the center, and never really got fixed.

VictimShroudRevealer

This is an object spawned for the player of the target (of for example artillery that would be way back in the fog) which does nothing but having a sight radius so it reveals the object firing this weapon.
  • Upvote 1

Share this post


Link to post

I don't quite remember and don't have the xml here, so feel free to correct me, I think this was one way of setting up suppression or something, could be totally wrong as said, might check tomorrow if I remember to.

 

I thought it was a way to bypass certain armor resist. Think along sniper only doing extreme dmg to infantry armor but almost nill to vehicle armor...if you gave the sniper weapon a subdmg of cannon you could mimic a sort of armor penetration like a 50cal shot....that way the original sniper dmg would remain, you didnt need to switch weapons or have secondary weapons to dmg other armor types.

Share this post


Link to post

Just checked again DamageSubType actually has the type DamageSubType, which is defined as:

<xs:simpleType name="DamageSubType">
<xs:restriction base="xs:string">
<xs:enumeration value="NORMAL" />
<xs:enumeration value="BECOME_UNDEAD" />
<xs:enumeration value="SELF" />
<xs:enumeration value="UNDEFINED" />
</xs:restriction>
</xs:simpleType>

 

And only used once in BFME2 in EvilMenBlackRiderMorgulBlade.

It triggers OCL_BecomeUndead defined in the DefaultThingTemplate which all objects in BFME inherit from. Used in DamageFilteredCreateObjectDie (which spawns a wraith after killing the undead thing).

So for example SELF would be useful in conjunction with the weapon having OnlyKillOwnerWhenTriggered set to true, triggering a spawn of something. Looking through the xsd DamageSubType is really only used with DamageFilteredCreateObjectDie.

Edited by Lauren

Share this post


Link to post

1. Why would the only unit in TW tha used that be the harvester?...it uses NORMAL as subtype iirc. Is normal the default modifier?

 

2.Is it possible widen that list with other variables like EMP or so?

Share this post


Link to post

1. Why would the only unit in TW tha used that be the harvester?...it uses NORMAL as subtype iirc. Is normal the default modifier?

In C&C3 code you can see a kind of progression were old ideas were dumped and new ideas taken on (same thing with the older W3D models and their draw call optimisation versus the later W3D).

In short it does not mean anything, has with plenty of the C&C3 code, they never got around to tidying it up.

Share this post


Link to post

Ye that is true. wish somethings were alot more obvious on what are leftovers and what are still working code. Even seven years afyer release its a pain to find out what still works true trial and error.

I guess Sage2 is abit more neater these days.

Share this post


Link to post

A few more questions.

 

Does anyone know why the shockwave reactions and usage in C&C3 is so rubbish?

In BFME they were great and added a lot of visual feed back to the power of certain weapons, but in C&C3 they are hardly used, and when I look through the code and I see that a few weapons have 'MetaImpactNugget' modules, there is almost no reaction in game, or in the case of the Scrin Rift weapon, it looks stunted.

Also does anyone know what the 'ShockWaveClearWaveMult' and 'ShockWaveClearFlingHeight' attributes mean?

 

Does anyone know how (and if) the 'LineDamageNugget' works?

			<xs:extension base="DamageNuggetType">
				<xs:sequence> </xs:sequence>
				<xs:attribute name="OffsetAngle" type="Angle" default="0d"/>
				<xs:attribute name="LineWidth" type="SageReal" default="0"/>
				<xs:attribute name="LineLengthLeadIn" type="SageReal" default="0"/>
				<xs:attribute name="LineLengthLeadOut" type="SageReal" default="0"/>

Thanks for any help!

Share this post


Link to post

IIRC the shockwave effect was rather well used in Generals aswell...i did notice that it is under average in use in TW/KW....but maybe its because of the gravity/physics behavior modules...can't remember if previous games had those. Also i think you need to give a unit "flight/tumble characteristics aswell...think jetpacking commando being its own projectile"

Maybe if you tone the gravity multiplier down the shockwave effect could be better? just a thought

 

 

<xs:attribute name="TumbleRandomly" type="SageBool" default="false" />
                <xs:attribute name="MaxXRotationVelocity" type="SageReal" default="360.0" />
                <xs:attribute name="MaxYRotationVelocity" type="SageReal" default="360.0" />
                <xs:attribute name="MaxZRotationVelocity" type="SageReal" default="360.0" />

                <xs:attribute name="AllowBouncing" type="SageBool" default="false" />
                <xs:attribute name="KillWhenRestingOnGround" type="SageBool" default="false" />
                <xs:attribute name="GravityMultiplier" type="SageReal" default="1.0" />
                <xs:attribute name="OrientToFlightPath" type="SageBool" default="false" />
                <xs:attribute name="ShockStunnedTimeLow" type="SageUnsignedInt" default="5" />
                <!-- LOGICFRAMES_PER_SECOND -->
                <xs:attribute name="ShockStunnedTimeHigh" type="SageUnsignedInt" default="10" />
                <!-- LOGICFRAMES_PER_SECOND * 2 -->
                <xs:attribute name="ShockStandingTime" type="SageUnsignedInt" default="5" />
                <!-- LOGICFRAMES_PER_SECOND -->
 

you beat me a few days/week towards using the linedamage component (i had a question like that on the old official forums wondering if it works like in RA3) to simulate a TS like railgun penetration.

Ill probably try that out over the next days....im currently using a railgun effect that is 99% lineardamageupdate and 1% directional particle effect used as a fireFX...it looks 8/10 times convincing enough but was planning on trying the linedmg thing directly from the weapon aswell.

Share this post


Link to post

Also i think you need to give a unit "flight/tumble characteristics aswell...think jetpacking commando being its own projectile"

Maybe if you tone the gravity multiplier down the shockwave effect could be better? just a thought

 

you beat me a few days/week towards using the linedamage component (i had a question like that on the old official forums wondering if it works like in RA3) to simulate a TS like railgun penetration.

Ill probably try that out over the next days....im currently using a railgun effect that is 99% lineardamageupdate and 1% directional particle effect used as a fireFX...it looks 8/10 times convincing enough but was planning on trying the linedmg thing directly from the weapon aswell.

If that does not work then you can try using a 'FireWeaponUpdate' on the actual projectile being fired.

The benefit to this is that the damage is very close to following the actual path of the projectile (I use it for the Disruptor in my mod).

The negative is that no experience is gained for any of the damage done by the 'FireWeaponUpdate'.

Share this post


Link to post

@Raven: Yes a tumble is needed to make it more realistic, also BFME, maybe also Gen, had in addition to that animations for being in the air and landing/getting up again.

ShockWaveClearWaveMult is a scalar for the speed of which the radius is cleared.

ShockWaveClearFlingHeight is the absolute height the objects are flung when the radius is cleared.

Both only work if ShockWaveClearRadius is set to true, and if it's set to false the objects are just thrown straight up into the air iirc.

So the module is half broken, but it reminded me of a test mod I did some years back. Quickly compiled it and made a short video, imo it looks pretty okayish, though vehicles are pretty stiff, a tumble thing might help, didn't test it, and get up animations for infantry is a must:

 

 

 

@Madin: Can't remember if it works in TW/KW but you might be able to spawn the projectile as a slave which passes it's xp on to the slaver. Also I cannot recommend both options as it only works well for slow moving weapons. Any faster weapon will leave areas unharmed, also the difference toward using linear damage towards an object with fireweaponupdate is that:

-Linear only hits once, while fireweaponupdate circles can overlap, causing more damage

-only 1 Linear weapon per source can be active, so it has to reach its end before spawning a new one, else the old one will just be removed

  • Upvote 1

Share this post


Link to post

That is a noticeable improvement.

 

Thanks for the detailed information.

Share this post


Link to post

If you want I can upload you the mod too.

Share this post


Link to post

If you want I can upload you the mod too.

Yes please, that would be very helpful!

Share this post


Link to post

I'll upload it in a bit (on laptop right now) one thing that is important for the MetaImpactNugget: its effect is always created at the object that fired the weapon. So for the Nod Nuke I actually had to reconfigure it a bit as the original nuke just fires a weapon which is completely detached from the animation and its damage is just delayed. If I had just placed the MetaImpactNugget into this weapon stuff around the temple would be flying away, not the nuke itself, so I created a deathweapon for the nukeseed and moved the damage and meta impact there.

Keep this in mind especially for non projectile weapons like infantry/apc miniguns.

Edited by Lauren

Share this post


Link to post

http://1drv.ms/1vNlp2k Nuke.7z is the file you want. It's made for TW but can just be used in KW with some alterations.

  • Upvote 1

Share this post


Link to post

Another question.

 

The 'SurpriseAttackObjectFilter' element. I am just interested has to what constitutes a 'surprise' attack.

I see that it is use for Fanatics and Buzzers (when garrisoned), but I do not really understand it.

Share this post


Link to post

There is a surpise_attacker kindof aswell. No idea hw they are used if at all together.

 

It could be that both units (fan's and buzzers) weapons have a meleerange/chase component, and that might not work whle they are garrisoned...so they attack when something is close enough(almost touching the building)...but it seems underused in TW...one would think it would be coupled with a invisibility while garrisoned function..bit like boobytrapping a building of sorts.

Share this post


Link to post

A few more weapon related enquiries:

 

'ScaleWeaponSpeed' attribute: This is broken right? I have a surface-to-surface missile that would benefit from being able to fix the speed, but apparently it does not work in C&C3 (a lobbed projectile seems to get its speed scaled automatically in C&C3, although that may have something to do with the Bezier projectile settings).

 

'CapableOfFollowingWaypoints' attribute: What does this do? (or more likely, what did it use to do when it worked in a previous sage engine game).

 

'ContinueAttackRange' attribute: Same question has above.

 

'SuspendFXDelaySeconds' attribute: I could not find any information on this setting from previous sage games.

 

'ForceDisplayPercentReady' attribute: Am I right in assuming that this no longer works? Was this a BFME thing?

 

Thanks for any information!

Share this post


Link to post

ScaleWeaponSpeed: Iirc the bezier projectile does not really scale its speed on the curve but the flat distance between the source and target thus with a more elaborate curve the projectile is faster. This should work as intended, but it might not, dunno.

 

CapableOfFollowingWaypoints: This was heavily used in Generals for cool effects like the carpet bombing being able to bomb in a curve. You can setup a waypoint path in the WorldBuilder and tell the carpet bomber to fire on waypoint. As the attack is continuous for some seconds it will fire the weapon while following the waypoints. Without this attribute the weapon would stop firing when flying to the second waypoint.

 

ContinueAttackRange: Let's say you have an object with AttackRange x and ContinueAttackRange y, while x < y. The target has to move into range x but as soon as the attack started the object can still attack as long as the target is in range of y.

 

SuspendFXDelaySeconds: I guess it's to have the fx played delayed, like DelayTimeSeconds in the DamageNugget. I would think it's to sync up fx and actual damage effect.

 

ForceDisplayPercentReady: This causes the reload animation to play at an other point, iirc between shots, not just clip reload. Afaik this was to easily scale preattack animation of the Balrog whip, could be wrong though.

  • Upvote 1

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.

×