So I asked this question in my own mod thread, but I thought it might be good for more general discussion here. Basically, the question is which might actually be better for players in general: recoil that kicks your aim angle up, or recoil that just makes your gun spray more wildly without actually changing your aim. I listed some pros and cons.
-"Realistic" Recoil that throws your aim off- Pros: Well obviously its more realistic and physics-y. Cons: It requires more direct control from you, since you have to actually counteract the movement manually with either the aim up/down keys or the mouse. So, it'd be harder to actually deal with.
-Recoil that just makes your gun spray more wildly, without moving your actual aim angle.- Pros: You don't have to actually control your aim. Instead, you simply aim and then fire controlled bursts or single shots. Cons: Less realistic, and maybe even kinda funny-looking.
So, what do you guys think? I could see people actually arguing that the increased-spray method might be better since it requires less twitch-adjustment from the player. I can see how direct aim-affecting recoil might be annoying for those who aren't crazy action/fps type gamers.
Mon Aug 22, 2011 7:15 pm
Lizardheim
DRL Developer
Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
Re: Aim Recoil vs Spray Recoil
Realistic recoil all day erry day.
Mon Aug 22, 2011 7:19 pm
Benpasko
Joined: Sun Aug 09, 2009 9:26 am Posts: 1633
Re: Aim Recoil vs Spray Recoil
If you've ever played Day of Defeat, I LOVE that game's recoil. It makes full-auto fire take a lot of skill, but have a huge tradeoff.
That's assuming that gif is an example of mouse aiming. If it's non-mouse aiming, its no help at all.
I already PM'd him.
Mon Aug 22, 2011 8:15 pm
Mehman
Joined: Tue Nov 17, 2009 7:38 pm Posts: 909 Location: France
Re: Aim Recoil vs Spray Recoil
Yes it is mouse aiming.
Code:
function Create(self) self.recoil = 0; self.ff = false; self.f0 = ToMagazine(self.Magazine).RoundCount; self.f1 = ToMagazine(self.Magazine).RoundCount; end
function Update(self)
if self.Magazine ~= nil then if self.ff then self.f0 = ToMagazine(self.Magazine).RoundCount; self.ff = false; else self.f1 = ToMagazine(self.Magazine).RoundCount; self.ff = true; end
if self:IsActivated() and self.f1 ~= self.f0 then self.recoil = self.recoil+0.2; end end if self.HFlipped then self.RotAngle = self.RotAngle-self.recoil; else self.RotAngle = self.RotAngle+self.recoil; end if self.recoil > 0 then self.recoil = self.recoil - 0.025; end end
attached to a gun =
Mon Aug 22, 2011 9:18 pm
Azukki
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
Re: Aim Recoil vs Spray Recoil
I definitely would say muzzle rise is more important, but for some weapons, also adding spray (or variance to the magnitude of muzzle rise) can also be suitable, to make a weapon seem less in control without being a complete skyshooter.
But even just spray recoil is a massive improvement over "this is spread of your weapon, regardless of how fast you fire" for automatic weapons, in my opinion.
Tue Aug 23, 2011 1:05 am
DudeAbides
Joined: Thu Jan 13, 2011 1:31 pm Posts: 158
Re: Aim Recoil vs Spray Recoil
Well done, Mehman. Looks pretty sharp
Tue Aug 23, 2011 2:07 am
Pantera1993
Joined: Wed Jul 06, 2011 5:11 pm Posts: 226
Re: Aim Recoil vs Spray Recoil
So then the ini code would have the gun firing dead straight if you disabled the lua simulated recoil, which would pretty much render the code useless?
Tue Aug 23, 2011 5:21 am
Azukki
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
Re: Aim Recoil vs Spray Recoil
If you wanted complete control to yourself in Lua, yes, you would want to set all .ini accuracy and spread values to 0. If you wanted to just have some general inaccuracy along with recoil, or a fixed amount of inaccuracy for unsupported fire, you could do that just as easily with the .ini values, though.
Here's what I came up with, a combination of spread and muzzle rise. It's probably technically inferior and less efficient compared to mehman's, but it demonstrates the idea well enough.
Code:
function Create(self) self.recoilfactor = 0.06 --radians self.recoilrecovery = 0.01 --radians per lua update self.recoil = 0 self.recoilspreadfactor = 20 self.recoilspreadrecovery = 3 self.recoilspread = 0 end
function Update(self) --determine the root object. self.y = MovableMan:GetMOFromID(self.RootID) if self.y:IsActor() then self.z = ToActor(MovableMan:GetMOFromID(self.RootID)) else self.z = self end
--held? if self.z:IsActor() == true then --if held
--just fired? if self:IsReloading() then self.justfired = 0 else if self.magcount ~= self.Magazine.RoundCount and self.Magazine.IsFull == false then self.justfired = 1 self.Sharpness = self.Sharpness - 1 else self.justfired = 0 end self.magcount = self.Magazine.RoundCount end
--recoil --add recoils if self.justfired == 1 then self.recoil = self.recoil + self.recoilfactor self.recoilspread = self.recoilspread + self.recoilspreadfactor end --recover from recoils if self.recoil > self.recoilrecovery then --if recoil's above 0, there's still recoil to recover from self.recoil = self.recoil - self.recoilrecovery elseif self.recoil < 0 then self.recoil = self.recoil + self.recoilrecovery end if self.recoilspread > self.recoilspreadrecovery then --if recoil's above 0, there's still recoil to recover from self.recoilspread = self.recoilspread - self.recoilspreadrecovery elseif self.recoilspread < 0 then self.recoilspread = self.recoilspread + self.recoilspreadrecovery end --actually recoil if self.z.HFlipped == true then -- Left self.RotAngle = self.RotAngle + (math.random( -self.recoilspread, self.recoilspread) / 1000) - self.recoil else -- Right self.RotAngle = self.RotAngle + (math.random( -self.recoilspread, self.recoilspread) / 1000) + self.recoil end end end
I did glance at mehman's code, there, but the only thing from it that I remembered and applied was the usage of RotAngle, which works out very well.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum