UFO:Alien Invasion

General => Discussion => Topic started by: Jon_dArc on May 11, 2012, 06:18:16 pm

Title: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on May 11, 2012, 06:18:16 pm
Understanding that with 2.4 having just been released 2.5 is very much in a kind of "gameplay alpha" status with lots of fluctuations in values likely, I'd like to bring up for discussion a few things that caught my attention with the weapons and damage weights as they currently stand. For organizational reasons I'm going to put each new subtopic in a separate reply. First up: laser weapons.

Laser weapons appear to have been nerfed into uselessness. Accuracy has been drastically reduced (and the non-pistol weapons have picked up an inexplicable penalty to accuracy for burst-fire modes), laser pistol damage has been substantially reduced, and though the Heavy Laser got a slight damage bump it also got more TU-expensive. Worse yet, nothing is vulnerable to it—the Shevaar have no resistances, but the other three species resist at least a third of the expected damage before armor (Ortnoks are guaranteed to take 1 damage per laser pistol hit, and resist ~73% and ~50% respectively for the laser rifle and heavy laser). Armor also has substantial impact.

In 2.4, at least, the implied bargain was "high accuracy, reasonably fast, low damage, stay away from Ortnoks". IMO at least it failed at this by being too effective overall, so a nerfing was needed. Unfortunately, by striking at both accuracy and damage the pendulum has swung much too far in the other direction—I'm honestly not sure that the weapons would be viable even with 2.4 accuracy, given 2.5 damage and TU use, but as it stands they're a clearly bad bargain.

I'm inclined to say that their accuracy characteristics should be restored to their 2.4 levels, the Heavy Laser should be restored to its 2.4 TU use, and the Laser Pistol and to a lesser extent Laser Rifle should get a damage bump—maybe to 30±5? Or 25±5 and a drop in Ortnok resistance? Actually, dropping all base resistances by 10 could work. Well, actually, let's try a more principled approach by comparing it to some other weapons.

Laser pistols have Spread 1.5, Crouch 1, Range 60, 28 ammo, 10 TU reload cost, are 2x3, and have 2x1 ammo. They deal 20±5 laser_light at a TU/shot of 4/1 or 8/3.

7.62mm (???) pistols have Crouch 1, Range 40, 12 ammo, 6 TU reload cost, are 2x2, and have 1x1 ammo. They deal 30±5 normal_light at 4 TU for Spread 2 and 8 TU for Spread 1.5.

Plasma Pistols have Crouch 1, Range 40, 8 ammo, 15 TU reload cost, are 2x3, and have 1x1 ammo. They deal 50±10 plasma_light at 6 TU for Spread 2.2, 10 TU for Spread 2, and 10 TU for 3 shots at Spread 2.8.

Laser pistols have a 50% range edge, but I'd argue that their inaccuracy makes it largely irrelevant—you can't seriously engage targets in the 41-60 range category with any actual hope of hitting. Therefore, I'm going to focus on their other characteristics.

Per-round damage by alien/armor; damage whose range is constrained by minimum damage has its range given in parentheses:

Taman:
7.62mm: 30/15/(1)±5
Laser: 10/5/(1-5)±5
Plasma: 45/15/(1-5)±10

Ortnok:
7.62mm: 10/(1)/(1)±5
Laser: (1)/(1)/(1)±5
Plasma: 50/20/(1-10)±10

Shevaar:
7.62mm: (1-5)/(1)/(1)±5
Laser: 20/15/10±5
Plasma: 60/30/10±10

Bloodspider:
7.62mm: 10±5
Laser: 10±5
Plasma: 50±10

So in terms of damage it's almost strictly dominated by plasma. In principle it would make up that deficit through superior accuracy and volume of fire (fewer TUs/shot, plus a larger magazine and less expensive reloads), but look at how many more shots need to hit:

(Best case-worst case ranges to kill an uninjured alien with no/light/medium armor; probabilities will weight towards the better end, as the worst case requires larger numbers of extreme results)

Taman:
Laser: 7-26/10-130/20-130
Plasma: 2-3/4-26/20-130

Ortnok:
Laser: 150-190 (all)
Plasma: 3-4/5-19/15-190

Shevaar:
Laser: 5-12/6-16/8-32
Plasma: 2-4/3-8/6-160

Bloodspider:
Laser: 10-30
Plasma: 3-4

So with the notable exception of a Shevaar using Medium Alien Armor, you consistently need at least twice as many hits for a kill, wiping out the speed advantage (though reloading speed recovers a little of this) and magnifying the effects of the reduced accuracy. Although 2.4's 36±6 damage for the laser pistol was excessive, 30±5 or maybe 25±5 with a reduction in Ortnok laser resistance (it'd be nice for it to be possible to deal more than 1 damage to an Ortnok, even if it remains a miserable option) seems reasonable.

An alternative to a straight damage boost could be to make Shevaar more vulnerable to lasers and less to plasma, but given that a laser pistol takes up the entire holster I don't think making it a dedicated anti-Shevaar weapon is reasonable, especially given how much time there is between being able to research laser pistols and when Shevaar make their first appearance.

(Another question this raises is whether 7.62mm pistols are intended to have any role in the game—I understand they're intended to become obsolete, but they do that almost instantly, as soon as the player either researches laser pistols+DF cartridges or obtains and researches plasma pistols, plus maybe a bit to build up a comfortable reserve of plasma pistol ammo. Even just making them 3-square L-shaped in the inventory like the machine pistol would go a long way to making them not quite as much a complete joke.)

~J
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: H-Hour on May 11, 2012, 06:32:38 pm
Thanks for this detailed analysis. Gimping the laser rifle accuracy is one of the more controversial decisions. I don't have a lot of time at the moment, but I'll give your comments some serious consideration when I get some time to think about it.
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on May 11, 2012, 08:04:09 pm
The other issue I wanted to bring up at the moment is the way weapons with variant ammo types don't really work at the moment. This currently affects the Rocket Launcher, Grenade Launcher, and Riot Shotgun.

The usual promise of variant ammo types is the ability to react rapidly to different situations, picking and choosing the right tool for the job. The current system fails at this—reloading is very expensive (14 TU for the riot shotgun, 16 for the grenade and rocket launchers). Except in the case of the rocket launcher, which can't be fired twice in a turn anyway (and can't even be reloaded and fired without 40 TUs), this is in excess of the cost of firing a shot—which means that the benefits of changing ammo would need to exceed the benefits of an additional shot with the current ammo (or some maneuvering, or anything else you could do with those TUs). This is a very high bar to clear, and it's made harder by the fact that partially-full magazines are discarded by reloading—not that ammo is terribly tight in the game, but if ammo-switching were otherwise more practical you could burn through a lot of it this way.

