mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

[New bugs] Weird camera freezing, peds go invisible

Open ArranTuna opened this issue 7 months ago • 18 comments

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

  • [x] I have read and understood the Security Policy and this issue is not security related.

ArranTuna avatar Apr 16 '25 12:04 ArranTuna

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: https://github.com/multitheftauto/mtasa-blue/issues/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.

ArranTuna avatar Apr 16 '25 13:04 ArranTuna

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.

samr46 avatar Apr 16 '25 14:04 samr46

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

Vampiiree avatar Apr 16 '25 14:04 Vampiiree

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 avatar Apr 16 '25 14:04 ArranTuna

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 avatar Apr 16 '25 15:04 ArranTuna

@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

ArranTuna avatar Apr 16 '25 15:04 ArranTuna

same thing happened in #3979

q8X avatar Apr 16 '25 15:04 q8X

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 avatar Apr 16 '25 15:04 ArranTuna

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.

ArranTuna avatar Apr 16 '25 16:04 ArranTuna

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)

samr46 avatar Apr 16 '25 18:04 samr46

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

C0DELEVEL avatar Apr 17 '25 15:04 C0DELEVEL

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)

Kinimel avatar Apr 17 '25 23:04 Kinimel

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

sacr1ficez avatar Apr 23 '25 21:04 sacr1ficez

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.

ArranTuna avatar Apr 23 '25 21:04 ArranTuna

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.

sacr1ficez avatar Apr 23 '25 21:04 sacr1ficez

Yep, got the bugs as soon as tried 23126.

ArranTuna avatar Apr 24 '25 07:04 ArranTuna

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

FileEX avatar May 04 '25 22:05 FileEX

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

ArranTuna avatar May 05 '25 08:05 ArranTuna

Fixed in #4174

botder avatar Jul 17 '25 21:07 botder