DDL wrote:Yes, but the problem with your approach is it requires a long hard look at each and every weaponclass and autoturret and whatever that fires, because as soon as you start treating fire offsets as actual angles, you have to go back and check what the trace range of the original weapon/whatever was.
With the "point on circle, extend forward" method, a pistol is inherently less accurate than a rifle, purely because the rifle extends further forward. So a shot that goes totally wide to the left might give a 10 degree yaw to the pistol, but only ca. 5 degrees to the rifle coz the trace range is doubled.
It might help to note that I started off using Shifter's aim offset method as a base, which works directly with angles to begin with. I never really looked into the original algorithm much, but for comparison:
Shifter's method:
Code: Select all
//== Use a new, consistent method for calculating aim offsets. Works just like the laser sight
rot = AdjustedAim;
if(Accuracy != 0.0)
{
rot.Yaw += Accuracy * (Rand(3072) - 1536);
rot.Pitch += Accuracy * (Rand(3072) - 1536);
}
EndTrace = StartTrace + ( FMax(1024.0, MaxRange) * vector(rot) );
Original DX method:
Code: Select all
EndTrace = StartTrace + Accuracy * (FRand()-0.5)*Y*1000 + Accuracy * (FRand()-0.5)*Z*1000 ;
EndTrace += (FMax(1024.0, MaxRange) * vector(AdjustedAim));
Shifter's method randomizes both pitch and yaw separately and ends the trace at the point along that direction determined by MaxRange (or 1024.0, whichever is greater).
The original method is a little more confusing to me since I never bothered with it much. It's worth mentioning, of course, that it doesn't match the targeting reticule (which is itself angular), hence Shifter's original change. As far as I can tell, it draws a square, plots a point within the square, then adds that positional offset to the end of the trace (determined by MaxRange and where you're facing). If I'm reading this right, you're right to say that Deus Ex's original method does result in a different angular accuracy depending on the range of the weapon, as moving EndTrace up 1 unit of length means a greater change in angle the closer it is to you.
So it's possible people here are talking about two things, seeing as how these two methods are completely different! I apologize if anyone else was talking about adjusting the end of the trace (a point) when I thought they were talking about adjusting the pitch/yaw (angles).
However, the real questions then become: Which works better? Which is more consistent with other aspects of the game? Which is more fun? Which makes more conceptual sense? What did the developers originally intend, and why?
Some of these questions are ones we can't answer, and some are very much debatable, so it's largely up to taste and opinion. My personal assumptions and opinions:
- The firing cone should be circular. This is perfectly solved using either a modification of Deus Ex's EndTrace adjustment method (as you suggest) or with my method, and imperfectly solved with my current uploaded implementation and not solved at all in either original Deus Ex or Shifter.
- The targeting reticule should match the firing cone. Since the reticule effectively represents an angle that varies linearly with accuracy, this is only possible if accuracy affects firing angles the same way. This is accomplished in Shifter's mod and my implementations, but not in any method that affects EndTrace the way original Deus Ex does (e.g. your suggested method). It may be possible to also solve this by changing the targeting reticule placement to account for the weapon's maximum range, I guess.
- Accuracy listed in-game should reflect your actual current accuracy. If the game says that two weapons have 85% accuracy, then each should be as accurate as the other. Same goes for the targeting reticule. This is only true if other factors (e.g. MaxRange) don't muck with it, nor is it intuitive to the player that a weapon's maximum range has anything to do with how accurate it is, especially when accuracy is itself listed. Again, I suppose it's possible to change how the game display's accuracy information, but even then, I consider it highly unintuitive to the player that range would even be a factor.
- Probability distribution of shots should be reasonable. I won't get into this too much, but it should suffice to say that this is true of my proposed method and also yours, but not Shifter's or the original game's. The current Human Renovation version's method is a close approximation, as is true with all of this.
Of course, you're right to say that there are balance ramifications for doing this, as guns no longer get an accuracy penalty/bonus based on range. However, that was never clear to the player to begin with, really, I'm not 100% convinced the developers intended it, and even the simple act of making firing spread circular has balance ramifications by effectively making guns more accurate (both by changing the distribution inside the firing cone, and inscribing a circle inside the previous square). If I had to guess, the developers wrote TraceFire() the way they did because it was 1) simple and didn't use much math, and 2) good enough that nobody complained. After all, I didn't even know firing spread was square in the game until fairly recently, and I had already played it several times!
It's also worth noting this comment in Shifter's code:
Code: Select all
//== This is the old method. It works in theory, but the spread is different than what the reticle shows.
//== We need to use it for hand to hand weapons and NPC weapons (otherwise NPCs suck)
I couldn't tell you why Shifter uses the original DX method for NPCs, and I especially can't tell you why it uses it for hand-to-hand weapons. I would be very curious to know this! Since I don't know why Yuki did this, I kept it myself just in case it turned out to be for some important reason, but I might at least alter it to be circular instead of square (which will actually make NPCs
more accurate, for what it's worth).
Also bear in mind that I don't have a strict rule about adhering to the mechanics of the original game; I alter them where it seems realistic, player-friendly, and fun. For example, shotgun spread in the original game never made any sense to me, how it treated all the pellets individually, such that having bad accuracy means that your pellet spread is inexplicably huge, and having good accuracy means it's inexplicably small. I can remember playing a game where I became a sort of Shotgun Ninja with the targeting aug, getting 100% accuracy with the sawed-off shotgun, meaning all pellets landed right in the crosshairs. In this case, I figured that a change would make things more reasonable while preserving the characteristic flavor of that sort of weaponry, and I think it works fairly well.
TL:DR version, you are correct in that your system is a vastly more faithful representation of actual gun inaccuracy. But the area+extend method IS what has always been going on in DX, and as a result is a lot easier to implement without massive systemic recoding, and thus circle+extend most faithfully replicates the original gun behaviour while preventing 'square' artefacts.
I didn't have to do "massive systemic recoding" at all in order to implement my changes, actually. Yeah, it very slightly changes what a given increase/decrease in accuracy means, and nixes the effect range has on it, but I'm okay with that if it means the system makes more conceptual sense to me, and like I said, none of that stuff was ever intuitive (or at all clear, or even presented) to the player anyway.
So basically: Strictly speaking, you're right that the extended-circular-endtrace-adjustment method works (with regard to making the cone circular) and is consistent with original DX, but original DX isn't even consistent with original DX especially in the ways in which it presents accuracy to the player, and I'm willing to deviate from the original game slightly more than you. I'm not saying your method is
bad, just that it's not what I prefer.
If anything, I'd say that Shifter's method is the black sheep here, as while it fixes the problem of the targeting reticule not matching actual firing offsets, it neither preserves the original range-based mechanic nor the problem of a square firing cone.