There is an alternative reasonable approach: the ability to essentially have a different weapon based on what ammunition you load, and to change that on reloading. This means you're not expecting to switch ammo in the middle of an active fight (at least not without having run the magazine dry first), so the opportunity cost of reloading doesn't matter. The problem is that as it stands each of these three weapons has a very clear "default" ammo type with solid general performance characteristics, with the rest of the ammo types generally being very specialized—strong performance in specific situations with often glaring general weaknesses. Going down the list:

The Riot Shotgun very clearly favors having saboted slugs loaded by default. Range and accuracy are problematic for both ammo types, but significantly more for flechette shells; this is especially true early in the game (which is the only time the riot shotgun isn't obsolete) when Taman vulnerability to normal_medium damage means that a hit is likely to be a kill anyway, rendering flechette total damage advantage irrelevant. Against alien armor normal_medium is a substantially more favoured damage type than normal_spray, and that's also true for the other alien types. Actually, I think the big issue here might just be that flechette shells are bad.

The rocket launcher likewise favors HE rockets—although there's a split between enemies who are strong to fire and weak to blast (Taman, Bloodspider) and those who are weak to fire and strong to blast (Ortnok, Shevaar), alien armor protects against both pretty similarly, and the big damage advantage HE rockets have over IC rockets easily makes up for Ortnok/Shevaar resistance swings. There are some things that suggest that incendiary weapons are supposed to light something (terrain? Units?) on fire and burn over multiple rounds, but I can't tell what that's supposed to be or if it's currently in effect—certainly even if it is, more damage adjudications means more impact from armor (not to mention the advantages involved in killing a hostile before its next chance to act rather than after).

Last, we have the grenade launcher. I was going to call HE grenades the poor man's PB grenades, but they're now plasma_heavy instead of blast, good times. Flechettes have the same damage and damage type as shotgun flechettes, an even shorter range, better accuracy (though still miserable), and worse TU cost and reload time—admittedly ammo is also 1x1 instead of 2x1, but I can't see why someone would consider toting a GL with flechettes loaded instead of just taking a riot shotgun. Incendiary grenades suffer basically the same problem as IC rockets, only now they're sandwiched in by plasma_heavy as well. Ortnoks are slightly more vulnerable to IC than HE, but we've already established that switching ammo on a per-enemy basis is impractical and it's just not a big enough swing (on /one/ enemy type) to load IC by default.

So yeah. Not sure what to do on this; just drastically reducing reload times still leaves the issue of loss of partial magazines, while making it more feasible to have a different default ammo seems like it would be very fiddly in the presence of four alien types and three monotonically increasing armoredness levels. Allowing multiple types of ammo to be loaded simultaneously could help, especially with the Grenade Launcher, but you'd either need to change the ammo-handling code to handle two separate magazines or you'd need a combinatorially-exploding number of "combined magazines". Although I'm a big fan of the combined changes to the Grenade Launcher of beefing up per-grenade damage, increasing range, increasing TU cost, and eliminating the burst-fire mode, this issue is now even worse because of the substantially reduced frequency of running the magazine dry and being forced to reload.

(Also, flechette grenades may just need to go—they're caught in this nasty zone where they'd need to be really compelling, probably overpowered, to compete against either a melee weapon as an emergency close-combat weapon or any of the other weapon options as a short-to-mid-ranged standard-use weapon.)

Anway, just my thoughts on that matter. Time for me to do real work again now.

~J
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: H-Hour on May 12, 2012, 01:07:35 am
I haven't forgotten about the laser post. But that requires more time and testing. A couple things about the ammo variants.

The usual promise of variant ammo types is the ability to react rapidly to different situations, picking and choosing the right tool for the job. The current system fails at this—reloading is very expensive (14 TU for the riot shotgun, 16 for the grenade and rocket launchers). Except in the case of the rocket launcher, which can't be fired twice in a turn anyway (and can't even be reloaded and fired without 40 TUs), this is in excess of the cost of firing a shot—which means that the benefits of changing ammo would need to exceed the benefits of an additional shot with the current ammo (or some maneuvering, or anything else you could do with those TUs). This is a very high bar to clear, and it's made harder by the fact that partially-full magazines are discarded by reloading—not that ammo is terribly tight in the game, but if ammo-switching were otherwise more practical you could burn through a lot of it this way.

This was not the usage I had in mind. I wouldn't expect a soldier to switch out ammo types between shots just for the damage gain. I think of the ammo variants in terms of an entire battle. A soldier is more likely to switch ammo to take on a very specialized role (like incendiary -- more later) or to adjust a soldier's competencies as he moves through the terrain (such as shifting ammo before entering a UFO).

On a separate note -- the damageweights system is still very much a work in progress. Part of the issue is that we still have very few aliens to create distinctive vulnerabilities.

The problem is that as it stands each of these three weapons has a very clear "default" ammo type with solid general performance characteristics, with the rest of the ammo types generally being very specialized—strong performance in specific situations with often glaring general weaknesses.

I think that's pretty accurate at the moment.

