PDA

View Full Version : Stop making games in java!



Legendary_Bibo
March 28th, 2011, 12:29 AM
So I decided to buy minecraft and check it out. It took me the past hour to get it working in Linux but luckily I came across a blog that described how to get it to work perfectly. I played for maybe 20 minutes before my laptop shut off because of overheating. It does only with video transcoding and 3D Java applications except for Second Life. Every Java application I use tends to be nothing more than a memory leak.

I'll probably play MC on my dad's desktop. It's only going to get worse because it's spring, and my room is warming up. I could leave my laptop open, but I don't really have space and then I can't see my monitor.

RiceMonster
March 28th, 2011, 12:34 AM
Turn off view bobbing and change the graphics to fast. It helps a lot. You need at least a decent graphics card to play Minecraft smoothly. If you have an intel card, it doesn't run all the great.



And FYI, the only reason Minecraft is available for Linux is because it's in java. So I think you probably do want it to be written in java.

Legendary_Bibo
March 28th, 2011, 12:38 AM
Turn off view bobbing and change the graphics to fast. It helps a lot. You need at least a decent graphics card to play Minecraft smoothly. If you have an intel card, it doesn't run all the great.



And FYI, the only reason Minecraft is available for Linux is because it's in java. So I think you probably do want it to be written in java.

Oh I didn't think the view bobbing put strain on anything. I guess it's easier to use Java than port something to OpenGL.

RiceMonster
March 28th, 2011, 12:41 AM
Oh I didn't think the view bobbing put strain on anything. I guess it's easier to use Java than port something to OpenGL.

Much easier. Java actually does use OpenGL, but they don't need to make any changes to the code at all, or even recompile it to make it run on other operating systems.


But yeah, I mostly play minecraft on my desktop with an nVidia 9800 GT, which runs fine. My laptop has a crappy intel card and it doesn't run all that well. I found disabling viewbobbing did actually make a pretty big difference in performance.

Legendary_Bibo
March 28th, 2011, 12:51 AM
Much easier. Java actually does use OpenGL, but they don't need to make any changes to the code at all, or even recompile it to make it run on other operating systems.


But yeah, I mostly play minecraft on my desktop with an nVidia 9800 GT, which runs fine. My laptop has a crappy intel card and it doesn't run all that well. I found disabling viewbobbing did actually make a pretty big difference in performance.

I would never have thought the view bobbing would cause such a problem. My other laptop has an intel card, and it runs it smooth for 10 minutes and then everything just slows down horribly. My dad's desktop trumps my laptop, and it can actually stay cool, but my room doesn't even get any air conditioning so the most I can manage is a fan blowing on it.

I need a desktop.

fela
March 28th, 2011, 12:57 AM
So does Minecraft use alot of resources then? I was thinking of getting it, but having second thoughts now :/

I'm running a server for it though (under Linux of course), for my friend. If you want to access it it's at http://malachy.org.uk/.

Legendary_Bibo
March 28th, 2011, 01:00 AM
So does Minecraft use alot of resources then? I was thinking of getting it, but having second thoughts now :/

I'm running a server for it though (under Linux of course), for my friend. If you want to access it it's at http://malachy.org.uk/.

It's CPU intensive, I don't know about RAM usage though. It's still addicting, but play it on a computer that has adequate cooling.

fela
March 28th, 2011, 01:16 AM
It's CPU intensive, I don't know about RAM usage though. It's still addicting, but play it on a computer that has adequate cooling.

Any computer should be able to handle 100% load indefinitely without overheating. If it starts to overheat you've got a design fault :P

RiceMonster
March 28th, 2011, 01:31 AM
So does Minecraft use alot of resources then? I was thinking of getting it, but having second thoughts now :/

I'm running a server for it though (under Linux of course), for my friend. If you want to access it it's at http://malachy.org.uk/.

I run one on CentOS 5.5. It's a private server with 4 of my close friends, though.

