Skip to content

[New bugs] Weird camera freezing, peds go invisible #4163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
ArranTuna opened this issue Apr 16, 2025 · 18 comments
Open
1 task done

[New bugs] Weird camera freezing, peds go invisible #4163

ArranTuna opened this issue Apr 16, 2025 · 18 comments
Labels
bug Something isn't working

Comments

@ArranTuna
Copy link
Collaborator

Describe the bug

In the last week or 2, I have been made aware of a bug that I am also able to reproduce, I was told "fly over an AR" (Armed robbery event on CIT server) and it occurred. The camera seems to freeze for a second then when the freeze ends it has moved and the sky flashes. Here a video someone made:

https://imgur.com/a/ds9aIqQ

I was able to to reproduce it even when the vehicle was frozen, the screen seems to glitch 2 or 3 times, then is fine for a while. Also tried with helicopter on the ground, happened then.

I noticed for a split second on the radar, it went to the center (0, 0, 0) of the map.

Also my sound has randomly stopped working as I was flying to another AR, until exiting the vehicle, in case it's related.

And another bug that is also new, going invisible and other players too, also another player in chat reports not being able to see themself. I could see some players but not myself and some others.

Image

As you can see I checked to make sure my alpha was 255 which it was. So something is getting really messed up with the game, I've experienced 3 new bugs in a short amount of time testing.

Steps to reproduce

Join mtasa://94.23.158.180:22003
Do /criminal then do /arl to see where the AR is (though I did experience that camera bug some where else, but seems easy to reproduce it at an AR
Not sure if needed to reproduce the camera bug, a helicopter, you can buy a cargobob with the starting cash here:

Image
You can land near an AR to get the camera bug, or just be on foot and get the invisible ped bug.

Version

Multi Theft Auto v1.6-release-23147 (this is the newest nightly at time of reporting)

Additional context

No response

Relevant log output

No debugs come up.

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@ArranTuna ArranTuna added the bug Something isn't working label Apr 16, 2025
@ArranTuna
Copy link
Collaborator Author

ArranTuna commented Apr 16, 2025

Helicopter isn't needed to reproduce the camera bug, I got it when stationary in a car (though possible another aircraft could be nearby)

I have noticed that this was already reported and marked as invalid here: #4158

Dutchman101 closed it but I do not see how a bug in our radar script (I am not getting any debug messages) can cause the screen to freeze, camera rotation to change (radar script doesn't change that, we do not use setPedCameraRotation at all) or how it can cause some peds including yourself to randomly become invisible. And this is affecting every player. Also it has never happened before and we haven't changed the script recently.

Here is some additional proof this is bug in MTA not a script:

I did this: crun setTimer(function() outputConsole("Camera rotation: "..getPedCameraRotation(localPlayer)) end, 1000, 1000)
I opened the console the rotation was 159.86
I kept the console open, minimized the game, checked back 5 minutes later:
Camera rotation: 175.25317382812
There is no explanation for the camera rotation to change while console is open and no script is doing it. It happens when that bug occurs and that debug in CITradar is a symptom not the cause, it was caused by getPedCameraRotation returning something unexpected.

I have witnessed the bug with the rotation being output and yes the camera rotation returned is being changed when this bug occurs, this is definitely a new MTA bug.

@samr46
Copy link
Contributor

samr46 commented Apr 16, 2025

I noticed similar things happening on my project. First anomalies were detected on build 23132.

Could you check clientscript.log for warnings? I noticed that all affected players were getting warnings of this type: Expected number, got NaN.
Functions getElementPosition, getCameraMatrix (and probably some other functions too) started to return NaN values for no apparent reason and it breaks things.

@Vampiiree
Copy link

We had some warnings with dxDrawImage and getDistanceBetweenPoints2D:
Bad argument @ 'dxDrawImage' [Expected number, got NaN]
Bad argument @ 'getDistanceBetweenPoints2D' [Expected number, got NaN]

@ArranTuna
Copy link
Collaborator Author

I am not seeing any NaN warnings on me or other players.

I tried addDebugHook to see if a script is causing it, but within seconds the log file was over 1 million lines long, so I think it's too hard to find the cause that way.

@ArranTuna
Copy link
Collaborator Author

I added a 300ms timer showing xyz and camera rotation. 91.7 is the rotation before bug started. Player position seems correct but does have some tiny changes during the bug.

Image

@ArranTuna
Copy link
Collaborator Author

@samr46 I got some weird results with getCameraMatrix which could be the cause of NaN:

Image

Note the one that returned 1 0 0 2 0 0 as the result of getCameraMatrix

@q8X
Copy link

q8X commented Apr 16, 2025

same thing happened in #3979

@ArranTuna
Copy link
Collaborator Author

same thing happened in #3979

Looked at the first video and yeah that is the same kind of glitch.

It seems something is causing our camera to be set to the middle of the map for a fraction of a second.

@ArranTuna
Copy link
Collaborator Author

I have been running getCameraMatrix nonstop to try and get some errors in my local server but so far (after more than an hour) i had found no issues. Also the users that have the errors are not that many. The last thing to add is that I can see this issue happening since at least september 2024, so either it got worse or my users don't have it and I am reporting something different but similar.

It seems to require things going on, players moving around and such to get the bug.

@samr46
Copy link
Contributor

samr46 commented Apr 16, 2025

Note the one that returned 1 0 0 2 0 0 as the result of getCameraMatrix

Yeah, I got similar results with getCameraMatrix and getElementPosition. And blips are affected as well (this might explain reports about new issues with custom radars)

@C0DELEVEL
Copy link

I can confirm that many of our players also experienced very similar problems listed above. In addition - one player caught a strange bug that never happened before - after exiting the car player got a bugged loading screen (looks like from gta sa?) and then it got teleported him to position 0,0,X: https://imgur.com/a/wVDpdw9

@Kinimel
Copy link

Kinimel commented Apr 17, 2025

I can say that I had similar problems above, as demonstrated in the video above and yes, it was on the CIT server, the same also occurs in buggy events, the character becomes invisible.

We had some warnings with dxDrawImage and getDistanceBetweenPoints2D: Bad argument @ 'dxDrawImage' [Expected number, got NaN] Bad argument @ 'getDistanceBetweenPoints2D' [Expected number, got NaN]

But I did not have the same result with the implementation of (expected number response obtained, NaN)

@sacr1ficez
Copy link
Contributor

Try downgrading your client version to Multi Theft Auto v1.6-release-23124, and see if it helps.

@ArranTuna
Copy link
Collaborator Author

Try downgrading your client version to Multi Theft Auto v1.6-release-23124, and see if it helps.

I tried with 23124 and didn't get the invisible ped or camera freeze bug.

@sacr1ficez
Copy link
Contributor

Try updating to 23126, the bug should appear again. At least that's how it was in my case, so extra confirmation would be useful.

@ArranTuna
Copy link
Collaborator Author

Yep, got the bugs as soon as tried 23126.

ArranTuna referenced this issue Apr 24, 2025
* Fix bug

* Update CMultiplayerSA_FrameRateFixes.cpp

* Update CMultiplayerSA_FrameRateFixes.cpp

---------

Co-authored-by: Dutchman101 <12105539+Dutchman101@users.noreply.github.com>
@FileEX
Copy link
Contributor

FileEX commented May 4, 2025

Please, check the latest version: https://nightly.mtasa.com/mtasa-1.6-rc-23179-20250504.exe

@ArranTuna
Copy link
Collaborator Author

It seems fixed. I can't get the screen freeze or invisible peds bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants