Skip to content
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

[BUG] Weird engine sound #392

Closed
dobriyprop opened this issue Mar 4, 2024 · 12 comments
Closed

[BUG] Weird engine sound #392

dobriyprop opened this issue Mar 4, 2024 · 12 comments
Labels
bug Something isn't working dev branch For issues and suggestions related to changes on the development branch

Comments

@dobriyprop
Copy link

Short Description

I suspect after #378 update to dev branch engine sound started to act weird. On the dev branch, it sounds like engine sounds are updating at a much slower rate than on master, almost sounding like they are being interpolated rather than directly taking the engine's RPM.

Branch and Version

dev branch version bbe741d

How to Reproduce (Optional)

Spawn an engine with light flywheel and hear for yourself

Videos

master branch

h264_vbr_540p_2024-03-04_21-20-12.mp4

dev branch

h264_vbr_540p_2024-03-04_21-23-06.mp4
@dobriyprop dobriyprop added the bug Something isn't working label Mar 4, 2024
@thecraftianman
Copy link
Member

Do you still have this issue on the latest commit to dev as well? This may be the volume issue that I resolved in 8a3bd81 after the commit that you listed.

@thecraftianman thecraftianman added the dev branch For issues and suggestions related to changes on the development branch label Mar 5, 2024
@dobriyprop
Copy link
Author

dobriyprop commented Mar 5, 2024

Sorry. I specified the wrong commit. Didn't notice that github page switched back to master. The commit is 15007b6. To be completely sure i redownloaded whole repo right now, switched to dev branch and tested once more - the issue is still present, unfortunately.

PS D:\SteamLibrary\steamapps\common\GarrysMod\garrysmod\addons> git clone https://github.com/ACF-Team/ACF-3.git
Cloning into 'ACF-3'...
remote: Enumerating objects: 20930, done.
remote: Counting objects: 100% (3243/3243), done.
remote: Compressing objects: 100% (1188/1188), done.
remote: Total 20930 (delta 2089), reused 3034 (delta 1928), pack-reused 17687
Receiving objects: 100% (20930/20930), 795.22 MiB | 3.40 MiB/s, done.
Resolving deltas: 100% (11150/11150), done.
Updating files: 100% (1137/1137), done.
PS D:\SteamLibrary\steamapps\common\GarrysMod\garrysmod\addons> git checkout dev
fatal: not a git repository (or any of the parent directories): .git
PS D:\SteamLibrary\steamapps\common\GarrysMod\garrysmod\addons> cd .\ACF-3\
PS D:\SteamLibrary\steamapps\common\GarrysMod\garrysmod\addons\ACF-3> git checkout dev
Switched to a new branch 'dev'
branch 'dev' set up to track 'origin/dev'.
PS D:\SteamLibrary\steamapps\common\GarrysMod\garrysmod\addons\ACF-3> git pull
Already up to date.

изображение

thecraftianman added a commit that referenced this issue Mar 13, 2024
- Fixed some broken KEShove tests
- Fixed fuel tank material not showing up the first time you view it in the menu
- Probably fixed #392
@thecraftianman
Copy link
Member

Just pushed something that should resolve this to dev; can you confirm that it works for your engine setup too?

@dobriyprop
Copy link
Author

The pitch of engine sound still updates too infrequently. Engine sounds too lazy. Is there anything that could be done about that?

2024-03-13_21-58.webm

@thecraftianman
Copy link
Member

How about now?

@dobriyprop
Copy link
Author

Much better. Engine sounds more responsive now. Though refresh rate is not every tick like before but i guess that would put too much strain on networking, right?

2024-03-13_23-34.webm

@thecraftianman
Copy link
Member

Yeah, there's currently a limit on how quickly sounds can be updated to avoid having to send as much network traffic to clients, which is partly the cause of this issue in the first place. If things are no longer a problem now, though, I'll go ahead and close this issue. Thanks for your help testing!

@dobriyprop
Copy link
Author

Thank you, too!

@dobriyprop
Copy link
Author

dobriyprop commented Mar 16, 2024

We found another issue with sounds here.

net.Start("ACF_Sounds_Adjustable")

Updates to pitch and volume being sent by reliable channel. If ping between server and client is big enough, this will cause additional delays in updating pitch and volume of sounds due to client will have to send confirmation receipt before listening for another chunk of data from the server. Maybe for a single run sounds like gun shots that's fine but for engine sounds since they are updated frequently it causes audible choppiness on high ping servers.

thecraftianman added a commit that referenced this issue Mar 22, 2024
Should help address the second issue in #392
@thecraftianman
Copy link
Member

Does sending it through the unreliable channel seem to be more effective for your setup as well? The sound updates appeared to act as expected on my end with this change.

@dobriyprop
Copy link
Author

dobriyprop commented Mar 22, 2024

If you're testing it in singleplayer try it with net_fakelag 50 or higher and listen to the sounds with sending data by reliable and unreliable channels.

Here how it sounds with net_fakelag 0 and net_fakelag 50 on Git-dev-cc340f3 version with no fixes for that.

2024-03-23_00-48.webm

You can hear audible choppiness when ping reaches 100+ ms. This happens because server waits until client confirms that it received previous chunk of data before sending the next one. And if the time taken by server to send the data and receive a confirmation of receipt from the client is bigger than server's rate at which it tries to send data (currently 50ms) it causes it to skip sending next data update to the client causing choppiness.

And here how it sounds with my custom engine sound Starfall chip that sends data by unreliable channel with net_fakelag 0 and net_fakelag 50

2024-03-23_00-49.webm

engine_sound.txt

There's absolutely no choppiness, just a reaction delay between me pressing throttle key and engine's rpm starting to increase.

@dobriyprop
Copy link
Author

@thecraftianman, I might misunderstood your previous message. Rn I pulled latest dev version and tested it out - engine sound is no longer choppy with net_fakelag 50+. Also asked an admin of a server i usually play on to update ACF and I tested it out there - it sounds just as if there is no ping. I think it's finally fixed. Thank you!

2024-03-23_20-14.webm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev branch For issues and suggestions related to changes on the development branch
Projects
None yet
Development

No branches or pull requests

2 participants