Java to c++??

General discussion and socializing.

Java to c++??

Postby pedorlee » Sat Oct 17, 2015 8:56 pm

This is probably an idiot question dued to my noobiness but I will keep on with it.
Since using Java looks like one of the causes of the resource sink that this game suffer, would it be impossible or suboptimal to port it to c++? I mean, with the game compiled wouldnt it run faster?
My gameplay its ok with a AAA+ computer, but with a low tier laptop wich plays ok League of Legends this game runs poorly, fps must be like 20 or so because its like "jumping" frames. I was thinking in installing it in a pentium 4 with 3 gigs of ram and a powerful Radeon (3 y old, but still competitive) but I'm pretty sure it will run even worse.
There is a serious issue with the performance.
Also, I'm having problems with java and the clients on a windows 8 updated laptop. The basic client runs well but the others close after logging while charging screen. They generate a log with the failures, should I post it or is it "dangerous"? I've thought in running it through a vm and a windows7, wich doesnt seem to give any kind of problem with java and its security, but this options would consume extra ram and resources and since this game requires so much I'm not sure it will work.
Any opinion?
User avatar
pedorlee
 
Posts: 1321
Joined: Sat Feb 04, 2012 10:36 pm

Re: Java to c++??

Postby shubla » Sat Oct 17, 2015 9:13 pm

Java is good. Changing client from java to c++ would basically mean total recode of it. No thanks.
Also, changing to c++ wouldnt guarantee devs would write some good performance code.
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: 13041
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

Re: Java to c++??

Postby Sever » Sat Oct 17, 2015 9:18 pm

From what I've heard, Java takes 1.5x the amount of time to do things compared to C++. That's probably an average value of all possible instructions when comparing a cpu to the virtual machine. I doubt it is Java itself that is to blame for Haven's poor efficiency unless that number is way off.

People said the same about Minecraft, and then they actually optimized it. It made a big difference.
Come back two hours earlier.
User avatar
Sever
 
Posts: 723
Joined: Fri Aug 28, 2009 8:38 pm
Location: Elsewhere

Re: Java to c++??

Postby shubla » Sat Oct 17, 2015 9:24 pm

Sever wrote:From what I've heard, Java takes 1.5x the amount of time to do things compared to C++. That's probably an average value of all possible instructions when comparing a cpu to the virtual machine. I doubt it is Java itself that is to blame for Haven's poor efficiency unless that number is way off.

People said the same about Minecraft, and then they actually optimized it. It made a big difference.

Exactly. Haven performance cant be compared to AAA games. Because their coders are usually way more skilled and they run on engines that are very well optimized. But i guess if polygons from stuff would be reduced greatly it would maybe give more performance. And textures quality lowered significantly. Like in some custom res pack.
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: 13041
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

Re: Java to c++??

Postby Myzreal » Sat Oct 17, 2015 9:26 pm

From what I've heard, Java takes 1.5x the amount of time to do things compared to C++


You've heard wrong. That might have been the truth in early Java days, but nowadays the JVM has some very powerful optimizations in place, making the bytecode run comparably to native code in most scenarios.

Rewriting the client doesn't make any sense and it would not run on Linux and Mac.
Paste me to get hacked: http://a/%%30%30
Myzreal
 
Posts: 69
Joined: Sun Jul 03, 2011 5:32 pm

Re: Java to c++??

Postby pedorlee » Sat Oct 17, 2015 9:40 pm

Myzreal wrote:
From what I've heard, Java takes 1.5x the amount of time to do things compared to C++


You've heard wrong. That might have been the truth in early Java days, but nowadays the JVM has some very powerful optimizations in place, making the bytecode run comparably to native code in most scenarios.

Rewriting the client doesn't make any sense and it would not run on Linux and Mac.

That sounds right.
Java compiles in real time, it cant be as fast as a previously compiled program per definition. Show me why I'm wrong.
User avatar
pedorlee
 
Posts: 1321
Joined: Sat Feb 04, 2012 10:36 pm

Re: Java to c++??

Postby Sevenless » Sat Oct 17, 2015 9:46 pm

Myzreal wrote:
From what I've heard, Java takes 1.5x the amount of time to do things compared to C++


You've heard wrong. That might have been the truth in early Java days, but nowadays the JVM has some very powerful optimizations in place, making the bytecode run comparably to native code in most scenarios.


These days, java is unpopular for game design primarily due to convention and lack of libraries tailored to coding games. That and the whole JVM security issue which has made some coders a little wary of it.
Lucky: haven is so quirky
Lucky: can be so ugly, can be so heartwarming
Sevenless: it is life

The Art of Herding
W16 Casting Rod Cheatsheet
Explanation of the logic behind the cooking system
User avatar
Sevenless
 
Posts: 7609
Joined: Fri Mar 04, 2011 3:55 am
Location: Canada

Re: Java to c++??

Postby MagicManICT » Sat Oct 17, 2015 10:38 pm

Myzreal wrote:
From what I've heard, Java takes 1.5x the amount of time to do things compared to C++


You've heard wrong. That might have been the truth in early Java days, but nowadays the JVM has some very powerful optimizations in place, making the bytecode run comparably to native code in most scenarios.


Mostly, it depends on the code, and poorly written C/C++ code is going to be slower than properly optimized Java code. I think in the best case scenarios, native code runs a few percentage points faster, but that means both bases are properly optimized and such.

The client is just in need of a lot of optimization, and there's a ton of bugs and other things to fix on top of that.
Opinions expressed in this statement are the authors alone and in no way reflect on the game development values of the actual developers.
User avatar
MagicManICT
 
Posts: 18435
Joined: Tue Aug 17, 2010 1:47 am

Re: Java to c++??

Postby mamotromico » Sun Oct 18, 2015 1:21 am

Myzreal wrote: it would not run on Linux and Mac.


what
User avatar
mamotromico
 
Posts: 184
Joined: Wed Aug 19, 2015 10:25 pm

Re: Java to c++??

Postby Sevenless » Sun Oct 18, 2015 1:24 am

mamotromico wrote:
Myzreal wrote: it would not run on Linux and Mac.


what


It wouldn't run without some specific optimization effort if I remember correctly. Supposedly for java you only need one set of code.

But hey the game doesn't really run on macs right now anyway so it's not that different XD At least not without some effort.
Lucky: haven is so quirky
Lucky: can be so ugly, can be so heartwarming
Sevenless: it is life

The Art of Herding
W16 Casting Rod Cheatsheet
Explanation of the logic behind the cooking system
User avatar
Sevenless
 
Posts: 7609
Joined: Fri Mar 04, 2011 3:55 am
Location: Canada

Next

Return to The Inn of Brodgar

Who is online

Users browsing this forum: Claude [Bot], Dotbot [Bot] and 44 guests