2.0's new weapon tweakables

Forgive me if there’s a resource on this already somewhere buried in the forums. The 2.0 update brought a new lot of things to .wepn files(amoung other things) that I am not aware of any documentation of. My attention has been in other areas since then, but it’s starting to come back around. So, I’m going to document here everything new I’ve come across, and when I figure things out for sure about them I’ll add that information. Eventually I probably ought to move it to a wiki page, but it seems more useful here first, especially considering how little information I actually have yet.

These all come in the forum of new functions found in .wepn files, so far I haven’t noticed any changes to the old ones.

Example from kus_hvcorette1.wepn: setFireMultFactor(NewWeaponType, 1.0);

Example from kus_hvcorette1.wepn: setMissProperties(NewWeaponType, 0.02, 0.04, 0.20, 0.30, 0.55, 0.55);

Example from hgn_antishipbomblauncher.wepn: setFrustratedTimers(NewWeaponType, 0.0, 10.0);

Example from kus_hvcorette1.wepn: setLifetimeMult(NewWeaponType, 1.75);

Example from kus_hvcorette1.wepn: setDamageFalloff(NewWeaponType, 0.15/1600.0, 0.1);

Example from kus_hvcorette1.wepn: setAccuracyFalloff(NewWeaponType, 0.15/1600.0, 0.1);

Example from kus_hvcorette1.wepn: setSpeedvsAccuracyAgainst(NewWeaponType, 1, 50.0, 1.92, 100, 1.0, 200, 1.1, 235, 1.35, 270, 0.60, 300, 0.25);

Example from kus_hvcorette1.wepn: setBallistics(NewWeaponType,0,0.0);

Example from hgn_antishipbomblauncher.wepn: setRangeBoost(NewWeaponType, 1.0);

Example from hgn_antishipbomblauncher.wepn: setRangeByStance(NewWeaponType, 1.0, 1.0, 1.0);

Example from hw1_interceptor.wepn: setMissileKiller(NewWeaponType,1);

Example from vgr_bc_forward.wepn: setMagneticFieldPenetration(NewWeaponType,-800,{MagneticField,-800});

Example from vgr_concussionmissilelauncher.wepn: setDamageMultFactor(NewWeaponType, 1.0);


For this I believe the format is (NewWeaponType, Multiplier Value 1, Speed 1, Mult Value 2, Speed 2, etc)

Example from hw1_interceptor.wepn: setMissileKiller(NewWeaponType,1);

I believe this means it can target munitions - remember we don’t have to make every ship a minelayer now.

Example from kus_hvcorette1.wepn: setBallistics(NewWeaponType,0,0.0);

This is the ballistics/RNG flag - I’m not sure what the three parameters are though.

Also here’s the big infodump from @EvilleJedi

Legacy bug fixes of original Homeworld 2 code:

-When a bullet was marked as a miss, the “noise” added to its trajectory was not calculated from the direction the bullet was aimed, causing ships shooting at diagonal angles to not miss correctly.

-The decision gate that determined when a weapon could fire again was not set up properly. In fighter versus fighter engagements this manifested in fighters having trouble shooting at fast moving targets because they were disallowed from firing. This has been fixed.

New Weapon features:

setLifetimeMult(NewWeaponType, MULT);

//Bullet life is normally a ratio of speed and weapon range multiplied by a fixed percent to add padding. This percent is now exposed as a multiplier on a per weapon basis allowing for missed bullets to travel further than the range they were initially fired within, striking targets beyond what they were aimed at.

setDamageFalloff(NewWeaponType, FALLOFF/RANGE, PERCENTAGESTART);

//Bullet damage can be reduced based on distance of bullet travel. Shot damage can be multiplied against how much damage is lost in meters per second over the range of the weapon, beginning at a defined point. The damage falloff starts at the defined point, which is expressed as a percent of the total weapon range (i.e. You can have a weapon that loses damage over the entire lifetime of the bullet or a weapon that does full damage for 80 percent of its travel but does diminishing damage to targets within the last 20 percent of its range.

setAccuracyFalloff(NewWeaponType, FALLOFF/RANGE, PERCENTAGESTART);

//Same as damage falloff. For Homeworld 2 style bullet steering, it acts as a multiplier against the weapon accuracy against its target, reducing the chance the bullet will steer into its target. For ballistics enabled weapons it acts as a multiplier against the weapon accuracy against its target, reducing the chance the bullet will be considered an aimed shot if it strikes its target.