The Riot Shotgun very clearly favors having saboted slugs loaded by default. Range and accuracy are problematic for both ammo types, but significantly more for flechette shells; this is especially true early in the game (which is the only time the riot shotgun isn't obsolete) when Taman vulnerability to normal_medium damage means that a hit is likely to be a kill anyway, rendering flechette total damage advantage irrelevant. Against alien armor normal_medium is a substantially more favoured damage type than normal_spray, and that's also true for the other alien types. Actually, I think the big issue here might just be that flechette shells are bad.

You might be right, but it's worth considering the spray effect of flechette shells as well. Because they fire 5 shots, they also have the potential to hit multiple targets. The concept behind flechette shells was to have a powerful weapon that was useful when you didn't need accuracy at all (inside UFOs, for instance). Here, having the ability to hit targets standing beside the intended target could be useful. Also, as I mentioned before, the damageweights system is not quite as I'd like it so the normal_spray could play a more useful role in the future.

Having said that, I have checked the damage values and it does look a little weak. This may have been a side effect of preventing the micro shotgun from being too powerful (the micro shotgun can only use flechette shells). I've put it on my list to check more thoroughly -- especially because of alien resistance to normal_spray -- and possibly adjust. Thanks for the notes.

The rocket launcher likewise favors HE rockets...

Last, we have the grenade launcher...

Incendiary weaponry was a very late addition to 2.4 and is still only just being worked out. For now, it's role as an area denial weapon is not really in place. The idea is that it can create sizeable areas that are on fire, damaging units within those areas over several turns. Ideally, the alien AI would also avoid these areas. In this way, they could be used to deny aliens a key area or target a large group of aliens. The initial implementation of the fire effect was too short and small, something I hope to adjust.

Flechettes have the same damage and damage type as shotgun flechettes, an even shorter range, better accuracy (though still miserable), and worse TU cost and reload time—admittedly ammo is also 1x1 instead of 2x1, but I can't see why someone would consider toting a GL with flechettes loaded instead of just taking a riot shotgun.

...

(Also, flechette grenades may just need to go—they're caught in this nasty zone where they'd need to be really compelling, probably overpowered, to compete against either a melee weapon as an emergency close-combat weapon or any of the other weapon options as a short-to-mid-ranged standard-use weapon.)

Flechette shells were only intended to provide a gl-carrying soldier with dual-capability. Using a grenade launcher with flechette shells should be worse than carrying a proper shotgun. But flechette shells provide a very small inventory item that allows a grenade launcher soldier to play a role when entering buildings or other tight spaces where the area effect of explosives might make them dangerous to their own team.

You may have a point about melee weapons, but at least early in the game the knife is not nearly as powerful. Consider also the role of reaction fire -- something especially important for indoor weaponry. An alien does not need to walk right up to you to experience reaction fire with the flechette shells.
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: GPS51 on May 12, 2012, 01:23:54 am
What a fascinating read, I've been playing UFO:AI for a year and a half now? Still enjoying it!

Edit: Was any thought given to allowing flashbangs to be made into a GL module?
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: TrashMan on May 12, 2012, 11:52:49 am
Spreadsheet balance has lost it's appeal to me. When a weapon cannot be simply explained wit a few numbers - it is then when things become interesting.

Take a look at SOTS and SOTS2 for example. Spreadsheet general will have a fit over it. And I love it.
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Crystan on May 12, 2012, 01:55:35 pm
SOTS? Sword of the Stars?
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: TrashMan on May 12, 2012, 03:11:28 pm
Yes.
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Latino210 on May 13, 2012, 01:01:13 am
SOTS? Sword of the Stars?

Great game...
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Crystan on May 13, 2012, 01:39:47 am
Great game...

The first one, yes. But the second one is terrible - they managed to fixed many bugs now - but the new fleet management and movement system is total crap. It also sux that you need some turns to explore a system. That totally slows down the gameplay speed - terrible...
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: headdie on May 13, 2012, 02:14:55 am
One thing learned on hardlight is that you will never convince trashman that SotS is anything less than awesome  :P
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Crystan on May 13, 2012, 02:36:18 am
*offtopic*Haha - good to know but dont get me wrong - i love the SotS Universe in all its glory but the new system is totally confusing which discourages me to play it. *offtopic*
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: TrashMan on May 13, 2012, 03:24:00 pm
The first one, yes. But the second one is terrible - they managed to fixed many bugs now - but the new fleet management and movement system is total crap. It also sux that you need some turns to explore a system. That totally slows down the gameplay speed - terrible...

Different, not terrible. It's fleet-based and action based, and it follows the rela-world operational logic.  I for one and glad the game is evolving.
Speaking of which, it's almsot fully patched. All content is in. Two more optimization patches and it should be given a thumbs up.
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on May 15, 2012, 05:49:59 pm
[…]adjust a soldier's competencies as he moves through the terrain (such as shifting ammo before entering a UFO).[…]
Mm. I'm not sure how often this is going to happen, though, without some serious magnification in the situational effectiveness differences between the ammo options—reloading is expensive, which puts the reloading soldier a bit less than half a turn behind the rest of the team in advancing. Additionally, the current partial magazine is sacrificed. Even in the cases where it seems like switching would be most strongly favoured (switching a grenadier to flechettes when entering a harvester), I find myself more likely to just pull a melee weapon.

Quote
On a separate note -- the damageweights system is still very much a work in progress. Part of the issue is that we still have very few aliens to create distinctive vulnerabilities.
Mm. I think some specialized armors might help there, too (anti-incendiary variants giving boosts to fire and plasma resistance at the cost of normal and maybe blast, or anti-laser armor, or something).

Quote
You might be right, but it's worth considering the spray effect of flechette shells as well. Because they fire 5 shots, they also have the potential to hit multiple targets. The concept behind flechette shells was to have a powerful weapon that was useful when you didn't need accuracy at all (inside UFOs, for instance). Here, having the ability to hit targets standing beside the intended target could be useful.
The issues with that are twofold. First off, even before damage weighting the per-shot damage is simply too low for accuracy to not matter—to deal 100 damage to a 0-resistance target requires hitting with 4 shots (though thankfully you actually get 8 shots, not 5 as claimed), and that's best case (every pellet hits with maximum damage, and the only alien able to be killed with 100 damage is a minimum-health Taman). Worse yet, the time investment of taking a shot is the same as that required to pull a grenade from belt/holster and toss/roll it, which hits multiple targets with substantially superior damage and damage type.

Really, I think to ever be glad about missing your intended target (and thus potentially hitting a secondary target), you need a situation like the 2.4 machine gun's huge number of shots and high damage—especially in the absence of any sort of wound penalty, anything that risks leaving the original target alive is very difficult to justify, even if more total damage is dealt out.


Quote
Incendiary weaponry was a very late addition to 2.4 and is still only just being worked out. For now, it's role as an area denial weapon is not really in place. The idea is that it can create sizeable areas that are on fire, damaging units within those areas over several turns. Ideally, the alien AI would also avoid these areas. In this way, they could be used to deny aliens a key area or target a large group of aliens. The initial implementation of the fire effect was too short and small, something I hope to adjust.
This strikes me as the kind of idea that relies on an impractically large amount of surrounding tactical depth to make useful, but fair enough.

Quote
Flechette shells were only intended to provide a gl-carrying soldier with dual-capability. Using a grenade launcher with flechette shells should be worse than carrying a proper shotgun. But flechette shells provide a very small inventory item that allows a grenade launcher soldier to play a role when entering buildings or other tight spaces where the area effect of explosives might make them dangerous to their own team.

You may have a point about melee weapons, but at least early in the game the knife is not nearly as powerful. Consider also the role of reaction fire -- something especially important for indoor weaponry. An alien does not need to walk right up to you to experience reaction fire with the flechette shells.
Mm. The knife is actually not bad against Taman, especially when you consider that reloading to Flechette is 4 stabs worth of time (and actually firing is another 3 stabs). The reaction fire issue similarly runs up against the machine pistol, which does the same damage at substantially better accuracy and range and gets two more shots for the same TU (full-auto vs. snap shot). Damage type becomes worse as the game proceeds, but flechette grenades never get better either and I'd argue it quickly becomes preferable to have another soldier covering the grenadier than go through contortions to give him/her ranged reaction fire capability.

I'd argue that for reasons of both realism and balance (given the huge cost of reloading a GL and the fact that you effectively sacrifice a grenadier until you reload again) that the flechette grenades should do quite high damage, but certainly I think they're just taking up space as it stands now.

~J
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on May 15, 2012, 05:59:00 pm
Spreadsheet balance has lost it's appeal to me. When a weapon cannot be simply explained wit a few numbers - it is then when things become interesting.

Take a look at SOTS and SOTS2 for example. Spreadsheet general will have a fit over it. And I love it.
What do you mean by this? I've glanced at some descriptions of Sword of the Stars and nothing jumps out at me as defying a quantitative approach (though please don't insult me by implying I'm using a spreadsheet—I use the proper tools for the job ;) ).

Now, I certainly do think there's a danger in naively focusing on those attributes amenable to calculation and hand-waving the ones that aren't—for example, my treatment of range and accuracy is obviously less rigorous than that of damage—but I think I've established that I'm not just ignoring those attributes out of hand. In particular, I should note that all of the complaints I've brought up thus far have been found via gameplay—I didn't run the .ufo files through a great number-cruncher, say "these numbers look wrong!", and come here to mount an attack on them. The process was that I played the game, I thought "you know, these laser weapons really aren't doing it for me", swapped them out for other weapons, and then when I got motivated to recommend changing it I pulled out the numbers so that I had a more convincing argument than "laser weapons feel too weak".

So if you're expressing a worry that these comments are purely numbers-driven, with no checks to ensure that the interpretation of those numbers isn't becoming untethered from actual gameplay, let me assure you that that isn't the case.

~J
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: H-Hour on May 15, 2012, 06:19:52 pm
I'm still considering bumping up flechette shells damage, so that may address some of your concerns. More specific responses:

Mm. I'm not sure how often this is going to happen, though, without some serious magnification in the situational effectiveness differences between the ammo options—reloading is expensive, which puts the reloading soldier a bit less than half a turn behind the rest of the team in advancing. Additionally, the current partial magazine is sacrificed. Even in the cases where it seems like switching would be most strongly favoured (switching a grenadier to flechettes when entering a harvester), I find myself more likely to just pull a melee weapon.

To each his own, I guess. I would always prefer to take a turn to consolidate my soldiers defensively and prepare them for a breach. Melee weapons for you, flechette shells for me. (Side note: eventually we will have alien AI that does not just rush the player as fast as they can.)

Really, I think to ever be glad about missing your intended target (and thus potentially hitting a secondary target), you need a situation like the 2.4 machine gun's huge number of shots and high damage—especially in the absence of any sort of wound penalty, anything that risks leaving the original target alive is very difficult to justify, even if more total damage is dealt out.

I don't know, I run into lots of situations where I'm dealing with almost-dead aliens, either because previous shots didn't kill them or otherwise. Again, this may just be a play style preference, depending on how important it is for you to ensure a kill with one soldier.

Mm. The knife is actually not bad against Taman, especially when you consider that reloading to Flechette is 4 stabs worth of time (and actually firing is another 3 stabs). The reaction fire issue similarly runs up against the machine pistol, which does the same damage at substantially better accuracy and range and gets two more shots for the same TU (full-auto vs. snap shot). Damage type becomes worse as the game proceeds, but flechette grenades never get better either and I'd argue it quickly becomes preferable to have another soldier covering the grenadier than go through contortions to give him/her ranged reaction fire capability.

Even something as small as a machine pistol takes up more space than a reload of flechette shells. This will probably become more relevant when we have a proper weight system in place, where carrying too much weight can slow down a soldier.

You're right that there are other options that can also fill the role of the flechette shells: melee weapons, smaller secondary firearms. Each one has its benefits. Melee weapons have high damage per TU, but no range. Secondaries have high damage, but take more inventory space. Flechette grenade has reduced damage per TU, but it takes up 1 inventory slot. As long as flechette grenades have their own niche -- even if it is not the "best" in most situations -- I'm happy to keep them.
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on May 15, 2012, 08:08:41 pm
To each his own, I guess. I would always prefer to take a turn to consolidate my soldiers defensively and prepare them for a breach. Melee weapons for you, flechette shells for me. (Side note: eventually we will have alien AI that does not just rush the player as fast as they can.)
A non-rushing AI might help—one of the big reservations I have with consolidating is that due to alien AI it's usually either a waste (aliens stuck on upper floor) or involves giving the initiative to the aliens (aliens on lower floor, rushing out). Also, even in the Corrupter the quarters tend to be tight enough to make it difficult for more than the first few soldiers in to matter (admittedly in the Corrupter the chokepoint happens inside the UFO proper, on the second level, but aliens still typically cluster on the far side of it), encouraging just having the grenadier do kneeling laps outside to train Quickness rather than going through contortions to get him active inside. But yeah, AI could be a big limiting factor here.

Quote
Even something as small as a machine pistol takes up more space than a reload of flechette shells. This will probably become more relevant when we have a proper weight system in place, where carrying too much weight can slow down a soldier.
Sure, but with the death of the three-round burst I feel like a lot of inventory pressure has already come off of grenadiers, and they didn't feel particularly tight to begin with. I certainly don't think I've ever reloaded a GL more than once on a mission in 2.5; have you?

Quote
You're right that there are other options that can also fill the role of the flechette shells: melee weapons, smaller secondary firearms. Each one has its benefits. Melee weapons have high damage per TU, but no range. Secondaries have high damage, but take more inventory space. Flechette grenade has reduced damage per TU, but it takes up 1 inventory slot. As long as flechette grenades have their own niche -- even if it is not the "best" in most situations -- I'm happy to keep them.
Sure, I dig. My argument is just that (as it stands, without possible damage adjustment/etc.) I don't actually think that niche exists :)

~J
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on May 15, 2012, 10:21:28 pm
So in my laser weapon analysis above I focused on the Laser Pistol, both because it's the laser weapon I used most in 2.4 (laser pistol in one hand, melee weapon/grenade or later particle beam pistol in the other) and because its weakening was particularly dramatic (no more long-range accuracy, and guaranteed-1 damage in a surprising number of situations). I'm given the impression, though, that the general community favoured the Laser Rifle more, and the Heavy Laser probably also deserves an examination.

Since full-sized weapons are much less frequently moved to/from the inventory in my experience, I'm going to skip comparing the weapons based on their inventory sizes/arrangements.

A Laser Rifle gets you Crouch 0.85, Range 200, 14 effective ammo (28 at 2 ammo per shot), 14 TU reload cost, and 2x1 ammo. They deal 42±10 laser_medium at 8 TU/shot for Spread 0.8 or 12 TU/3 shots at Spread 0.9.

An Assault Rifle gets you Crouch 0.85, Range 100, 30 ammo, 12 TU reload cost, and 2x1 ammo. They deal 42±5 normal_medium at 8 TU/shot for Spread 1.2, 12 TU/3 shots for Spread 1.4, 16 TU/8 shots for Spread 1.6, or 16 TU/shot for Spread 1 using Sniper skill instead of Assault (though if advancement still works like 2.4, that means better Accuracy training potential).

A Plasma Rifle gets you Crouch 0.85, Range 70, 20 ammo, 12 TU reload cost, and 2x1 ammo. They deal 80±10 plasma_medium ammo at 8 TU/shot for Spread 1.2, 12 TU/3 shots for Spread 1.5, 16 TU/6 shots for Spread 1.8, and 16 TU/shot for Spread 1 using Sniper skill.

Now, per-round damage, range-constrained values in parentheses as above:

Taman:
Assault Rifle: 52/32/(1-7)±5
Laser Rifle: 27/22/17±10
Plasma Rifle: 75/55/35±10

Ortnok:
Assault Rifle: 22/12/(1)±5
Laser Rifle: 12/(1-17)/(1-12)±10
Plasma Rifle: 80/60/40±10

Shevaar:
Assault Rifle: 22/12/(1)±5
Laser Rifle: 42/37/32±10
Plasma Rifle: 100/80/60±10

Bloodspider:
Assault Rifle: 42±5
Laser Rifle: 22±10
Plasma Rifle: 100±10

I've run out of time at the moment to really analyze these results, so I'll post this and come back.

~J
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on May 18, 2012, 04:25:11 pm
Ok, well, been busier than expected but at least I can give a partial analysis now.

To some extent I'm about to do what I just assured TrashMan I wasn't doing, namely mostly ignoring the effect of accuracy. I'll revisit this analysis to make sure it holds up when that's taken into account later.

The big thing that strikes me, looking at these damage numbers, is that it's hard to justify taking a Laser Rifle over an Assault Rifle, especially any time in the period after laser weapons become available—at least on a raw damage basis, the laser rifle simply isn't competitive until Medium Alien Armor or Shevaar enter the scene, by which time the laser rifle has probably been thoroughly forgotten in storage (if the player hasn't simply sold whatever stockpiles had been acquired). Again with the shots for a kill analysis:

Taman:
Assault Rifle: 2-3/3-5/15-130
Laser Rifle: 3-8/4-11/4-18
Plasma Rifle: 2/2-3/3-6

Ortnok:
Assault Rifle: 6-12/9-22/150-190
Laser Rifle: 7-95/9-190/13-190
Plasma Rifle: 2-3/3-4/3-7

: Note that although the best-case is the same as the AR, because of range constraint damage dealt will be 1 20% of the time, pushing the probabilities substantially away from the best cases.

Shevaar:
Assault Rifle: 5-10/8-23/120-160
Laser Rifle: 3-5/3-6/3-8
Plasma Rifle: 2/2-3/2-4

Bloodspider:
Assault Rifle: 4-5
Laser Rifle: 5-13
Plasma Rifle: 2

I'll need to account for accuracy to be sure, but between the substantially larger effective magazine, the greater shot efficiency (8 rounds for 16 TU), and the often significantly smaller number of rounds that need to land on target, I feel like the AR is simply outclassing the laser rifle until they both become obsolete—and that's to say nothing of the plasma rifle.

~J
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Battlescared on May 18, 2012, 06:56:15 pm
The big thing that strikes me, looking at these damage numbers, is that it's hard to justify taking a Laser Rifle over an Assault Rifle...

So take the Assault Rifle, or the electromagnetic rifle, or any of the other rifles.  I dump the laser rifle in favor of the heavy laser, plasma rifle, or the em rifle.  Either three choices are better for one reason or another.  I've also carried an assault rifle long into the campaign to help with balancing weapon ammo usage.  Assault rifles always have ammo for sale, laser rifles take a bit before the world supply chain takes over, and if I load up on lasers, I'll burn through ammo too quickly.

The one thing I would say though, and this may not be too popular, is that you should have to research the lasers in order (just earth based tech, stuff we find we should be researchable whenever).  Start with the pistol and work your way to the heavy, dumping the lesser weapons along the way.  Then at least you learn the weapons and take the ones that work for you.  For the last few releases I've found the heavy laser to be the more effective and useful in my squads.  It puts enough damage on them at range to soften them up a bit from it's accuracy, and at close range it hits pretty hard.

Now, if there is a gimp to accuracy in 2.5, then yes, that may make it far less useful.  That might negate the main reason I carry them.  I'd have to play with them to see how they work in practice.

In general, I hate these kinds of analysis because you have to take the weapons in context of game play.  Many things make a weapon a better choice over another other than just numbers and damage, such as map types and when you expect to engage the enemy.  But good analysis anyway.  A little theory can go along way.
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on May 18, 2012, 07:37:44 pm
So take the Assault Rifle, or the electromagnetic rifle, or any of the other rifles.
But then why have the laser rifle in the game, taking up space in the menus and possibly luring players into trying to use them?

Quote
Now, if there is a gimp to accuracy in 2.5, then yes, that may make it far less useful.
They're drastically different in 2.5. 2.4-based knowledge won't help in this discussion except as historical perspective.

Quote
In general, I hate these kinds of analysis because you have to take the weapons in context of game play.  Many things make a weapon a better choice over another other than just numbers and damage, such as map types and when you expect to engage the enemy.
I'm not understanding the objection. Certainly I agree that purely quantitative analysis uninformed by experience of gameplay is an extremely dangerous practice, due to the risk of either undervaluing weapon characteristics that are difficult to account for quantitatively (accuracy is the big one here, and range to a lesser extent) or missing indirect consequences (say, a weapon that's only particularly good against one kind of enemy, but that enemy is really dangerous), but as I've indicated above, this is informed by gameplay—I first played the game and thought to myself "hey, laser weapons kinda suck", and only then pulled out the numbers to quantify exactly how much they suck, whether I'm overlooking some situation in which they don't suck, and also be able to make a more convincing argument than "hey, laser weapons kinda suck".

But it's not clear how "map types and when you expect to engage the enemy" is something you wouldn't get from "numbers and damage"—those numbers include range and accuracy (even if at this point that only gets factored in in a broad, comparative way), TU use (answering questions like "how many shots can I get off in a turn" and "how late in the turn can I discover an alien and still be able to open fire"), and, yes, damage—like the fact that even with infinite accuracy the laser pistol is worthless against an Ortnok. What still gets overlooked in this sort of analysis?

(On the topic of accuracy, I need to confirm the magnitude of effect of soldier attributes/skills—I'd generally expect that to have a larger effect on the high damage/low accuracy weapons, but it is another unaccounted-for variable.)

~J
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Battlescared on May 18, 2012, 08:10:24 pm
No offense intended, Jon_dArc, I just prefer to figure out what works for me through playing the game and not analyzing the stats behind the scenes.  To each his own.

In most games I've played, there are always weapons that don't quite cut it.  The laser rifle is one, so as to why have it in the game?  Well, if you've never played it, you'd try it, find out it didn't work like you had hoped, and move on.  Just like in real life.  So you do the research, design and build it, field it, and guess what... the troops come back with reports that the weapon didn't work exactly like the eggheads thought it would.  Back to the drawing board.  That's why I said the research needs to be in order, so you go through that progression.  I did it in order just because, and I like the heavy laser much better.

For reference, back in XCOM, I eventually found out that the laser rifle kicked the most butt and a squad of guys armed with them could cut a map down quickly, even in the later stages.  The heavy laser and laser pistol sucked, however, but I still had to go through them to find that out.  This game is different, so it doesn't bother me if the laser rifle doesn't cut it.  There are others that do, and if the assault rifle works better for a persons tactics than the laser rifle, then that's the weapon they should field.  Hot lead still has certain advantages. :)
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on May 23, 2012, 05:47:23 pm
No offense intended, Jon_dArc, I just prefer to figure out what works for me through playing the game and not analyzing the stats behind the scenes.  To each his own.
None taken. I certainly understand your point of view there, but this is a balancing exercise—my goal isn't to pick the best weapon, it's to make sure that all weapons have a reason to be picked. As such, I think it's a distinct situation from actually playing the game.

Quote
In most games I've played, there are always weapons that don't quite cut it.  The laser rifle is one, so as to why have it in the game?  Well, if you've never played it, you'd try it, find out it didn't work like you had hoped, and move on.  Just like in real life.  So you do the research, design and build it, field it, and guess what... the troops come back with reports that the weapon didn't work exactly like the eggheads thought it would.  Back to the drawing board.
The issue is that it's neither fun nor interesting. It's true, dead ends and boondoggles exist in the real world—but we also don't have soldiers and employees randomly die in training accidents, nations demand that you purchase Saracens manufactured by their factories, or any of the other obnoxious things that would realistically happen in a situation like this. As you recognize in your call for the laser weapons to form a research tree, players would quickly learn that it's bad and stop researching it (at least until they run out of stuff to research, if they're too lazy to fire all scientists until more stuff comes along).

Quote
That's why I said the research needs to be in order, so you go through that progression.
Why, though? There's no obvious reason why that progression would exist—if anything, the other way around would make more sense, as then each step would require more miniaturization. I also think that the player has too few research choices at any given moment (except briefly in about the second month or so) to begin with.

Quote
if the assault rifle works better for a persons tactics than the laser rifle, then that's the weapon they should field.  Hot lead still has certain advantages. :)
There are two issues to that in my mind: for one, the assault rifle is available on the market at the beginning of the game, and you even get a free supply to start out. The laser rifle requires a three-step research process, then either production or a long wait for the market to spin up. After all that, it should be a clear improvement in at least some circumstance.

The other is that it's not just that the AR "works better for a [person's] tactics", it's that it's genuinely difficult to come up with a tactic in which the laser rifle works—admittedly I'm a little less certain about this than about the laser pistol, as the damage isn't quite so miserable and I haven't yet developed a principled way to account for accuracy, but both the damage calculations and gameplay experience trying to use it have told me that loud and clear.

~J
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Starbug on May 24, 2012, 02:17:34 pm
Eh, what I say will only count for 2.4 stable release, as I haven't played 2.5, but I always used the laser rifle and heavy laser as a replacement for the sniper rifle, not the assault rifle. Primarily because of the higher accuracy (until something better come along), and the fact that you could never take a 2nd aimed shot with the sniper rifle. Typically both my snipers would miss in a turn, and then my troops would be in danger.

The laser rifle was never gonna compete with the assault rifle in terms of damage output, since it doesn't have a full-auto fire mode, and takes more TUs to fire the same amount of shots. I thought the whole point of the laser weapons was low-damge, but near guaranteed hit? If the accuracy has been lowered that kinda defeats the point...
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: headdie on May 24, 2012, 02:24:48 pm
Its also a different damage type so the theory is that it interacts with armour differently
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on May 24, 2012, 03:22:30 pm
Eh, what I say will only count for 2.4 stable release, as I haven't played 2.5
The rebalancing has been dramatic. How things were in 2.4 is only relevant insofar as existing player expectations will be guided by that.

On the other hand, I'm a sucker for discussion :D


Quote
I always used the laser rifle and heavy laser as a replacement for the sniper rifle, not the assault rifle. Primarily because of the higher accuracy (until something better come along), and the fact that you could never take a 2nd aimed shot with the sniper rifle.
It took a while, but I could usually get a sniper to 36 TUs. Also, 30 TUs for an aimed shot plus a snap shot were easily doable, as were 33 for that plus a crouch (or a crouched orthomove). I'm too lazy to dig up what the armor and alien resistance values for 2.4 were right now, but IIRC on non-Shevaar the normal_heavy damage type was significantly better, combined with a significantly higher base damage (a snap shot did 105 damage for the same TU cost as a laser rifle's 126±15 for wave fire, but armor/resistance are tripled against the latter, and although the snap shot is more likely to miss altogether the laser rifle is more likely to suffer from reduced damage by missing at least one of the three shots).

Quote
The laser rifle was never gonna compete with the assault rifle in terms of damage output, since it doesn't have a full-auto fire mode, and takes more TUs to fire the same amount of shots.
That's only true in very close-range circumstances—the 2.4 Assault Rifle is incredibly inaccurate, meaning that the laser rifle easily competes in actual damage output at all other ranges. Additionally, IIRC normal_medium was not treated kindly in the resistances.

~J
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Starbug on May 24, 2012, 11:13:55 pm
The rebalancing has been dramatic. How things were in 2.4 is only relevant insofar as existing player expectations will be guided by that.

Ack, I'm probably not qualified to be talking about damage output then, but yeah, disscussion I can go for at least!  :D

It took a while, but I could usually get a sniper to 36 TUs. Also, 30 TUs for an aimed shot plus a snap shot were easily doable
Egads, 34 TUs is the best I can manage at the moment! Currently just got to researching the Dragon interceptor, and its October. And thats only cos that guy was an elite recruit. Maybe I'm doing something wrong here >.<

Yeah I noticed the aimed + snap shot combo, quite nice, but was only really possible if the sniper was already crouched and in position from the previous turn, which didn't happen too often for me, the aliens tended to move out of position if they were still alive  >:(


(sniper rifle) a snap shot did 105 damage for the same TU cost as a laser rifle's 126±15 for wave fire, but armor/resistance are tripled against the latter, and although the snap shot is more likely to miss altogether the laser rifle is more likely to suffer from reduced damage by missing at least one of the three shots.

I prefer reduced damage to no damage, but I guess that's just my personal preference. My mine gripe was that, while powerful, I couldn't rely on my snipers, they were more of an added bonus, especially since they couldn't take out an unarmoured Taman on their own (but that's changed now in 2.5 from what I understand, so my tactics would probably change accordingly)