kostageas
March 28th, 2011, 02:24 AM
I have an ATI graphics card. Is this good enough for minecraft? I'm not really familiar with this kind of thing as I've never really been a gamer.

Would you mind posting the link to the guide you used?

Legendary_Bibo
March 28th, 2011, 02:58 AM
Any computer should be able to handle 100% load indefinitely without overheating. If it starts to overheat you've got a design fault :P

Not a laptop with the lid closed (I have it hooked up to my sexy 27" 1080p monitor).

Legendary_Bibo
March 28th, 2011, 03:01 AM
I have an ATI graphics card. Is this good enough for minecraft? I'm not really familiar with this kind of thing as I've never really been a gamer.

Would you mind posting the link to the guide you used?

You should be more specific about your card. I'm using an ATI card, and it was an okay card from a few years ago when I got my laptop, and it runs Minecraft just fine. Anything should be able to run it, my other laptop has an Intel HD Graphics video card and it can still run it (not well, but it still works). I followed this guide by the way.

Right here (http://www.timashley.me/node/596)

kostageas
March 28th, 2011, 03:48 AM
Thank you! :D

I might actually break down and buy it now.

Legendary_Bibo
March 28th, 2011, 08:25 AM
Thank you! :D

I might actually break down and buy it now.

Word to the wise, make sure you don't have anything important on your to do list. I just sat at my dad's computer for the past 5 hours. It's a simple concept, but it's so fun.

NovaAesa
March 28th, 2011, 08:40 AM
It my understanding that Minecraft has performance issues not because it's written in Java, but rather because it is being thrown together very quickly in a RAD approach rather than something more thought out. Hopefully when features aren't being added any longer, performance issues will be fixed.

Anyone who's a half decent programmer would know that language choice only accounts for a constant performance factor - it's the design of data structures and the way those data structures are used that will make or break a game performance wise.

E.g. write a game in C++ (a comparatively fast language) but with poorly implemented data structures and algorithms. Now write the same game in Python (a comparatively slow language) but with good data structures and algorithms. Even though Python is typically a slower language, the game will run much better in Python.

mcduck
March 28th, 2011, 09:00 AM
Any computer should be able to handle 100% load indefinitely without overheating. If it starts to overheat you've got a design fault :P

+1 to this.

Overheating is always a hardware-related problem. Either the system doesn't have appropriate cooling, or has collected dust that prevents the cooling from working correctly.

mcduck
March 28th, 2011, 09:02 AM
Not a laptop with the lid closed (I have it hooked up to my sexy 27" 1080p monitor).

Laptops aren't usually designed to be used with the lid closed, the keyboard area has it's role in letting some of the extra heat out.

Leave the lid open and your laptop should be able to run at continuous 100% load for years.

Paqman
March 28th, 2011, 10:44 AM
I play Minecraft on my netbook (1.6GHz Atom, 1GB RAM, Intel graphics). It's perfectly playable if you turn it down to minimum settings. To be honest, even on max settings on my desktop the graphics in Minecraft are rubbish anyway, but that's half its charm.

I've heard some folks say they had trouble getting it to run on Linux, but I suspect they're trying to run it in the browser, which i've never bothered with. The only problem i've ever had is sound cutting out occasionally, but apart from that it's always just worked, and I don't even use Sun Java.

But yes, yay for Java giving us games like Minecraft on Linux.

madjr
March 28th, 2011, 03:37 PM
+1 to this.

Overheating is always a hardware-related problem. Either the system doesn't have appropriate cooling, or has collected dust that prevents the cooling from working correctly.

yes, remove the internal fan from the laptop and clean it, that collects more dust than anything else and makes it extremely hot.

JDShu
March 28th, 2011, 05:35 PM
Just wanted to comment that Java is the industry standard these days, so we won't see it going any time soon :)

forrestcupp
March 28th, 2011, 06:32 PM
I need a desktop.
No, you need a window air conditioner, especially if you live in Arizona.

Legendary_Bibo
March 28th, 2011, 07:01 PM
Laptops aren't usually designed to be used with the lid closed, the keyboard area has it's role in letting some of the extra heat out.

Leave the lid open and your laptop should be able to run at continuous 100% load for years.

Well I already put this laptop into retirement as in I use it as a desktop and I don't disconnect it from my monitor ever so I'm thinking about removing the top part of my laptop (the screen).

dh04000
March 28th, 2011, 09:55 PM
Well I already put this laptop into retirement as in I use it as a desktop and I don't disconnect it from my monitor ever so I'm thinking about removing the top part of my laptop (the screen).

I did that with an old laptop after the screen broke. I took it apart, and put its parts, taped in place, inside of the box the laptop came in. The cords for ethernet, the dvi out, the power supply and a usb hub all coming out of holes in the box, and taped in place. The Frankenstein's monster now serves as my little brother's computer.

Legendary_Bibo
March 29th, 2011, 08:00 AM
Thank you! :D

I might actually break down and buy it now.

I'm giving a copy away in a contest right now. Check out in my blog. The link is in my sig.

Johnsie
March 29th, 2011, 12:37 PM
Don't blame Java, minecraft is buggy as...

BrokenKingpin
March 29th, 2011, 06:19 PM
I would clean your laptop out. I was having similar issues with mine, and it was just dust stopping the fans from working properly.

As for Java, I personally do not like the language, but in most cases where their are memory leaks and overly poor performance it is the way it was coded, not Java itself.

Legendary_Bibo
March 29th, 2011, 08:31 PM
I played it on my dad's desktop with maxed settings. It was wonderful, but it also had some frame dropping on occasion. My dad's desktop has a quadcore and an ATI HD Radeon 4870 512mb. Not exactly bad hardware, but games as simple as Minecraft should be running at 100FPS at all times with that hardware.

t0p
March 29th, 2011, 09:01 PM
Don't blame Java, minecraft is buggy as...

Don't blame Minecraft, Java is buggy as... :p

Cracklepop
March 29th, 2011, 09:18 PM
As for Java, I personally do not like the language, but in most cases where their are memory leaks and overly poor performance it is the way it was coded, not Java itself.

+1 to that. Very nearly always the coders fault.

Legendary_Bibo
March 29th, 2011, 10:39 PM
+1 to that. Very nearly always the coders fault.

So Java coders lack discipline eh? We should make them all spend a year doing nothing, but coding in Assembly. :P

Lightstar
March 30th, 2011, 02:28 AM
It kinda makes me laugh how resource demanding that game is when it looks like Doom from 1993

Cracklepop
March 30th, 2011, 03:30 AM
So Java coders lack discipline eh? We should make them all spend a year doing nothing, but coding in Assembly. :P

No, in all languages, including Java ;)

Judo
March 30th, 2011, 05:16 AM
It isn't necessarily Java that uses a lot of resources. Minecraft uses a voxel octree which, in theory, is better than polygons for current hardware. The trade off is in memory, though. Nvidia's analysis found it uses 3.33 times as much memory (in VRAM, at least) compared to polygons. That isn't to say that the JVM doesn't use a lot of RAM itself, but Minecraft probably accounts for most of the usage.

On a side note, Java programs shouldn't have any memory leaks. The garbage collection in the JVM should catch anything that isn't referenced and delete it. (Note the "should" in both of those sentences, nothing is perfect)

disabledaccount
March 30th, 2011, 04:37 PM
It kinda makes me laugh how resource demanding that game is when it looks like Doom from 1993+1
Stop making games in Java - not everyone have 8 cores at 3GHz to run heavy, unefficient code and runtime at reasonable speed. ( unless this is 2d brick-like game for children's phone - and it must be portable )


We should make them all spend a year doing nothing, but coding in Assembly. :razz:Every big "P" programmer should know at least one assembler / CPU architecture - just to understand how computer works.

ErikNJ
March 30th, 2011, 05:48 PM
It's the abundance of bad java developers out there that give java the bad name. The same could have been said about C++ about 10 - 15 years ago. The only thing with C++ is that bad design will barely run (or just crash sooner) but bad java design allows things to run poorly.

There are a lot of self-proclaimed "java" developers out there who have little to no understanding of algorithms and data structures. So, there are a lot of crap java programs out there. If these same people wrote in other languages, their apps would like be just as bad (or worse since Java is a bit more tolerant than other languages). Merely memorizing a bunch of syntax, packages, and methods does not make more a good developer.

In the case of Minecraft, it is beta still. How can you optimize while a project is still in the design phase? Optimization should come later.

I agree on the assembler study. I also think basic computer architecture is a must in addition to assembly study. Assembly can be used as a vehicle to understand computer architecture.

disabledaccount
March 30th, 2011, 11:55 PM
It's the abundance of bad java developers out there that give java the bad name. The same could have been said about C++ about 10 - 15 years ago. The only thing with C++ is that bad design will barely run (or just crash sooner) but bad java design allows things to run poorly.
...
In the case of Minecraft, it is beta still. How can you optimize while a project is still in the design phase? Optimization should come later.I would say that there are two main reasons why higher-level languages are less effective and producing bulky executables (excluding poor coding)
a) High level languages are more tollerant to bugs by ensuring proper initialization and often runtime verification of pointers, runtime checking for memory leaks and so on. This puts limitations on using many tricks that are well known under ASM/C/C++ and can add significant overhead to code. C can be very close to "bare metal" - nearly as ASM - but like in ASM it needs more time and more knowledge to write perfect code.
b) bindings or wrappers -> more overhead both in execution time and code size.

...
Doom3 (windows/DirectX version) has uncomparble better graphics, needs less memory and works better under WINE (DX->OGL conversion, API wrappers) than Minecraft (not to mention UT2K3, UT2K4 ). For me, it looks like developers have had very good idea - but unfortunatelly that's all - game is uggly, but even extremely simple graphics doesn't seem to help - it's slow.

Legendary_Bibo
March 31st, 2011, 01:49 AM
I have two old desktops, one with 512mb and one with 256mb. I'm planning on setting up a server for minecraft, but here's the thing I don't want it taking up a lot of room so I don't want to hook up a monitor to it, and so I want to setup a way so I can remote access it. Here's the thing I'm allowed to run Linux on the 256mb machine, but not the 512mb machine which has WinXP on it, and I can't tear out it's RAM (The freaking thing hasn't been touched in a decade). I can get a 2gb kit for the computer I'm allowed to play with though (Dell Dimension 4600), but it's like $70. I think I'll ask my brother for the money, and then pay him back. Why can't I use swap space though?

mcduck
March 31st, 2011, 05:20 AM
Why can't I use swap space though?
Because using swap doesn't improve your performance, it does exactly the opposite.

Swapping allows the computer to handle tasks it couldn't otherwise do because it doesn't have enough RAM for them, but on the other hand hard drives are roughly 1000 times slower than RAM memory is, so things are not going to happen fast when the system needs to use hard drive space as extension to RAM.

What comes to Java, I suppose I can accept people's claims that it's possible to make a good program using it, it's just that I've yet to see one. :D Every single Java application I've seen has been painfully slow. Still, I'm happy that Minecraft is made with Java, being basically one person's project it's quite unlikely it would be cross-platform game if it was coded with anything else. I rather take a god but slow game I can run on my Linux and OSX machines than greatly performing game I can't play at all ;)

Legendary_Bibo
March 31st, 2011, 05:28 AM
Is 256mb RAM good enough for a 4 player server?

Paqman
March 31st, 2011, 05:46 AM
Is 256mb RAM good enough for a 4 player server?

Some info here:

http://www.minecraftwiki.net/wiki/Server

http://www.minecraftforum.net/viewtopic.php?f=22&t=36632

Legendary_Bibo
March 31st, 2011, 10:14 PM
Some info here:

http://www.minecraftwiki.net/wiki/Server

http://www.minecraftforum.net/viewtopic.php?f=22&t=36632

Hmmm...I need to ask some of my rich friends if they're going to toss out any their 3 year old computers.

chessnerd
March 31st, 2011, 10:31 PM
Hmmm...I need to ask some of my rich friends if they're going to toss out any their 3 year old computers.

That, or you could buy one of these: http://accessories.us.dell.com/sna/products/Processors/productdetail.aspx?sku=A3336421

The Cray CX1-iWS is a workstation computer made by the same people who brought you the Jaguar Supercomputer. With 36 cores of Intel Xeon goodness, 24 GB of RAM, and 4 TB of storage, along with a 16 1 GBit ethernet switch, any Minecraft server you ran would be totally lag free! It comes with a Windows 7 workstation featuring a Xeon processor and the NVIDIA Quadro FX 5800, a 4 GB graphics card that would run Minecraft like it was Minesweeper.

Think about it... ;)

Legendary_Bibo
March 31st, 2011, 10:46 PM
That, or you could buy one of these: http://accessories.us.dell.com/sna/products/Processors/productdetail.aspx?sku=A3336421

The Cray CX1-iWS is a workstation computer made by the same people who brought you the Jaguar Supercomputer. With 36 cores of Intel Xeon goodness, 24 GB of RAM, and 4 TB of storage, along with a 16 1 GBit ethernet switch, any Minecraft server you ran would be totally lag free! It comes with a Windows 7 workstation featuring a Xeon processor and the NVIDIA Quadro FX 5800, a 4 GB graphics card that would run Minecraft like it was Minesweeper.

Think about it... ;)

