Tutorial:Missiles and You

From Total War Modding
Revision as of 20:59, 2 February 2022 by The Duke (talk | contribs) (Added a missile guide)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Missiles and You.

This guide covers all things shooty, throwy, fire-y and lob-y. It assumes a familiarity with RPFM and basic modding knowledge. It will cover all of the essentials and then some, but is not exhaustive, because there’s *a lot* you can do.

projectiles_tables is the primary table where all the fun happens. This gives the properties of,you guessed it, the projectile, but also of the base reload times for the weapon etc, so it goes beyond that, it’s basically the primary table that controls how missiles work. In TWWH, its typical that most units have a unique entry, but in most Historicals entries are shared between many units. This guide is more of a what-does-what than a step by step so either making a new one or editing an existing matters not for the purposes of this, but if you make a new projectile *PLEASE* use a vanilla entry as a basis. You do not want a load of figures to go through one by one figuring out what box you messed up on, it isn’t fun for anyone.

CLASSIFICATION

Key works like any other - have it unique. It will be referenced in missile_weapons. Boring, but vital.

Projectile Category is an interesting one and is primarily a metadata thing, you can get the full explanation in the Modding Dens resource channel, but the short version is that arrow and musket are small arms, blocked by shields and with their own volley fire behaviours accordingly. Misc ignores shields. Artillery ignores shields, adds spinal dismemberment for lots of blood and applies a morale penalty for Under Artillery Fire and Hit By Artillery, for close misses and hits respectively, the details of which can be found in kv_morale should you fancy looking.

VISUALS

Projectile display chooses what is displayed. A fairly self explanatory table that usually has a vanilla option. If not youre making your own rigid and thats beyond the scope of this guide.

The audio in projectiles (names projectile_audio, inventively) is the sound of the projectile in flight, not the sound the gun\bow\cannon makes, that comes much later

PHYSICS

Trajectory Sight is the first thing I choose in the design of a new projectile. It chooses the overall rules, and everything else follows - there are three to choose from: low, fixed and dual_low_fixed. low operates by having a fixed velocity and variable angle - like a gun, it shoots at whatever speed it shoots and ten adjusts how high in order to hit the distance. If it can’t hit with that velocity from it being too slow or obstructed, it won’t shoot. fixed works the other way around, fires at a fixed angle with variable speed - like a howitzer that shoots at the same place but changes the charges to alter distance. It will slow or speed up the projectile accordingly. dual_low_fixed uses low if it can, and fixed if that shot is blocked, like throwing a ball flat at what you can see, or lobbing it over a wall. Your choice here will alter the weightings of significance of the other stats.

Muzzle velocity is the next key beast, which chooses how fast the projectile moves. Faster projectiles fire in a flatter arc, hit moving targets more easily, and hit with more physical force for greater knockback/knockdown. If you have any homing parameters, which i won’t cover in detail, be aware that they alter velocity as a %, leading to some wild results if you crank up velocity without adjusting accordingly.

Fixed Angle is, you guessed it, the angle that fixed uses. Pretty self explanatory but important. 90 is vertical. Not much to say otherwise about this but it seems a good point to mention that the origin of the projectile is controlled by the metadata in the animation, so the angle of any shot is calculated from that point. It’s rare that this matters much more than “ooh that's a touch funky” but it's good to know.

You also have max and min angle for low firing. They rarely matter but i've mentioned because if you mess up one of them it might stop one person bashing their head against the wall with an issue one day.

Mass is relevant in that it knocks down, back and over units that it hits. This is used in conjunction with velocity, much like unit collisions, if you weigh more and go faster, you hit harder. Be aware that velocity makes a colossal impact for this.

Gravity. The heartless bitch of a column. This is messy and unpredictable and all around unpleasant. It’s also the single most satisfying thing to get right. You’ll find that most, but certainly not all, vanilla projectiles have -1, basically meaning “no”. This will give them a smooth, predictable curve unharmed by the painful whims of gravity. Any positive value will mean gravity is free to act on the projectile, and pull it down. The higher the figure, the more noticeable this is. It is a great tool for making an axe throw or a javelin or an {X} feel weighty in flight and like a solid thing flying through the air - great fun on artillery and thrown weapons, and I personally love it on bows too but it's a fickle mistress. If you’ve used gravity and find that your unit just won’t shoot for love nor money, start here in your troubleshooting as too high a figure can easily mean that your range cannot be met and the unit just says No. Iteration is the name of the game here, hard to say what figures are good, try it and see then change it when it’s inevitably wrong. It may demand high velocities to function if you hit a sticking point.

