Original Post — Direct link

The other day I posted a bit of a write up on a potential fix for the FOV zeroing bug. After further testing I am 100% sure that this is the issue that is currently affecting Tarkov.

To the mods, I am pretty sure this doesn't violate rule 8 as I provide a lot of new info in here. So please go easy on me.

New Findings

In my last post, I provided little evidence that this is the issue that is present in Tarkov. After making the post I started to do some testing within Tarkov to see if I could find more proof that what I found was indeed the same issue that is within Tarkov. To my surprise, what I found mirrored my tests in my project perfectly. What you are looking for in the videos linked below here is the gap between the red dot and the green laser. From my tests I found the green laser follows the vector of the barrel almost perfectly in the world. Keep this in mind as it is the best way to visualize what I will be talking about in this post. If the weapon in the view model accurately represented where you were aiming, then the distance between the red dot and the end of the green laser should always been consistent between different FOVs (but please keep in mind that the weapon bounces a lot when firing so there is a little wiggle room for this).

75 FOV Test in Tarkov

50 FOV Test in Tarkov

Its a little hard to see but the distance between the red dot and the green laser is much larger in the 75 FOV video when the distances should be almost the same. Like I said weapons have a lot of bounce when firing but the distances should always be relatively the same. The reasoning for this is because the green laser is rendered in the World Camera (the camera who's FOV we adjust) and the weapon itself is rendered in the view model camera (the camera with a constant FOV). The different FOV values means that the scaling for the cameras are completely different. Take a look at this image. the green line represents a plane that is 2 units in-front of the cameras.

75 FOV world camera

If we look specifically at the world camera, the green line has a height of about 3 units within the frustum of the camera.

55 FOV view model camera

Now if we look at the view model camera, the green line has a height of just 2 units withing the frustum. This is where this issue stems from. Both cameras are being displayed on the same screen, yet their view of the world is not the exact same. What results is the difference in FOV causing what we are aiming at with the weapon on the view model cameranot actually being in the same place. Now this would not be an issue if it was implemented correctly. The issue with Tarkov is it is not implemented correctly. Since you are aiming at objects rendered in the world camera with an object in the view model camera, there has to be some sort of system in place to make sure everything is scaled right. From what I found there are no corrective measures in place to make sure that we are actually aiming where we are looking. Take a look at this image to better represent what I mean.

Right weapon is rendered with the world camera, left is rendered in the view model camera. Both are the same object with the same rotation the rendered in different cameras .

This can be seen in Tarkov as well by anyone if they want to test for themselves. Simply attach a green laser to any weapon, go into a raid and inspect the weapon in your hands at 75 FOV and at 50 FOV. This is a roughly what you will see.

The bottom one is supposed to say 50 FOV oooops...

Look at the laser at the end of the barrel. At 50 FOV the laser follows the barrel perfectly as the view model camera and the world camera are the same FOV resulting in none of that weird image scaling. As with the top image at 75 FOV the laser points in the same place in the world as the 50 FOV image yet it is at a weird angle from the barrel. This right here is the result of the scaling that you get with different view model and world camera FOVs. Any operation that interacts with both cameras needs to be scaled appropriately to give the player the most accurate representation of what they are doing. When it comes to firing a weapon in Tarkov, we know that where the barrel is pointing is where the bullets are going. But if the player is not getting an accurate representation of where the barrel is actually pointing because of the image skewing then even the slightest deviation off the center of the screen will cause inaccuracies when firing. Since Tarkov has a lot of view model movement from actions such as shooting, moving, breathing, etc. there is a lot going on that will make your shot miss even if your view model says you are aiming perfectly at them since there is no system in place to scale the difference between the FOVs of the cameras. Here is a video from my project that shows the weapons firing before the corrective measures were implemented. The green dot is where the gun is aiming in the world and the red dot is where it is aiming in the view model.

https://reddit.com/link/clligd/video/zj180dlhp9e31/player

Very similar to what is seen in 75 FOV firing test video. Now after I implemented the corrective measures covered in my last post this is what the firing looked like.

https://reddit.com/link/clligd/video/dvydyx4ip9e31/player

Now everything is firing where it should be and the view model accurately represents where you are aiming. Basically what the fix does is scale the rotation of the part of the weapon that deals with aiming so that the view model is now an accurate representation of what is happening. This solution does not affect recoil or anything like that, it is simply a corrective measure to make sure your view model is actually what is happening.

Implementation

This part of the post is where things will get confusing for most people. Its the same as what was in the other post but with a bit more information to try and make it more clear.

https://i.redd.it/9uqufh7cr9e31.png

A lot of the code is just generally dealing with my visual recoil system, but the most important parts I will highlight here.

float viewModelHeight = 2.0f * Mathf.Tan(viewFOV * 0.5f * Mathf.Deg2Rad);
float worldViewHeight = 2.0f * Mathf.Tan(worldFOV * 0.5f * Mathf.Deg2Rad);

This is how we calculate the height of the frustums for both cameras, think of the height of the green line that I talked about earlier. We then use that to create a ratio for scaling rotations.

float FOVRatio = worldViewHeight / viewModelHeight;

Now we need to have a separate object that is a child of the view model or whatever object is in the view model camera that is used for aiming (such as the weapon or in my case I rotated and move the entire view model)

https://i.redd.it/qybek6vls9e31.png

In this case I use Barrel. Now in the code we essentially add an extra rotation to Barrel to make up for the difference in the camera FOVs.

// the local rotation of the view model based on the recoil vector
Vector3 localRotation = new Vector3(-recoilWeaponVector.y, recoilWeaponVector.x, 0f);
Vector3 savedRotation = localRotation; // save the vector again as we need it for the difference

// calculate the difference in rotation between the two views
localRotation = (localRotation * FOVRatio) - savedRotation;

// barrel refers to the two points that I use to calculate where the gun is pointing,
// this is what needs to be scaled based on the difference in rotation.
// it is also important to note that this is a child of the view model.
barrel.transform.localEulerAngles = localRotation;
// rotate the view model with the unscaled version of the rotation.
viewModel.transform.localEulerAngles = savedRotation;

If everything is done right we should be shooting straight. But I think it is important to mention that this system would require some modification to work in Tarkov as I do not have access to the code. But this is just a proof of concept to show a fix that they could implement with some modification.

Conclusion

With everything that I have found and tested I am 100% sure that this is the issue that is causing the zeroing bug in Tarkov and just general inaccuracies with the weapons. There are way too many parallels between my problem and Tarkov's for this to just be coincidence. The devs need to see this. I am willing to work with them to try and get things implemented correctly and to make sure they understand the system that I proposed in my last post. Please PM me if there is anything else I can do or add to this to hopefully help lead to a fix for this bug. Also please discuss what you guys think in the comments below. I want to know your opinions as it helps me test further and it may lead to us finding out some new things.

Thank you for reading all this yet again and here's to hoping this can lead to a fix.

Additional Stuff

I don't want this to become a situation where people are like "lazy devs" or "the community always fixing the game for them". We are here to test the game, and in some cases the community can stumble across a potential solution for things. That's all part of it, especially with a community as dedicated as this one. So please show respect to the devs, they are working their asses off to make this game as good as it can be for us.

- St0rmSpirit / LordMaleki

External link →
almost 5 years ago - /u/trainfender - Direct link

we have only one camera rendering everything and we scale weapon additionally to avoid “carrot effect”. laser distortion and weapon skew when your weapon is noticeable not axis straughtis the thing yes and we have the plan to fix it. When you aim you gun sligns straight. Anyway, we will investigate more, thanks for your efforts!