Weapon attack types

dagorkan

First time out of the vault
I'm thinking of making a mod that changes all the weapon stats to make Fallout not more realistic or cool but more tactical. Exaggerate differences between weapons to give more variety and force the player to use the right tool for the right job. Eg, make the 10mm pistol fast to reload and have a larger magazine capacity but weak and make the .44 magnum take an entire turn to reload (or half a turn with speed loader). So the magnum isn't automatically the better weapon, and weapon progression isn't like some AD&D Ordinary sword, Masterwork Sword, Sword +1, +2, +3 ad nauseum. Also rebalance item costs/availability to increase tactics, eg make ammo types more specific and potentially extremely expensive - cheap, inferior "post-war" 10mm cartridges would be relatively common, vs highly prized rare pre-war ammo with better penetration and damage which would be bought in small quantities if they could be bought at all.

Anyway I was thinking of adding an attack type for the simple weapons that only have one. One of the things that's boring in combat is that apart from aimed shots often you don't have any options, it's click shoot, point at enemy, click etc. In good TB games like X-Com and Silent Storm you have a variety including auto-shots, snap shots, careful shots for almost all weapons.

Now I know the problem with Fallout 1 is that there's only two attack type slots that any weapon can have. And attack types available seem to be hard coded. Shoot single shot, burst fire, swing, thrust etc. It seems it's not possible to add a variety of single shot and burst types, for example a 3AP snap shot with a low range/chance of hitting, or a 7AP careful shot with a higher chance of hitting. Or a lower AP, lower damage three round burst vs a higher AP/damage/ammo full round burst.

The other thing I was thinking of was adding a mode for single shot weapons like pistols that would allow you to shoot more than once a round. For example knowing that pistols don't usually kill enemies in one turn, you could fire off two or three shots in quick succession at one enemy (sort of panic shooting). Which wouldn't be the same as two 'snap shots' because it would be one action and you'd dedicate both shots to one target - if you killed him in one you'd waste the other. Now the problem is how to do that, the obvious is a two round burst, but then you have the problem of animations and sound - you would see and hear your character only shooting one shot and one damage value, the only noticable difference would be that your ammo goes down by two.

All this means I'm now wondering how much work it would be to do a complete overhaul well and whether it's worth trying.

So has anybody experimented with trying adding new attack types and how did that turn out?
 
I see I'm not the only one thinking of ways to add more attack types, at least for the pistols. I've been thinking about things like double-taps and the like, where it's essentially a two-round burst, but without the "cone" effect of a normal burst. The cone effect isn't really good for a double-tap. With a 95% chance of hitting, I've found that a 2-round burst will usually only hit once beyond about 3-4 hexes of distance to the target, but twice within that distance. That's only about 15- to 20-ish feet, and good combat shooters can easily double-tap at that distance, so the "cone" effect is not appropriate. Or perhaps it would be good if there were an option to specify the size of the cone (in degrees or whatever).

I've been trying to locate the code that handles single shots and bursts, with the hope of being able to make custom changes. However, it's a very tedious process, and I'm not best disassembler.

I started with the code provided near the bottom of the first page of this thread:
http://www.nma-fallout.com/forum/viewtopic.php?t=10538

I've managed to figure out (through a hack) that the damage-calculation routine for a primary target is called from memory location 0x00423AB7, which is in a subroutine that begins at 0x0042378C.

On the other hand, secondary targets hit by burst fire call the damage routine from 0x004233E3, which is in a sub that begins at 0x00423284.

I also set up another hack where the damage returned was the number of distinct hits, as opposed to damage. For example, shooting the assault rifle (8-round burst) at three targets, maybe I'll do 2, 2, and 1 point of damage in one attach, then 3, 4, and 1 in another (meaning all 8 rounds hit, which is rare).

With enough hours (days) of effort, I can backtrack further and hopefully find the code that actually performs the burst (i.e., determines who gets hit, with what probability, etc.). However, it seems like this is something that somebody would already have done before. I can't be the first in this community to try to find that code.

So, has this code already been found, possibly even documented to some extent?

More to the point, how difficult would it be to add a new "mode" of attack? I'm assuming that there's some "switch" statement that determines which code path to execute, and if we could find the switch "jump" table, we could move it and then add to it (i.e., add new attach modes). Has anyone pursued an approach like this?
 
Making the two double-barreled shotguns have an option to fire both pipes at once would be cool.

Also, there should be some practical difference between the thrust and swing attacks for melee weapons. For instance thrusting a knife should be more efficient against armour (a knife can pierce through kevlar but swinging it against armour would hardly have any effect).

And yes, agreed, a double tap for pistols would be the shit. Also Reloading a revolver should take much more time than 2 APs, adding the speedloader hardly would make it reload faster than a clip...
 
Lord Elden said:
Making the two double-barreled shotguns have an option to fire both pipes at once would be cool.
That could be done with a two-round burst, which shouldn't be too difficult to add.
 
Kanhef said:
Lord Elden said:
Making the two double-barreled shotguns have an option to fire both pipes at once would be cool.
That could be done with a two-round burst, which shouldn't be too difficult to add.
At first blush, it seems like this would work. However, see my explanation above:
jaydfox said:
With a 95% chance of hitting, I've found that a 2-round burst will usually only hit once beyond about 3-4 hexes of distance to the target, but twice within that distance.
I had a character with 120 small guns skill, and against a basic citizen, I had 95% as my chance to hit. I tried various distances, and found that at a distance of 4 hexes, I almost never got both bullets to hit. At a distance of 3, I occasionally got two hits, but it was still rare. At 2 hexes, I hit with both shots fairly consistently.

With a double-tap or a double-barrel shotgun, that 95% chance to hit should carry over further than a measly 2 hexes. Neither is a spray-and-pray burst, as you would expect from a submachine gun or minigun. In other words, they are essentially aimed double shots.

I'm hoping to do one of two things:
A) Create a new type of burst, perhaps called "Multi". After all, there's "Single" for one aimed shot, so a "Multi" would be like a burst, but all aimed at the primary target. To be realistic, it would probably only be useful for 2, at most 3 shots (e.g., three-round bursts from a H&K G11, which are technically "aimed" shots, supposedly capable of hitting a target with three rounds at distances up to 100 meters).

B) Modify the current "burst" mode, so that the spread can be narrowed. A wide spread is good for a minigun or other types of "spray-and-pray" weapons, but not for simulating things like double-taps or double-barreled shotguns.

At this point, I'm not sure which of A and B is the easier route. I suspect B will be easier, but I haven't found the relevant code yet, so it's probably too early to tell.

Which brings me back to one of my earlier questions: has this code been found and documented yet?
 
Back
Top