This is a balancing exercise—my goal isn't to pick the best weapon, it's to make sure that all weapons have a reason to be picked.

The laser rifle requires a three-step research process, then either production or a long wait for the market to spin up. After all that, it should be a clear improvement in at least some circumstance.

Agreed.

*[2.4 disclaimer]* I found the laser rifle's 'niche' to be very long ranges - you can take shots that, with other weapons, you wouldn't even attempt. With an assult rifle you might look at a range of 20/30 squares and just think "Best to take cover and wait/move in closer". With a laser rifle you'd take some shots. Sure you'll miss a few. Yes, once medium armour shows up they aren't so great anymore. But if you can take out the unarmoured guys out before they are close enough to do damage, that's always valuble. (Maybe I'm just reckless with ammo though, heh)

This is what the sniper rifle is supposed to be for as well, but in 2.4 I didn't find it accurate enough, so I switched over to laser power. Then again, by my own logic I should probably have used the rocket sniper launcher, but I wanted to check out the lasers too, since the last time I played UFO:AI was before it even had laser weapons o_0

If the 2.5 changes mean the laser weapons no longer fit that use (or any other), then... well... I'm out of useful comments really  :-\

I haven't yet developed a principled way to account for accuracy,

Could perhaps try considering the weapons at 3 distinct ranges, short medium, long? Yeah I know, then it becomes a question of 'what do people consider long range' but that my idea all the same :P
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: H-Hour on May 24, 2012, 11:52:08 pm
The difficult thing about accounting for accuracy is that it depends on three things which are not constant. First, it depends on what kind of ranges you are actually encountering aliens. This differs greatly from map to map.

Second, it depends on what kind of cover exists in the map. A lot of our maps lack "partial cover", which is to say positions from which you can see aliens but might only have a shot at a head or a part of the torso. A weapon's effective range is much longer when the aliens are walking around in the open.

Third, it depends a lot on play style. Some people prefer a very cautious approach to the battlescape, doing everything they can to prevent soldier deaths. The trade-off between range and damage may be different for those players, even if more calculating players will prefer to close with their enemy.

At the end of the day, more accuracy will always be better. But it's hard to say what the effective range of a close, assault or sniper weapon ought to be. When I was rebalancing the weapons, I used a small firing range map I built to try and visualize effective range in-game. I've attached the files to this post.

The firing_range.map should go into /base/maps/ and the map_firing_range.ufo should go into /base/ufos/. But you will need to compile the .map into a .bsp file to play it. The compiled .bsp is too large to attach. If you do download it and try it out, know that I have included hidden brushes so that any soldiers that stay in the middle can not be hit. You will need to walk them to the edge of the central chamber to fire on aliens.
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on May 25, 2012, 01:20:01 am
Well, before I jump straight to the map, let's see if there's another approach. It looks like angles are in degrees…

Accuracy: 1-(((Acc/100)+(Weap/100))/2)

commonfactor: (0.5 + 1*Accuracy)*Injury

Angles: (Gauss1 * hspread * commonfactor) ?* crouch,
      (Gauss2 * vspread * commonfactor) ?* crouch)

