Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Game is fast in eclipse yet slow on desktop  (Read 2065 times)
0 Members and 1 Guest are viewing this topic.
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Posted 2014-03-23 21:55:33 »

Ive been working on a little project recently and i compile the code very rarely as i just run it in eclipse to test if a feature is working. When i run the program in eclipse it runs fine however when i run it on the desktop the frame rate lag spikes every second or so. It's amazingly odd. On the subject of this i also though i would mention that when i run program's in eclipse all graphics work correctly however when on the desktop some graphics dont appear. It annoys the hell out of me Cheesy

I love making games...
Offline BurntPizza
« Reply #1 - Posted 2014-03-23 22:02:29 »

Could be that the issues are related: can't find resources because of incorrect project setup --> constant errors/stacktraces --> lag
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Reply #2 - Posted 2014-03-23 22:09:05 »

Could be that the issues are related: can't find resources because of incorrect project setup --> constant errors/stacktraces --> lag

How do you set up a project correctly and how come errors and stack traces dont show up in eclipse, or how do you know what the errors are related to

I love making games...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Drenius
« Reply #3 - Posted 2014-03-23 22:11:50 »

Make sure everything that is accessible in Eclipse is also accessible everywhere else.
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Reply #4 - Posted 2014-03-23 22:27:33 »

Make sure everything that is accessible in Eclipse is also accessible everywhere else.

From what i know they are, there are just two graphics that dont work yet there in the same location as everything else where there are other graphics that work, one other question when you compile a project which of the three settings do you select, i cant remember what they are i think its like, package required libraries, package all library's and something else

I love making games...
Offline BurntPizza
« Reply #5 - Posted 2014-03-23 22:44:14 »

How do you set up a project correctly and how come errors and stack traces dont show up in eclipse, or how do you know what the errors are related to

The errors don't show up in eclipse because the project setup is ok for eclipse due to classpath, etc. But when exported the environment changes, so it may not work. Just my hunch, as it happens a lot, and is quite an easy mistake to make IMO.

Run your program from the command line to see if there are any errors.

1  
java -jar YourProgram.jar
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Reply #6 - Posted 2014-03-23 22:51:02 »

Do i just put that command into windows command prompt

I love making games...
Offline Slyth2727
« Reply #7 - Posted 2014-03-23 23:10:17 »

If you're in Windows, then yes. You asking this kind of scares me, but it's fine. I really do suggest getting comfortable with whatever shell you're OS uses, it's incredibly handy. Also, definitely learn more about the java commands.

Was I before Chuang Tzu who dreamt about being a butterfly, or am I now a butterfly who dreams about being Chuang Tzu?
Offline BurntPizza
« Reply #8 - Posted 2014-03-23 23:12:38 »

What scares me is that he takes the 30 seconds to go and ask when it would take 5 to just go and try it.

Be proactive, be a problem solver.
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Reply #9 - Posted 2014-03-23 23:21:01 »

I would but im on my iPhone...

I love making games...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #10 - Posted 2014-03-23 23:42:36 »

Google? Common sense?

Anyway, let's stop bashing the OP (after I just did Tongue )

Offline Hermasetas

Senior Member


Medals: 6
Projects: 2
Exp: 3 years


I do gamez, yes!


« Reply #11 - Posted 2014-03-24 04:40:36 »

Last week I was working with sound in OpenAL, and I just used a FileInputStream to load the sound files.
And it worked fine in Eclipse but on desktop it didn't...

Turned out I needed to use a BufferedInputStream instead to get it to work on desktop..

My point is that sometimes you run into some pretty weird bugs when going from Eclipse to runnable jar Tongue
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Reply #12 - Posted 2014-03-24 07:13:42 »

Google? Common sense?

Anyway, let's stop bashing the OP (after I just did Tongue )

Common sense, are you an idiot? The chance that wen u go up to someone in the street and ask them how to run a java application through command line the chance of them getting it right is very very slim

I love making games...
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #13 - Posted 2014-03-24 07:27:52 »

"Java experience: 4 years"
Offline ctomni231

JGO Wizard


Medals: 98
Projects: 1
Exp: 7 years


Not a glitch. Just have a lil' pixelexia...


« Reply #14 - Posted 2014-03-24 08:11:05 »

Ugh, that Java experience counter is useless...

To be honest, I did encounter a similar problem with my 4k games. It can be related to the timer used. If you don't use the nanosecond timer, the accuracy of the frame rate widely varies from computer to computer. What is more interesting is my games suffered a major slowdown after not running in Eclipse.

If it is the library access, and the fact that Eclipse can access a Java build that your PC can't. That is possible. But, I can say for a fact that you aren't imaging it. I've pretty much given my only solution I've come up with. For me, I've just gotten used to the fact that the Java implementations vary and code defensively in Eclipse from there.

Hopefully, that gives a bit more insight on the issue. At least I know it isn't just me who realizes it.  Grin

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 743
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #15 - Posted 2014-03-24 08:32:18 »