Can bounce and can roll decide if the projectile can bounce and roll. This is the last statement of the obvious, but worth knowing that they exist.

Projectile penetration could go in a few places but it’s going here. It alters how many models of what size the projectile can go through and harm. It refers to the projectile_penetrations table so you’ll need to set that up for a custom one. Vanilla convention is typically size of entity in battle entities, then number of those it can kill, for example large_3 will penetrate 3 large entities, medium entities or small entities and not go through very large or giant, just hitting the one. Magic is usually used for magical stuff instead of a number and roughly translates as “shit loads”

STATS

Okay so now you have a missile hurtling through the air but now it’s time to balance it. Damages work like any other, split between base and armour piercing, magic or physical, fire or not fire. The damage shown on the unit card is averaged as dps over 10 seconds. Which leads us on to

Reloading is a multi stage beast: Base Reload Time - the base reload time of the projectile in seconds. How long it takes to shoot, all other things being even - which they never are. Typically units will have a reload modifier in land_units, around 10 is usual in wh, -20 to 60 in 3k and every number under the sun in the gun based games. This stat is called reload, reload(ing) skill or percentage reload reduction depending on game. Its a % reduction, so bear that in mind when you set your base reload up - if you want it to shoot every 30 seconds, 33 is a good starting figure, but that’ll depend on what you do to the unit and how much you want to reuse the projectile on multiple units and vary it there. You’ll figure that out.

Accuracy is a bit of a menace to get proper figures but you’ll just have to live with that. It is broken up into a few core stats. First is accuracy (shocker, I know). This is in turn made up of the marksmanship bonus in projectiles_tables and the accuracy stat in land_units, added together. Don't ask what it does, just know that bigger makes you hit more. Then you have calibration distance - this is the distance beyond which the missile becomes much more inaccurate. Bigger means greater distance that you’re accurate at, while a short one will mean you are accurate up close but poor at range. This is a stat that allows more skill to be placed in positioning by players and gives a reason not to sit at max range, but be aware that as the ai operates almost exclusively on attack orders, it will use missile troops at max range the vast majority of the time regardless, and can compensate for this much less than the player - just something to bear in mind. Note: this is in projectile tables in most modern tw, but some older games like empire have this as a common-to-all figure in kv_rules. Then we have calibration area, think of this as the size of the circle that the projectile is calibrated to and lands in. It decreases accuracy rather severely and swiftly since its area of a circle you're working with, so pi gets involved to ruin your day. Not 100% on if this is radius or diameter but either way, bigger is less accurate on this one.

Range goes by a few names, effective, max, just plain old range. They all mean range. Worth mentioning expiry range here - this is the distance that the projectile ceases to be. If you have a range that exceeds this, or is even near this (given that it’s not travelling in a straight line) then you’ll run into issues. The greater the arc of the shot, the more this figure will have to exceed the max range. -1 means it won’t expire from range (you can have it expire on impact if you prefer, or just chill there if there won’t be vast quantities)

Scaling damage is a rare one but has the word damage in it so it will get poked. It increases your damage as the enemy health gets lower, in accordance with the referenced table.

GETTING THE BASTARD IN GAME

Okay so thats covered how to make a very nice, very not in game projectile. This next bit is actually mercifully simple.

Missile_weapons table is the next link in the chain. This creates a weapon that units can be assigned, again give it a unique key. You can then reference your projectile key, choose the sound profile, and decide if it’s a precursor weapon or not - precursor means no ranged attack orders, fire at will works or they will fire on the charge and no ranged fire arc indicator.

In land_units, primary missile weapon refers to your key from missile weapons - and at this point you’re probably thinking you've had enough and want t go try the thing - do so, but remember to give the unit some ammo.