NullSystemWorks / mtadayz

Official MTA:DayZ Repository
Other
41 stars 35 forks source link

Bug, the game stucks every 1 second (FPS drop) #119

Closed KOPYk4T closed 6 years ago

KOPYk4T commented 6 years ago

I've read that another people also have this problem. When I start DayZ the game stucks for 1 sec every second, making imposible playing and aiming.

Oh, and it get worst when the time go forward. After 30 mins, its imposible to play. A lot of people have this problem

It's like a timer bug, like if the gamemode is checking something every second and it lags the game

I thought that it was another resource, but then i started only DayZ, and still laggy with this FPS drop

KOPYk4T commented 6 years ago

It's something related to loot i think. My server started with a weight of 5.5 mb, and after 3 hours it was like 11.6 mb to enter

KOPYk4T commented 6 years ago

Oh, and i tried another servers with this version and they also have this problem.

Then i created a local server, with another DayZ Gamemode (older ones, like 2 years old) and it did'nt have this problem

jdmNTC commented 6 years ago

This problem does not happen to me. I use the '0.9.9a'. The only problem that occurred was when using the 'item morphine'

neves768 commented 6 years ago

We have been studying this case for a long time by now. We couldn't find what causes this problem, but we are still trying to find it. Any help coming from the community is very welcome.

KOPYk4T commented 6 years ago

About the increasing weight of the server: I think that it is the item respawn. Because i let it 2 hours and it increased now from 5mb to 7.5 mb and it doesn't stop

KOPYk4T commented 6 years ago

I've found the error.

I've been deleting a lot of the code in the meta.xml to discard where it was the problem

And the problem is in one of this:

<script src="handlers/world/client/night/c_night.lua" type="client" cache="false" />
<file src="handlers/world/client/night/mta-helper.fx" type="client" />
<file src="handlers/world/client/night/night.fx" type="client" />
KOPYk4T commented 6 years ago

Like i said, it was checking every second if it was on night or not. That was lagging.

I changed 1 sec in c_night.lua to 5 mins

ghost commented 6 years ago

Since night and day are periodic events, is it really necessary to check for it every second?

Risusama commented 6 years ago

I'll make a change soon in my repo and create a pull request for it. For starters, I'll set it to 5 minutes. Plus, I'll also make it easily configurable.

jdmNTC commented 6 years ago

Were you able to solve the problem? Can I do it with my gamemode so I do not suffer too?

jdmNTC commented 6 years ago

Did you just delete the 'meta' and stop the 'lag'?

KOPYk4T commented 6 years ago
<script src="handlers/world/client/night/c_night.lua" type="client" cache="false" />

Find that file, and then find this line... end,1000,0,clone) and this one... nightTimer = setTimer(night_check, 1000, 0) Now you have to change the 1000 for a 300000 like this... end,300000,0,clone) nightTimer = setTimer(night_check, 300000, 0)

neves768 commented 6 years ago

Pull request #120 should fix this problem.

neves768 commented 5 years ago

@debexeL @DaveSticks Is this bug still a thing? Did it got fixed?

Risusama commented 5 years ago

This has been fixed in #120 .