Ugh, that Java experience counter is useless...
It's as useful as the honesty of the person filling out the form. The risk of lying is that you look like an idiot Smiley

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline princec

JGO Kernel


Medals: 342
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #16 - Posted 2014-03-24 10:25:46 »

Or worse, telling the truth, and saying something idiotic anyway  Roll Eyes I'm good at that.

Cas Smiley

Offline Gibbo3771
« Reply #17 - Posted 2014-03-24 10:27:34 »

Ugh, that Java experience counter is useless...
It's as useful as the honesty of the person filling out the form. The risk of lying is that you look like an idiot Smiley

Yah you see it often, "Experience 4 years".

Doesn't know how to use or even create arrays.

@OP, reduce any I/O operations if you are relying on them. As in load everything in once, such as sounds and textures that are used.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #18 - Posted 2014-03-24 11:59:04 »

@OP I meant common sense as in you know, you supposedly have 4 years programming knowledge. You should've figured out by now what the command line is. But whatever, I'm just an idiot for thinking that.

Offline Gibbo3771
« Reply #19 - Posted 2014-03-24 12:05:44 »

I'm just an idiot for thinking that.


"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #20 - Posted 2014-03-24 12:49:46 »

*sigh* What did I do now to deserve that picture? Please explain.

Offline princec

JGO Kernel


Medals: 342
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #21 - Posted 2014-03-24 13:01:03 »

Well, you are being grumpy and narky. Have a lie down. Maybe some coffee will fix it.

Cas Smiley

Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #22 - Posted 2014-03-24 13:04:58 »

I'm being pissy because I woke up to someone calling me an idiot Pointing

Offline princec

JGO Kernel


Medals: 342
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #23 - Posted 2014-03-24 13:08:45 »

The best way to deal with someone calling you an idiot is to show them how incredibly clever you are by way of counterattack  Kiss

Cas Smiley

Offline nsigma
« Reply #24 - Posted 2014-03-24 13:17:24 »

The best way to deal with someone calling you an idiot is to show them how incredibly clever you are by way of counterattack  Kiss

vs Mark Twain

Quote
It is better to keep your mouth closed and let people think you are a fool than to open it and remove all doubt.

 Grin

@opiop65 I read the "idiot" comment as not meant seriously.  At least I hope so, with his username and avatar!  persecutioncomplex

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline Gibbo3771
« Reply #25 - Posted 2014-03-24 13:19:04 »

*sigh* What did I do now to deserve that picture? Please explain.

I was building on your statement with my views with the help of a meme.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #26 - Posted 2014-03-24 16:41:41 »

Oh sorry everyone, I was grumpy this morning! Agreed, being silent is the best way to deal with others when they are trying to offend you with petty insults! Smiley

Offline princec

JGO Kernel


Medals: 342
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #27 - Posted 2014-03-24 17:15:06 »

I like to blow raspberries at them.

Cas Smiley

Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Reply #28 - Posted 2014-03-24 22:17:50 »

Ugh, that Java experience counter is useless...

To be honest, I did encounter a similar problem with my 4k games. It can be related to the timer used. If you don't use the nanosecond timer, the accuracy of the frame rate widely varies from computer to computer. What is more interesting is my games suffered a major slowdown after not running in Eclipse.

If it is the library access, and the fact that Eclipse can access a Java build that your PC c
an't. That is possible. But, I can say for a fact that you aren't imaging it. I've pretty much given my only solution I've come up with. For me, I've just gotten used to the fact that the Java implementations vary and code defensively in Eclipse from there.

Hopefully, that gives a bit more insight on the issue. At least I know it isn't just me who realizes it.  Grin

Thankyou for actually helping unlike a lot of people who posted on here. Im currently using the util timer whats the best method for getting stable dos no matter what the system is, fast or slow?

I love making games...
Offline BurntPizza
« Reply #29 - Posted 2014-03-25 00:58:38 »

Im currently using the util timer whats the best method for getting stable dos no matter what the system is, fast or slow?

System.nanoTime() is the standard. You'll have to code your own sleep() handling, but it's really not hard, and is totally worth being familiar with. Check out the gameloop tutorial: http://www.java-gaming.org/topics/game-loops/24220/view.html
You can find more by using the search bar: "game loop"

Also another really good one is Gaffer on Games: Fix your Timestep!
Pages: [1] 2
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (26 views)
2014-07-24 01:59:36

Riven (25 views)
2014-07-23 21:16:32

Riven (20 views)
2014-07-23 21:07:15

Riven (22 views)
2014-07-23 20:56:16

ctomni231 (51 views)
2014-07-18 06:55:21

Zero Volt (46 views)
2014-07-17 23:47:54

danieldean (37 views)
2014-07-17 23:41:23

MustardPeter (40 views)
2014-07-16 23:30:00

Cero (57 views)
2014-07-16 00:42:17

Riven (55 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!