setMissProperties(NewWeaponType, MissConeHorizontal,MissConeVertical, MissLowDamage,MissHighDamage,MissSpeed,MissLifetime);

Miss Cone

//In Homeworld 2 accuracy modeling, if a bullet is marked as a miss, bullet steering was turned off and “noise” was added to the bullet trajectory to make it fire off-center. The amount of noise added to the initial trajectory (up or down plus left or right) created a miss cone. The miss cone is now definable on a per weapon basis and can be expanded or contracted (to zero).

Miss Hi/Lo damage

//If a bullet is marked as a miss and strikes a target anyway, the damage is multiplied against a range defined as high and low damage. Expressed as a percent of the damage had it been marked as a hit.

Miss speed

//Bullets marked as a miss can travel at a reduced speed. Multiplied against the original bullet speed.

Miss Lifetime

//Bullets marked as a miss can travel over a reduced range, simulating misfires

setSpeedvsAccuracyAgainst(NewWeaponType, SPEED, MULT); //Accuracy adjustments for this weapon against targets traveling within SPEEDRANGES

setBallistics(NewWeaponType,BOOL,FIREAHEAD,FIREBEHIND); //Bool turns on/off ballistic modeling on the weapon. FIREAHEAD/FIREBEHIND are optional and allows the weapon to fire in front or behind the target.

Ballistic Modeling

//Weapon steering can be enabled or disabled on a per weapon basis.

On weapons with steering (non ballistic), the engine ensures that a percentage of shots fired will strike the target based on the accuracy table within the weapon.
On weapons without steering (ballistic), the weapon aims directly at the target and fires (or ahead of/behind, if deflection capable), and whether it hits or not is subject to bullet speed, target speed, weapon range and target behavior.
The accuracy table is used to determine the number of shots that are considered “aimed”. An aimed shot does full damage if it strikes the target , an unaimed shot is subject to the miss rules (miss cone, Hi/Lo damage, miss speed and miss lifetime) to determine bullet damage and behavior.

Multiple combinations exist to create several hybridizations of ballistic modeling. Almost all strike craft and ships designed to counter strike craft now utilize some form of ballistic modeling.


Missile Killers

//The requirement for a ship to be able to lay mines in order to consider firing at a missile has been removed. Weapons marked as missile killers can fire upon missile based weaponry (torpedoes, missiles, mines, NOT bullets).

setRangeByStance(NewWeaponType, AgRange, EvRange, NeRange); // All as percents of the range set during creation.

setFireMultFactor(NewWeaponType, MULT);


Yeah, that one got my attention when going through there. Making missile PD work right has been something of a white whale for a long time, hopefully it’ll

Two parameters really, thats a 0 and a 0.0, not three 0s.

So, can we confirm for the setBallistics one, which one do I need to get for the shells to go ballistic like in HW1? (1,1,1)?

I would want either documentation on the parameters or extensive testing of how a weapon’s performance changes with different vales before I would say anything was confirmed.

1 Like

Amen to this. BTW, do you know where I could find some good tutorials on missiles? Particularly for anti-fighter/missile missiles. I have some stuff, but if there was a good method to get really reliable results for interception, I’d be pretty glad to see it.

I slaved over our own anti-fighter missile tuning for a long time before I felt it was passable, IIRC I found that you want your missiles speed to be relatively close to the target you’re trying to kill or they’ll frequently overshoot and miss. That may be improved with 2.0, I haven’t tilted at that windmill since then.

That seems sensible. One thing I will try to do is to see if I can tinker with area damage with proximity misses. For example, what if the missile spawned another very short ranged missile when in close proximity to its target, and the secondary missile would have an area of effect damage when it hits or maybe some unholy agility making it impossible to miss?

that was something I wanted to do, but I never got proximity detonation to actually do anything.

working on a data dump to, among other things, help investigations of these new values. Here’s what I have so far: http://hwat.pathstoeat.com/hwrmc/weapons/index.html


Anyone figured out what these weapon functions do yet?
setFrustratedTimers(NewWeaponType, 0.0, 10.0);
setFireMultFactor(NewWeaponType, 1.0);

See here for something better: [TOOL] Stats Tool

1 Like

I wonder if firemult scales the tactics mults?

setFireMultFactor appears has no effect on EMP damage.

The line is setFireMultFactor(NewWeaponType, 1.0); for every single weapon in the vanilla files…