Client rewrite β-testing

Announcements about major changes in Haven & Hearth.

Re: Client rewrite β-testing

Postby APXEOLOG » Tue Mar 23, 2021 11:08 pm

Java now has a set of tools that can provide a better way to ship the application:
Java Linker: The tool can assemble and optimize a set of modules and their dependencies into a custom run-time image. Basically, it will generate custom JRE which contains only modules required by the application. It can reduce the size of the distribution to ship runtime with the application.
Java Packaging Tool: Packages a Java application into a platform-specific package that includes all of the necessary dependencies. It can generate exe/deb/pkg/other distribution containing all dependencies and the runtime.

I use jlink to generate custom Java 15 JRE for the client and its size is about ~30Mb for the vanilla client.

I think it will be a good idea to ship vanilla client with the modern runtime to increase performance without additional user actions.

ZGC indeed seems to be quite good and it just improves the newer java version is.

I, personally, didn't spot any differences between it and G1 on Java15. But maybe my machine is too powerful as I have 150 FPS with max graphics settings even inside of the village.
W10 Meme Plot | W9 Mantis Garden | W8 Core | W7 Ofir | W6 the City of Dis | W5 Vitterstad | W4 A.D. | W3 Mirniy
jorb wrote:All your characters will be deleted, and I will level every village any one of them were ever members of.
User avatar
APXEOLOG
 
Posts: 1267
Joined: Fri Apr 23, 2010 7:58 am
Location: Somewhere on Earth

Re: Client rewrite β-testing

Postby shubla » Tue Mar 23, 2021 11:20 pm

APXEOLOG wrote:I, personally, didn't spot any differences between it and G1 on Java15. But maybe my machine is too powerful as I have 150 FPS with max graphics settings even inside of the village.

I used ridiculously small audiobuf values and gc stop time debug logs and they were both much better on ZGC, maybe G1 is already so good that the difference in easily feelable stutters is small.
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 » Wed Mar 24, 2021 12:02 am

APXEOLOG wrote:Java Linker: The tool can assemble and optimize a set of modules and their dependencies into a custom run-time image. Basically, it will generate custom JRE which contains only modules required by the application. It can reduce the size of the distribution to ship runtime with the application.
Java Packaging Tool: Packages a Java application into a platform-specific package that includes all of the necessary dependencies. It can generate exe/deb/pkg/other distribution containing all dependencies and the runtime.

Correct me if I'm wrong, but I believe both of those tools generate platform-specific files. The one thing I like the most about distributing a Jar file is that there only needs to be one download link, not a separate download page where you have to choose operating systems and whatnot.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
 
Posts: 8926
Joined: Fri Apr 03, 2009 7:05 am

Re: Client rewrite β-testing

Postby APXEOLOG » Wed Mar 24, 2021 1:37 am

loftar wrote:The one thing I like the most about distributing a Jar file is that there only needs to be one download link, not a separate download page where you have to choose operating systems and whatnot.

While this is theoretically true in reality, afaik, Windows 10 (which I think is used by 99% of the playerbase) does not come with Java installed. This means that every player should manually find a separate download page first, before playing the game.
I cannot count how many times I've answered the question "What java version do I need and where do I download it?" - even in the past few days from the people who play H&H for years.

I think every player would like to have a download page where he can download the complete "one click run" version of the game.
W10 Meme Plot | W9 Mantis Garden | W8 Core | W7 Ofir | W6 the City of Dis | W5 Vitterstad | W4 A.D. | W3 Mirniy
jorb wrote:All your characters will be deleted, and I will level every village any one of them were ever members of.
User avatar
APXEOLOG
 
Posts: 1267
Joined: Fri Apr 23, 2010 7:58 am
Location: Somewhere on Earth

Re: Client rewrite β-testing

Postby foma » Wed Mar 24, 2021 2:38 pm

Hi, it crashes on mac after showing loading screen.
macos Mojave 10.14.6, java 1.8.0_202
Stacktrace:
Code: Select all
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: com/jogamp/opengl/awt/GLCanvas
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
   at java.lang.Class.getDeclaredMethods0(Native Method)
   at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
   at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
   at java.lang.Class.getMethod0(Class.java:3018)
   at java.lang.Class.getMethod(Class.java:1784)
   at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
   at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: com.jogamp.opengl.awt.GLCanvas
   at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
   ... 19 more

Edit: nevermind, just saw that beta is over.
Default client rendering seems broken though, or just not hiDPI friendly, because it only shows top left corner:
Image
foma
 
Posts: 5
Joined: Wed Nov 16, 2011 7:23 pm

Re: Client rewrite β-testing

Postby loftar » Wed Mar 24, 2021 4:26 pm

foma wrote:Default client rendering seems broken though, or just not hiDPI friendly, because it only shows top left corner

There exists a separate thread for this problem already. Unfortunately it has been difficult to debug.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
 
Posts: 8926
Joined: Fri Apr 03, 2009 7:05 am

Re: Client rewrite β-testing

Postby shubla » Thu Mar 25, 2021 6:42 pm

Not sure if related to usage of ZGC. But recently I've noticed that the fps drops from the usual 144 to around 10 or 20.
CPU and GPU usage are still both low, implying that its probably some memory related issue.
When monitored with visualvm, the used heap is around 2000/2100MB
heap dump shows that the actual heap size is actually only 477MB.
If "Perform GC" button in visualvm is repeatedly hit, the used heap drops to around 500MB and the fps rises back to normal levels.

In my opinion it seems to be problem with GC perhaps not working correctly and not removing old stuff leading to very small usable heap / fragmented heap.
This is quite odd, because ZGC has been "stable enough to be production ready" since Java 15.
Could it be bug in the client? I don't know.
Never been able to reproduce it, it seems to happen completely randomly, even if client is just left to be afk.
Maybe there are some arguments to make ZGC a bit more aggressive, usually it works just fine, and changing back to G1 GC is too late now because the small stutters are VERY noticeable on 144hz screen after using ZGC for a while.
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 » Thu Mar 25, 2021 7:08 pm

shubla wrote:This is quite odd, because ZGC has been "stable enough to be production ready" since Java 15.
Could it be bug in the client? I don't know.

Quite odd indeed. If doing a manual GC fixes it, however, then I find it hard to imagine that it could be a client bug somehow. If anything, there is already a built-in :gc console command, which you perhaps use to work around your problem instead of having to use visualvm.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
 
Posts: 8926
Joined: Fri Apr 03, 2009 7:05 am

Re: Client rewrite β-testing

Postby Pommfritz » Thu Aug 26, 2021 12:42 am

shubla wrote:
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.


how do you enable zgc or g1gc for haven? I have no clue about programming/ java

I donwloaded java 15, put the enviromental variables in and checked in the cmd window with java -version and it showed the correct version, that i just installed.
from here I have no clue how to enable it typing in java -XX:+UseZGC into the cmd window does nothing I think.
User avatar
Pommfritz
 
Posts: 360
Joined: Wed Sep 16, 2015 6:00 pm

Re: Client rewrite β-testing

Postby vatas » Thu Aug 26, 2021 8:09 am

I think the argument "java -XX:+UseZGC" needs to be included in the run.bat file.
The most actively maintained Haven and Hearth Wiki (Not guaranteed to be up-to-date with all w14 changes.)

Basic Claim Safety (And what you’re doing wrong) (I recommend you read it in it's entirety, but TL:;DR: Build a Palisade.)

Combat Guide (Overview, PVE, PVP) (Tells you how to try and escape, and make it less likely to die when caught.)
User avatar
vatas
 
Posts: 4507
Joined: Fri Apr 05, 2013 8:34 am
Location: Suomi Finland Perkele

PreviousNext

Return to Announcements

Who is online

Users browsing this forum: Naylok, Python-Requests [Bot], Yandex [Bot] and 16 guests