pdf(Gauss1) = pdf(Gauss2) =  N(0,1)

Right at the moment I'm going to ignore Injury.

It looks like a nominal standing actor is 9x9x20, and a square is 11x11.

Well, I'm not going to get further on this tonight, but it looks like at least with some simplifying assumptions (most notably, firing perfectly horizontal) it should be feasible to make a straightforward formula for hit probability.

~J
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: ChemBro on May 25, 2012, 01:26:35 am
Is it okay to ask here, for what the heavy weapon skill is useful? I saw in 2.5, that no weapon needs the heavy weapon skill. They are now assault, explosive or close combat weapons. Or is there something else?
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: H-Hour on May 25, 2012, 02:48:05 am
Currently, in 2.5 the heavy weapon skill has no use. It may be removed from the UI at some stage. But I'm leaving it in place until a final decision is made.

We still have weapons marked as heavy and our weapons categories in the equipping UI rely on it. It's still not clear whether this will be maintained or how we will use it.

Ideally, I would like to go to a weights system at some point in the future, with each item of equipment having a weight and the strength attribute effecting how much can be reasonably carried. But for now the system is kind of in limbo.
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on July 11, 2012, 05:38:59 pm
As a status report, I'm currently working on a script to pull weapon, alien, and armor data out of the UFO files and perform various analyses automatically. It's taking substantially longer than anticipated because I decided for some reason that I needed to write a full-on parser for it; I'm going to give it a few more man-hours before throwing up my hands and hacking it together with regexes.