I'm drooling. :D

I would so get that if I had the money, and I'd hold the Ubuntu Forums Minecraft server, and we would have our own special club while everyone else was stuck with their wimpy quad core servers.

BrokenKingpin
April 1st, 2011, 06:28 PM
On a side note, Java programs shouldn't have any memory leaks. The garbage collection in the JVM should catch anything that isn't referenced and delete it. (Note the "should" in both of those sentences, nothing is perfect)
This is incorrect. If you use any unmanaged resources such as file handles and database connections that are not shut down properly you can still get memory leaks. Just because you use a managed language doesn't mean it will never leak no matter what you do (even if the code in the CLI is perfect).

ErikNJ
April 1st, 2011, 06:48 PM
Here is an interesting article on a related topic:

http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html

In essence, it comes down to the knowledge and aptitude of the developer - not the language.

disabledaccount
April 1st, 2011, 07:38 PM
Great article - really, I'm impressed.
But still I can't agree that language level is irrevelant. If You write 100% perfect code then compilers will make differences on assembly level, not to mention languages that are running in virtualized environments.

BrokenKingpin
April 1st, 2011, 08:52 PM
Great article - really, I'm impressed.
But still I can't agree that language level is irrevelant. If You write 100% perfect code then compilers will make differences on assembly level, not to mention languages that are running in virtualized environments.
It is up to the developer to pick the best language for the job. If performance is a key point to the application you should pick the correct language for getting optimal performance (so maybe c++ over Java).

In the case of this topic, Java is efficient enough to get a game like this to run half decent, or at least better than it is.

dh04000
April 1st, 2011, 09:06 PM
I'd actually like to see more java games. JAVA + OpenGL + OpenAL + SDK = instant cross compatibility!

Draygera
June 30th, 2012, 05:59 AM
Amen, brother. Java is my first programming language and I'm loving it. I tried learning C++ awhile back, but eventually started studying Java because it was the only language I had a decent textbook over and watched as many of iTunes U classes as I could over it.

When coded properly, Java is great for games. In fact, I'd also love to see more games running with it. I'm working on my first right now. :)

wildmanne39
June 30th, 2012, 06:26 AM
Hi, thread closed because it is more then a year old, please start a new thread.
Thanks