multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.42k stars 437 forks source link

Implement new glitch for setGlitchEnabled that allows SA-MP-like strafing with an aimed weapon #2228

Open cinam0n opened 3 years ago

cinam0n commented 3 years ago

Is your feature request related to a problem? Please describe. The players movement while aiming is pretty different to SA-MP. For me as an ex-SA-MP-Player this feels some kind of uncomfortable. I know that MTA is closer to the singleplayer game than SA-MP is, but i also think that this would be a nice feature for those who want to fight like in SA-MP but want to enjoy the benefits of MTA.

Describe the solution you'd like It would be great if you could enable this kind of strafing like a glitch with for example setGlitchEnabled("samp_strafing", true)

Describe alternatives you've considered None.

Additional context For a better explanation what i mean, you can watch this video and you will see that in SA-MP the change between the different GUNMOVE-Animations is faster than in MTA, left is kinda MTA-like and the old SA-MP Movement, right is the current Movement in SA-MP and the Movement i try to achieve: https://www.youtube.com/watch?v=W2MkSXFR-RU

AlexTMjugador commented 3 years ago

I guess you've already tried to enable glitches like "fastmove" using setGlitchEnabled, but they didn't give the expected result?

cinam0n commented 3 years ago

Yes i enabled all existing glitches, fastmove isn't the same like i mentioned above, it feels more SA-MP like but the animation-blending between the GUNMOVE-Anims is still there, its like SA-MP is missing this blending-part.

ffsPLASMA commented 3 years ago

Hmm Im not sure and I could be totally wrong, but could it be the way it is simply because MTA uses the CJ animations for all ped models, while SAMP uses the actual ped animations for different peds?

cinam0n commented 3 years ago

In SA-MP its possible too to enable the CJ-Animations for all ped models. I asked Whitetiger from SA-MP AC if he knows more, he said that this behaviour is caused by a fix that SA-MP has added to allow strafing with more than 45 FPS. SA-MP is speeding up some animation, i think this "direction-change" anim.

ffsPLASMA commented 3 years ago

Have you tried using setPedAnimationSpeed ?

cinam0n commented 3 years ago

Yes, i already tried setPedAnimationSpeed but it only changes the speed of a animation that was set before. I got another video-example of the bug i mean. It was introduced with SA-MP 0.3d as you can see here: https://www.youtube.com/watch?v=W2MkSXFR-RU

Lpsd commented 3 years ago

@cinam0n Can you show the code you've tried with setPedAnimationSpeed? I don't see any reason why you shouldn't be able to detect when the desired animation is playing for the local player and change its speed.

cinam0n commented 3 years ago

I tested it again, setPedAnimationSpeed does indeed speed up the Gunmove-Animations, but the blending between those anims is not affected

Lpsd commented 3 years ago

When you detect the desired animation, how about getting the animation details with getPedAnimation, setting it again with setPedAnimation, but with blendTime set to 0? Then you can use setPedAnimationSpeed if necessary.

AlexTMjugador commented 3 years ago

My thoughts: if SAMP-like strafing can be achieved by a resource, that resource probably should be published as a community resource, maybe adding a link to it in the wiki, or added to the MTA resources repo. I don't believe setGlitchEnabled should enable behaviors that didn't exist in the original game in the first place, and were introduced due to modifications other than MTA.

Lpsd commented 3 years ago

Yeah I don't agree with making any changes to MTA to achieve some possibly dodgy mechanics from SAMP.

You should be able to get it pretty close with just Lua scripting - I mean you can literally emulate SAMP inside of MTA due to how much more powerful it is, so this shouldn't be an issue.

For now, I'll close this, as it's not really an MTA issue, more of a personal preference based on your past experiences with SAMP. You can use our scripting channels on the community Discord to ask questions and investigate further: https://discord.gg/mtasa

AlexTMjugador commented 3 years ago

I also think that a considerable amount of players migrating from SAMP to MTA may need to get used to this difference, or even find it a bit awkward, though. I completely agree with @Lpsd closing this issue for the reasons he stated, but I also think it'd be nice if we continued the conversation about how to reimplement it via a resource here, because this issue serves better the purposes of archival and disclosure of related information (IMO) than a community Discord. In my view, I think it'd be fine to continue discussing an overview of how to achieve this SAMP quirk in this issue :)

Lpsd commented 3 years ago

Fair enough, I'll leave it open so people can track this better.

cinam0n commented 3 years ago

Well, i agree with you, that it would be the best to implement this by using a resource. I opened this issue because i was not able to find a proper way to reimplement this SA-MP-like behaviour with the given functions, even if I can't rule out that I missed something.

i tried to implement it by using the way mentioned in the first post here: https://forum.mtasa.com/topic/96089-changing-direction-slow-when-aiming/ But also changing the Animation-Speed, canceling the Animation or changing the Animation, like done in the mentioned post, skips this blending time or a short annoying stop between the anims

cinam0n commented 3 years ago

A short bump! Does anyone have any suggestion on how to achieve the desired behavior?

lopezloo commented 3 years ago

Very similar to issue #502. They probably have disabled that animation time-limit altogether in SA-MP.

Dryxio commented 1 year ago

bump, any news?

nekjutsu commented 2 weeks ago

I would call this a bug, because the movements are too slow In all modern games (especially shooters) movements are much faster

The glitch(fix) should be enabled by default