~J
Title: Re: Weapons and damage in 2.5 (HEAD)
Post by: Jon_dArc on August 20, 2012, 06:25:14 pm
Having realized that the problem I'd been having before was basically just that I'd been trying to make an ad-hoc implementation of the relational calculus on my UFO data structures, I shifted gears and started sticking parse results into a proper relational database. The bad news from all this is that, predictably, I decided to use this as an opportunity to refamiliarize myself with a bunch of tangentially related stuff like database design and normalization, so the whole business is horribly overengineered and slow going. Also, Real Life™ got busy. Still, database population is almost done, which means that the DB schema is firming up; I'm going to toss it (and the rest of my code) up in a proper public repository once DB population is finalized, but for the moment here's the SQL for DB setup. Note that I use some quantity of Postgres-specific features which may or may not be easily removed for more general RDB compatibility.

Code: [Select]
CREATE TYPE team AS ENUM ('phalanx', 'alien', 'civilian');
CREATE TYPE range AS (min int, max int);
CREATE TYPE randval AS (center int, swing int);
CREATE TYPE usestyle AS ENUM ('holdtwohand','firetwohand','onehand');

DROP TABLE IF EXISTS "item";
CREATE TABLE "item" (
item_id text PRIMARY KEY,
item_name text NOT NULL,
type text NOT NULL,
price int NOT NULL,
size int CHECK (size >= 0) NOT NULL
);

