SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
86 stars 18 forks source link

Add option to keep Steam voice running to eliminate hitching #4248

Closed Senior-S closed 10 months ago

Senior-S commented 10 months ago

Hi Nelson, me, and a friend of mine are having this issue since the 3.23.12 update.

When I press the key to talk in game the game freezes for a sec or more, dropping my fps to almost 0 and raising my ping too, I first though that it may be a problem on my side but after my friend told me that this happens to him too, I realized that this may be a bug. There's another problem too but I think this is related to how the UI system works; When you press twice the Home key to hide the vanilla UI the game reduces it's fps to the half or even lower, in my PC it isn't really a problem due it only reduces the fps to 120 or so, but in some mid/low specs PC's this are more noticeable, and usually freezes the game, making it a problem when you're playing.

You can see both of this bugs on this video: https://www.youtube.com/watch?v=CzSQ__ar0ug

The specs of my PC are: CPU: Intel I5-10400 Memory: 32 GB DDR4 GPU: NVIDIA RTX 2060

Client logs: Client.log

ItsRodrigoAl commented 10 months ago

Can confirm the talk button lag. This has been always an issue for me on all the three different PCs I've had from different years of game playing

GazziFX commented 10 months ago

I had that issue too long time ago when I had old webcam, that might be a driver issue. In CS2 (or in some soft not remember) theres option to always listen microphone even if you're not pressing Push To Talk to avoid that freeze

GazziFX commented 10 months ago

IMG_20231209_113237.jpg

SDGNelson commented 10 months ago

The voice issue has been reported for a long time, but not for everyone. Maybe it is a driver issue as GazziFX mentioned?

I hadn't considered just keeping the game constantly recording before. (and still only sending while pushing) Thanks GazziFX for pointing that out in CS2. That seems quite reasonable to add as an option, will do.

As for the toggling UI hitch, I don't think this is worth addressing since it's rather niche.

SDGNelson commented 10 months ago

The new option defaults to enabled for the next update. Fingers crossed that hopefully it helps! 🤞

Senior-S commented 10 months ago

Hi Nelson, the new update seems to have fixed the issue with the voice chat, but my friend pointed out a new bug that seems to be even worse in some cases.

You can see the tests on different maps and situations here: https://youtu.be/bmDXb7fMx3w

ItsRodrigoAl commented 10 months ago

As for the toggling UI hitch, I don't think this is worth addressing since it's rather niche.

@Senior-S Reading is a valid thing, you know... xd

Senior-S commented 10 months ago

As for the toggling UI hitch, I don't think this is worth addressing since it's rather niche.

@Senior-S Reading is a valid thing, you know... xd

The problem is there and it really affect some players, I know there's some other priorities on the game but at least would be cool to have the game working for new users, due it sucks to have bugs that can make the game unplayable; When you open the inventory the game lags too, this isn't a big deal for a lot of players but it is there and it's a essential part of the game, it's not just a random thing

SnSKarma commented 10 months ago

As for the toggling UI hitch, I don't think this is worth addressing since it's rather niche.

@Senior-S Reading is a valid thing, you know... xd

Same to you, the new post Senior has made was to explain the fact that this is not a very simple and non-important issue, as it brings him down from three digits of FPS to one, lowering from one hundred to three just by getting shot while having the hud off.

The inventory and hud have had fairly bad performance issues for a while, and regardless if you don't notice it on high-end computers, most of the player base don't have access to those, for example, this error has caused me to die in completely unfair ways as my opponent had the advantage as I couldn't react due to my FPS lowering from 40 to literally 0 and having me completely unable to do anything for those precious seconds you have to react after getting shot in this game, and this is certainly not only me as proven by this issue.

And, as I mentioned before, this is with the inventory in general, opening also causes me lag spikes, closing it, getting shot while opening it can directly cause my game to freeze for a couple of seconds, and having that happen on a game that is based on PvP where you have seconds to react even a stutter can mean your death.

Not everyone in this game has a good computer, some play on study laptops, some play on average computers, I wouldn't think it to be fair to just shrug away that portion of the player base on the basis that it is not as significant on some of the player's computers.

ItsRodrigoAl commented 10 months ago

@SnSKarma @Senior-S I also have the inventory lag issue when opening/closing it and is actually fair to be reported, but Nelson himself stated the UI toggle issue is a bit niche, meaning it would require maybe a lot of effort to fix it just for results that almost nobody will notice, because for real, you talk about this issue like if it were the biggest problem on unturned, but seriously who plays the game toggling all the time the UI button? For real, who do it?

On the other hand, the lag when opening/closing the inventory may be a hard one to adress since the whole game interface is just one of the weakest part of the game, in terms of performance, non-intuitive, etc.

And just to clarify, I have a 2016 pc, so Im not part of those "good computers" persons and I totally understand all this issue, is jut to be realistic that it is not the biggest of the biggest problems of the game to making Nelson say twice "bro, no, is niche, won't fix (for now), requires a lot work"

SDGNelson commented 10 months ago

I'm happy to hear the voice chat is working without hitches for you now! 😄

In your video it doesn't appear the FPS is actually lower while the HUD is off, rather the FPS is low when the HUD is rapidly enabled and disabled by the flinch overlay. With the uGUI implementation the visibility is handled by activating and deactivating the GameObject which is rather expensive, but when I was working on it and profiled it was much better for performance than keeping the off-screen menus active but invisible.

The reason the UI is enabled for the pain flinch is issue #3860 and is something I intend to revisit, but relatively low priority. When I do revisit that I will add some kind of feature to have UI elements like pain flinch and scopes that ignore the HUD on/off toggle.

When I last worked on it I did profile the inventory opening to eliminate the main causes of hitching. Before uGUI support item creation was all done on a single frame because it worked fine with IMGUI, but with uGUI creating all those GameObjects is expensive, so items are all time-sliced. If I recall correctly, most of the performance cost is currently enabling the inventory HUD GameObjects.

The main performance costs for the default uGUI implementation right now are GameObject related. Both IMGUI and UIToolkit implementations perform better in these scenarios last I checked. Now that I have UIToolkit integrated, I think it's just a matter of time for it to mature a bit more before it can become the default.

at least would be cool to have the game working for new users, due it sucks to have bugs that can make the game unplayable

I think we can be almost 100% sure no new players are PvPing with the HUD disabled. 😛

SnSKarma commented 10 months ago

That is entirely fair enough, I was just mad about the fact that the game is very stuttery to me and my friends with low-end computers in relation to everything that has to do with the inventory and hud, for instance, game stutters when opening storages and other slightly more nerve wracking instances, like ADSing also causing stutters when done with a magnification scope though I can't really provide much more than a sentence currently.

It is simply fair, as I said we don't have great computers and I personally am just highly annoyed by it, especially since the game runs properly as soon as the game is opened but after around 10 minutes it stutters every time I do any inventory-related interaction. It is worth mentioning that while I don't have a very good computer for the task, Unturned doesn't cause my computer to run anywhere above 70% on anything, from CPU to RAM it never uses more than that even when I'm doing other things such as opening browsers and doing misc things on them (Which I don't usually do) yet the game still struggles.

I understand this isn't gonna be a high priority and I am at least thankful we got a response and acknowledgement.