Client rewrite β-testing

Announcements about major changes in Haven & Hearth.

Re: Client rewrite β-testing

Postby loftar » Fri Nov 20, 2020 12:24 am

Schattengaenger wrote:The audibuf 8192 command helped but it is kind of strange still, since i never experienced it anywhere else (meaning past vanilla clients and cutsom clients)
Edit: also would it be possible to make the client save this setting? It is abit tedious to always have to type it in again when you start the client.

The reason the audiobuf setting isn't saved is because I still consider it an ugly fix. The problem with increasing the audio buffer size is that it also increases the latency between the point a sound should start playing and the point it actually does. I'd really like to fix this for real instead since I really don't think that such large buffer sizes should be necessary, but it has been difficult to find the root cause of the problem. It could be that it would help if I used an external audio library instead of Java's built-in audio functionality, but I haven't found a good one to test. (There is OpenAL that is part of the greater JOGL project, but that is something much more complex than just an audio playing library, so I don't think it's a good fit).

Schattengaenger wrote:Just like the auido before I get micro stutters withthe general graphics, but in set intervals of about 1.3 to 1.4 seconds.

Could potentially be garbage collection pauses. You could verify that by monitoring the JVM in something like JVisualVM and see if the stutters you see correspond to the reported garbage collections. They're an unfortunate consequence of using Java (possibly the most unfortunate consequence of using Java), but if they are the cause of your problem, there are a few things you could try. For instance, my experience has been that the new G1 GC that was made the default somewhere between Java 9 and Java 11 improves the situation markedly, so if you're still using Java 8, it could help if you upgrade to at least Java 11. It is also my understanding that there are new garbage collectors on their way to later Java versions that should improve the situation further.

If it turns out that your problem is not GC pauses, then it is something I'm not aware of, at least, but that would be good to debug.

Schattengaenger wrote:And while we're at it: Was there a particular reason to disable the bghz command? I got two monitors and it is really soring for my eyes to see haven dropping to 5 fps every time I do something on the second monitor.

It wasn't removed, it was just integrated into the graphics settings as "gl bghz". It's also available in the options window, and it is in fact saved.

Schattengaenger wrote:1. when holding a violine and moving around any cape you wear will clip through the character

I think that is something that happened with the animation optimizations, and it's something that Jorb will have to look into as it probably regards the bone weighting of the cape.

Schattengaenger wrote:2. I made a flag out of felt and in the amber clinet it showed the material, but I guess the new client didn't yet get the memo that this is possible.

Huh, I thought that was a problem in the old client as well, but apparently it was just a bug I introduced when porting the flag to the new client. I've fixed it locally, so it should take effect after the next patch.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
 
Posts: 9015
Joined: Fri Apr 03, 2009 7:05 am

Re: Client rewrite β-testing

Postby Schattengaenger » Thu Nov 26, 2020 1:47 pm

Thanks for the detailed reply. I'll check out if I am still using Java 8 as soon as I am back from work. It is certainly nice to see the client improving during These last patches. Keep it up!
User avatar
Schattengaenger
 
Posts: 287
Joined: Sat Dec 27, 2014 10:49 am

Re: Client rewrite β-testing

Postby Schattengaenger » Fri Nov 27, 2020 6:47 pm

