Client optimizations: Please test

Forum for alternative clients, mods & discussions on the same.

Client optimizations: Please test

Postby loftar » Fri Apr 08, 2016 2:47 am

As you know, I've been spending quite a bit of time lately trying to optimize the client, and I now have a build that seems to be working. As the changes have been quite invasive, though, I'm not sure if there are complex bugs hiding around, so please test it and report any errors in this thread before I merge the code in the default client.

I've put up an alternative JNLP for testing at http://game.havenandhearth.com/java/hafen-test.jnlp. For custom clients, the code is available in the "j8" branch of the public repo (at <git://sh.seatribe.se/hafen-client>), but do keep in mind that the code will have to be rebased a few more times before merging, so don't merge it to anything but a temporary branch. Unless you're really fond of fixing up weird Git conflicts, at least.

The main change that this code brings is that it tries to cache rendered objects that don't change from frame to frame. In particular, this involves caching instanced variants of duplicated objects, which helps tremendously for such things as crops and flavor objects:
Image


While I do think this should help quite a bit with many common scenarios, though, please do note that it's not like it's the be-all and end-all of optimization. To begin with, not all objects that this system could potentially cache are currently cachable. These things include, in particular: things with variable materials; potentially animated things that are currently still; and dead animals. The difficulty involved in making those things cachable increase in order of that listing. Other things are inherently uncachable; these include in particular animated things, which then includes such things as live hearthlings or animals, hearth fires, bee hives or fully loaded trash stockpiles. There may well be other optimizations applicable to such things, but they are not incorporated in this change.

Also, this system only applies to the CPU side of performance. For those whose main bottleneck is the GPU, this update does nothing at all. However, with a little bit of hope, these changes may perhaps move the main bottleneck to the GPU for now. In that case, the task I would need to undertake would be to profile the GPU usage of the client and see in what ways it could be improved.

Another thing which is loosely related to performance that I'd like to fix soon-ish is that the current implementation of parallel rendering entails some output latency. It buffers completed frames in an unfortunate way that I suspect feels like a performance problem when using the client, even though it's not FPS-related.

Also note that this client does indeed require Java 8. If it works, and I merge the changes, then the client would always require Java 8. Please speak up if this is a problem.

Anyway, I hope there aren't any grievous bugs in there, but if there are, I hope you find them.
"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 optimizations: Please test

Postby strpk0 » Fri Apr 08, 2016 3:20 am

Awesome update man! I'm already getting massive fps increases, can't wait for the custom clients to adopt this update so I can see how high it can go.

List of things I've found thus far:
- Trees don't have animations when being cut anymore (probably intentional but just saying incase it isn't).
Granger wrote:Fuck off, please go grow yourself some decency.

Image
User avatar
strpk0
 
Posts: 1131
Joined: Sat Sep 03, 2011 11:44 pm

Re: Client optimizations: Please test

Postby algeralith » Fri Apr 08, 2016 3:44 am

Got this little exception the first time loading in.

Code: Select all
java.lang.ArrayIndexOutOfBoundsException: 40
   at haven.GLState$Buffer.copye(GLState.java:231)
   at haven.RenderList.add(RenderList.java:228)
   at haven.MapMesh.setup(MapMesh.java:609)
   at haven.RenderList.setup(RenderList.java:170)
   at haven.RenderList.add(RenderList.java:247)
   at haven.MapView$2.setup(MapView.java:487)
   at haven.RenderList.setup(RenderList.java:170)
   at haven.RenderList.add(RenderList.java:247)
   at haven.MapView.setup(MapView.java:821)
   at haven.PView$1.setup(PView.java:198)
   at haven.RenderList.setup(RenderList.java:170)
   at haven.RenderList.setup(RenderList.java:197)
   at haven.PView.draw(PView.java:222)
   at haven.MapView.draw(MapView.java:1192)
   at haven.Widget.draw(Widget.java:659)
   at haven.Widget.draw(Widget.java:664)
   at haven.GameUI.draw(GameUI.java:602)
   at haven.Widget.draw(Widget.java:659)
   at haven.Widget.draw(Widget.java:664)
   at haven.RootWidget.draw(RootWidget.java:66)
   at haven.UI.draw(UI.java:140)
   at haven.HavenPanel.rootdraw(HavenPanel.java:295)
   at haven.HavenPanel.run(HavenPanel.java:538)
   at java.lang.Thread.run(Unknown Source)
algeralith
 
Posts: 335
Joined: Tue Mar 16, 2010 2:26 am

Re: Client optimizations: Please test

Postby Clemence » Fri Apr 08, 2016 3:50 am

Windows xp sp3 32 bits last java jre1.8.0_71 it dont opens with double click.
Cant open it neither with bin/java.exe, javacpl.exe, javaw.exe or javaws.exe.
User avatar
Clemence
 
Posts: 447
Joined: Sat Mar 19, 2011 5:26 am

Re: Client optimizations: Please test

Postby loftar » Fri Apr 08, 2016 4:15 am

strpk0 wrote:- Trees don't have animations when being cut anymore (probably intentional but just saying incase it isn't).

Certainly not intentional; the intention is that there should be no visible changes whatsoever. I do understand why it happens, though.

algeralith wrote:java.lang.ArrayIndexOutOfBoundsException: 40

Does that happen every time?
"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 optimizations: Please test

Postby wolf1000wolf » Fri Apr 08, 2016 4:18 am

Had to update Java for this.

Successfully launched the new client but can't really tell if there's any improvements as I've no clue how to show fps. Feels like there's little if any increase though. My bottleneck might be GPU. :(
wolf1000wolf
 
Posts: 561
Joined: Sun Dec 26, 2010 6:10 am

Re: Client optimizations: Please test

Postby algeralith » Fri Apr 08, 2016 4:20 am

loftar wrote:
algeralith wrote:java.lang.ArrayIndexOutOfBoundsException: 40

Does that happen every time?


Nope, only had it happen that one time during the first load. Just thought I'd post the error in case you were interested.
algeralith
 
Posts: 335
Joined: Tue Mar 16, 2010 2:26 am

Re: Client optimizations: Please test

Postby strpk0 » Fri Apr 08, 2016 4:24 am

wolf1000wolf wrote:Successfully launched the new client but can't really tell if there's any improvements as I've no clue how to show fps.


:stats 1 (and :stats 0 to turn back off).
Improvements for me seem consistent with what loftar says, huge improvements on repetitive objects like huge crop fields, but large combinations of different objects (specially animated ones) still cause slowdown.
Very good step in the right direction. Now to wait until the custom client makers update their clients :D
Granger wrote:Fuck off, please go grow yourself some decency.

Image
User avatar
strpk0
 
Posts: 1131
Joined: Sat Sep 03, 2011 11:44 pm

Re: Client optimizations: Please test

Postby loftar » Fri Apr 08, 2016 4:25 am

wolf1000wolf wrote:I've no clue how to show fps.

:stats on

algeralith wrote:Nope, only had it happen that one time during the first load. Just thought I'd post the error in case you were interested.

Very interested; I just wanted the clarification.
"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 optimizations: Please test

Postby DPblH » Fri Apr 08, 2016 4:29 am

strpk0 wrote:specially animated ones

I'd removed idle animation from domesticated animals at resources. It saves a lot of FPS for me.
Give a man a game engine and he delivers a game. Teach a man how to make a game engine and he never delivers anything.
User avatar
DPblH
 
Posts: 427
Joined: Wed Jun 09, 2010 4:57 pm

Next

Return to The Wizards' Tower

Who is online

Users browsing this forum: rogeranna and 19 guests