DROP TABLE IF EXISTS "armour";
CREATE TABLE "armour" (
item_id text PRIMARY KEY REFERENCES item ON DELETE CASCADE,
useable team NOT NULL,
weight int CHECK (weight >= 0) NOT NULL
);

DROP TABLE IF EXISTS "protection";
CREATE TABLE "protection" (
item_id text REFERENCES armour ON DELETE CASCADE,
damageweight text,
resistvalue int NOT NULL,
PRIMARY KEY (item_id,damageweight)
);

DROP TABLE IF EXISTS "template";
CREATE TABLE "template" (
template_id text PRIMARY KEY,
strength range NOT NULL,
speed range NOT NULL,
accuracy range NOT NULL,
mind range NOT NULL,
close range NOT NULL,
heavy range NOT NULL,
assault range NOT NULL,
sniper range NOT NULL,
explosive range NOT NULL,
piloting range NOT NULL,
targeting range NOT NULL,
evading range NOT NULL,
health range CHECK (health > 0) NOT NULL
);

DROP TABLE IF EXISTS "unit";
CREATE TABLE "unit" (
unit_id text PRIMARY KEY,
unit_name text NOT NULL,
side team NOT NULL,
wearsarmour bool NOT NULL DEFAULT TRUE,
carriesweapons bool NOT NULL DEFAULT TRUE,
size int NOT NULL DEFAULT 1
);

DROP TABLE IF EXISTS "unit_templates";
CREATE TABLE "unit_templates" (
unit_id text NOT NULL REFERENCES unit ON DELETE CASCADE,
template_id text NOT NULL REFERENCES template ON DELETE CASCADE,
PRIMARY KEY (unit_id,template_id)
);

DROP TABLE IF EXISTS "resistance";
CREATE TABLE "resistance" (
unit_id text NOT NULL REFERENCES unit ON DELETE CASCADE,
damageweight text NOT NULL,
resistvalue int NOT NULL,
PRIMARY KEY (unit_id,damageweight)
);

DROP TABLE IF EXISTS "weapon";
CREATE TABLE "weapon" (
item_id text PRIMARY KEY REFERENCES item ON DELETE CASCADE,
use usestyle NOT NULL,
ammocap int CHECK (ammocap > 0) NOT NULL,
reload int CHECK (reload > 0) NOT NULL
);

DROP TABLE IF EXISTS "firedef";
CREATE TABLE "firedef" (
ammo_id text NOT NULL REFERENCES item (item_id) ON DELETE CASCADE,
weapon_id text NOT NULL REFERENCES weapon (item_id) ON DELETE CASCADE,
name text NOT NULL,
skill text NOT NULL,
vspread real CHECK (vspread >= 0) NOT NULL,
hspread real CHECK (hspread >= 0) NOT NULL,
crouch real CHECK (crouch >= 0) NOT NULL,
range numeric(10,1) CHECK (range >= 0) NOT NULL,
shots int CHECK (shots >= 0) NOT NULL,
ammoconsump int NOT NULL,
tus int NOT NULL,
damage randval NOT NULL,
damageweight text NOT NULL,
reaction bool NOT NULL DEFAULT TRUE,
PRIMARY KEY (ammo_id,weapon_id,name)
);

My biggest qualm with this design is that it requires me to interpret melee weapons as having 1 ammo and all of their attacks as consuming 0 ammo (except for throwing attacks, which consume 1), and with a 0 reload time, which all seems semantically unsound to me, but I think I'm confident enough in not actually getting into trouble as a result to just go with it.

~J, going all architecture astronaut