Forgot it yesterday but today I tried it out.
Interestingly not only the clean up stutters are gone but also the sound "bug" (Edit: well reduced anyway. Wasn't gone completly, but much less noticeable) and the flag is showing as it is supposed to be.

One thing I would like to point out is that if you simpyl search of java, the latest version is java 8 patch-whatever, but what I needed to install was the JDK. Decided to go with JDK 15.0.1
From what I can tell the only "bug" that remains is the cape clipping bug, but you are aware and are working on it. That is all that I can ask for. Maybe upgrading to java jdk 15 will solve similar problems for other people ,too!
User avatar
Schattengaenger
 
Posts: 287
Joined: Sat Dec 27, 2014 10:49 am

Re: Client rewrite β-testing

Postby rodibres » Sun Jan 31, 2021 10:37 pm

Do I need any other previous step in order to run the Beta launcher? I'm running the render-launcher.jar file but nothing happens after the download window closes and the client never shows up.
rodibres
 
Posts: 9
Joined: Sun Jun 03, 2018 5:53 am

Re: Client rewrite β-testing

Postby loftar » Sun Jan 31, 2021 10:39 pm

rodibres wrote:Do I need any other previous step in order to run the Beta launcher? I'm running the render-launcher.jar file but nothing happens after the download window closes and the client never shows up.

The ß-testing is long over, and the default client already uses the rendering rewrite. It's quite conceivable that the beta launcher doesn't work. I've neither deleted nor maintained it.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
 
Posts: 9015
Joined: Fri Apr 03, 2009 7:05 am

Re: Client rewrite β-testing

Postby rodibres » Sun Jan 31, 2021 10:41 pm

loftar wrote:
rodibres wrote:Do I need any other previous step in order to run the Beta launcher? I'm running the render-launcher.jar file but nothing happens after the download window closes and the client never shows up.

The ß-testing is long over, and the default client already uses the rendering rewrite. It's quite conceivable that the beta launcher doesn't work. I've neither deleted nor maintained it.


Oooh that solves it then. Thanks! :D
rodibres
 
Posts: 9
Joined: Sun Jun 03, 2018 5:53 am

Re: Client rewrite β-testing

Postby shubla » Mon Mar 22, 2021 4:54 am

loftar wrote:
Schattengaenger wrote:Just like the auido before I get micro stutters withthe general graphics, but in set intervals of about 1.3 to 1.4 seconds.

Could potentially be garbage collection pauses. You could verify that by monitoring the JVM in something like JVisualVM and see if the stutters you see correspond to the reported garbage collections. They're an unfortunate consequence of using Java (possibly the most unfortunate consequence of using Java), but if they are the cause of your problem, there are a few things you could try. For instance, my experience has been that the new G1 GC that was made the default somewhere between Java 9 and Java 11 improves the situation markedly, so if you're still using Java 8, it could help if you upgrade to at least Java 11. It is also my understanding that there are new garbage collectors on their way to later Java versions that should improve the situation further.

If it turns out that your problem is not GC pauses, then it is something I'm not aware of, at least, but that would be good to debug.

I've been having issues with micro stutter and audiobuf issues, with 512 audiobuf there is chopping constantly multiple times every second. They both are definitely related to GC. I'm using opendjdk 1.8.0_282 on linux, and they both seem to be very consistent to appear when there are longer stops due to gc.

Switching to Openjdk 11 completely removes chopping from 512.

Looks like with java 8 gc sometimes takes as long as 40-50+ milliseconds every few seconds, which causes pretty bad stutter to both audio and picture, but with java11 gc takes most often only less than 16ms.

G1 GC also allows -XX:MaxGCPauseMillis=200 to be changed, and it is advised that this is changed for real time applications, so the gc can try to strive towards shorter pauses rather than large throughput. So perhaps HnH launcher should change it into a lower value from the default 200ms such as 16ms when launching the client?

Maybe you have some statistics about which java versions are being used by players? Could be that many use java 8 which indeed uses the old (worse, I guess) GC by default.
Based on my very empirical testing, java 8 with -XX:+UseG1GC gives a slight improvement, but the difference between java 8 even with G1GC and java 11 is very large, so maybe players should be given advises to use java 11 for HnH. The difference between performance is just beautiful with all those stutters gone.
Image
I'm not sure that I have a strong argument against sketch colors - Jorb, November 2019
http://i.imgur.com/CRrirds.png?1
Join the moderated unofficial discord for the game! https://discord.gg/2TAbGj2
Purus Pasta, The Best Client
User avatar
shubla
 
Posts: 13043
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

Re: Client rewrite β-testing

Postby shubla » Mon Mar 22, 2021 3:07 pm

Some further testing results:

I read the marketing speech of the new new GC Z-GC and decided to test enabling it in java 15.
Audiobuf seems to be excellent way to benchmark GC because the ambient sounds get choppy if there is lot of GC activity.
With java 15 and Z-GC enabled, I can go down to audiobuf 8 and get 0 choppiness, except for when I enter a house (I guess lots of objects being freed and allocated then), then I get some stuttering for a half a second or so, and this will only cease when audiobuf is increased from 8 to 256 for large reduction or 512 for complete elimination.

GC pause statistics show that even maximum pauses for gc indeed are less than 1 millisecond long.

Well anyway, I'm pretty confident that using G1 or even Z for GC will fix audiobuf problems for most people and also reduce micro stuttering by a magnitude.
Image
I'm not sure that I have a strong argument against sketch colors - Jorb, November 2019
http://i.imgur.com/CRrirds.png?1
Join the moderated unofficial discord for the game! https://discord.gg/2TAbGj2
Purus Pasta, The Best Client
User avatar
shubla
 
Posts: 13043
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

Re: Client rewrite β-testing

Postby loftar » Mon Mar 22, 2021 8:22 pm

shubla wrote:Looks like with java 8 gc sometimes takes as long as 40-50+ milliseconds every few seconds, which causes pretty bad stutter to both audio and picture, but with java11 gc takes most often only less than 16ms.

Yeah, Java 8 still uses the old CMS GC by default. I think it was replaced by G1 as the default in JDK 9, and that G1 was also further improved rather drastically up to Java 11, so yes, I generally do recommend using Java 11. (When I tried G1 on Java 8, I personally saw a ~30% drop in general performance, but I don't think that is the case on Java 11 any longer. It could also have disappeared with the new client; I'm not entirely sure.)

shubla wrote:Maybe you have some statistics about which java versions are being used by players? Could be that many use java 8 which indeed uses the old (worse, I guess) GC by default.

Indeed, from the error reports I'm seeing, the vast majority of players do seem to be using Java 8, most likely because that's what is still being distributed on [url]java.com[/url]. That being said, I've seen some people try Java 11 for their audio issues, but not having had them fixed. What operating system are you testing on? I've generally gotten the feeling that Windows users seem to have more problems than Linux users.

shubla wrote:G1 GC also allows -XX:MaxGCPauseMillis=200 to be changed, and it is advised that this is changed for real time applications, so the gc can try to strive towards shorter pauses rather than large throughput. So perhaps HnH launcher should change it into a lower value from the default 200ms such as 16ms when launching the client?

Hm, I wasn't aware of that. That's an interesting idea. I'm not entirely sure how to handle that in the launcher currently, as I'd like to keep it somewhat agnostic to the Java implementation and whatnot, which might require me to implement conditional configuration, which in turn would require a global launcher update. I'll have to think about that, but it's probably not a bad idea. Especially if I could enable ZGC be default on JVMs that support it.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
 
Posts: 9015
Joined: Fri Apr 03, 2009 7:05 am

Re: Client rewrite β-testing

Postby shubla » Mon Mar 22, 2021 10:35 pm

loftar wrote: What operating system are you testing on? I've generally gotten the feeling that Windows users seem to have more problems than Linux users.

Well I tried first in linux and later on windows too, audiobuf couldn't go near as low on windows. But there were still improvements.

ZGC indeed seems to be quite good and it just improves the newer java version is.
We tried different java versions and found out that even the default client didn't work on windows with Java 16. (15 works fine)

Code: Select all
java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 1
    at jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:171)
    at com.jogamp.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:424)
    at com.jogamp.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1513)
    at com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:609)
    at java.desktop/java.awt.Container.addNotify(Container.java:2801)
    at java.desktop/java.awt.Window.addNotify(Window.java:787)
    at java.desktop/java.awt.Frame.addNotify(Frame.java:493)
    at java.desktop/java.awt.Window.pack(Window.java:825)
    at haven.MainFrame.<init>(MainFrame.java:185)
    at haven.MainFrame.main2(MainFrame.java:443)
    at haven.MainFrame.lambda$main$0(MainFrame.java:479)
    at java.base/java.lang.Thread.run(Thread.java:831)

Could be just a jogl problem. Quick forum search tells that some people have had the exact same problem earlier with older java versions in the past.
But it would be great to get it fixed as Java 16 has some further improvements to ZGC and it seems to be an ongoing project still, so Java 17 could bring even more.

Tried running the client with jogl 2.4.0 but got
Code: Select all
com.jogamp.opengl.GLException: Unable to determine GraphicsConfiguration: WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[obj 0x6200affd]], idx 0], pfdID 10, ARB-Choosen true,
    requested GLCaps[rgba 8/8/8/8, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL4/GL4.hw], on-scr[.]],
    chosen    GLCaps[wgl vid 10 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 24/0/0, dbl, mono  , hw, GLProfile[GL4/GL4.hw], on-scr[.]]]
    at jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:182)
    at com.jogamp.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:424)
    at com.jogamp.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1513)
    at com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:609)
    at java.desktop/java.awt.Container.addNotify(Unknown Source)
    at java.desktop/java.awt.Window.addNotify(Unknown Source)
    at java.desktop/java.awt.Frame.addNotify(Unknown Source)
    at java.desktop/java.awt.Window.pack(Unknown Source)
    at haven.MainFrame.<init>(MainFrame.java:185)
    at haven.MainFrame.main2(MainFrame.java:443)
    at haven.MainFrame.lambda$main$0(MainFrame.java:479)
    at java.base/java.lang.Thread.run(Unknown Source)

instead.
Image
I'm not sure that I have a strong argument against sketch colors - Jorb, November 2019
http://i.imgur.com/CRrirds.png?1
Join the moderated unofficial discord for the game! https://discord.gg/2TAbGj2
Purus Pasta, The Best Client
User avatar
shubla
 
Posts: 13043
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

PreviousNext

Return to Announcements

Who is online

Users browsing this forum: Bytespider [Bot], Gradivus, Python-Requests [Bot], Tindranel, UnimportantFarmhand, Yandex [Bot] and 13 guests