Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  i do not love siemens: performance problems  (Read 1143 times)
0 Members and 1 Guest are viewing this topic.
Offline Serethos

Junior Member




Java games rock!


« Posted 2005-02-23 06:38:20 »

i have started a similar thread some month ago but perhaps i can describe the problem now more detailed:

my board-like game (only some animations constantly running, no much action) runs very well on all phones except
the siemens series.

i focuse on the stronger phone C65:
- the key input reacts with big delay, sometimes not at all
- there ist constantly a silent 'beep' sound. i really dont know what it is indicating
i heard something similar on the MC60 but not permanent, only after delayed key events

what i have tried so far:
- i think i have reduced object creation and garbage collecting as much as possible
- in general im using image strips and one big background image, but i alos tried bg-tiles and single frames for animation


i would be happy to get some hints or known issues about
siemens devices!
Offline shmoove

Junior Member




Doh!


« Reply #1 - Posted 2005-02-23 10:28:41 »

Have you tried messing around with how the game loop is run?
* Using a while as opposed to looping with callSerially().
* Experimenting with different sleep times.
* Using wait instead of sleep(), or maybe just yield() for the pauses.

I can't give out any specific info on the C65, but these things often have drastic effects on performance.

shmoove
Offline Serethos

Junior Member




Java games rock!


« Reply #2 - Posted 2005-02-23 13:27:46 »

i experimented with various sleep times (setting it "on-the-fly" via buttons =) and different ways to pause the animation thread. the sleep() method worked best with my experiences.

but please explain me this suggestion:
Quote

* Using a while as opposed to looping with callSerially().


i think i have some problems understanding your idea !?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline shmoove

Junior Member




Doh!


« Reply #3 - Posted 2005-02-24 06:12:00 »

You can run a game thread the usual way:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
public void run() {
  while (running) {
    tick();
    render();
    waitForAWhile();
  }
}
void start() {
  running = true;
  Thread t = new Thread(this);
  t.start();
}

Or you can use the Display.callSerially() method to synchronize the game loop with input and output events. callSerially takes a Runnable object and places it on the event cue (together with repaint requests and key events), and then executes it's run() method. So you can also run game loop like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
Display display;
public void run() {
  tick();
  render();
  waitForAWhile();
  if (running) display.callSerially(this);
}
void start() {
  running = true;
  display.callSerially(this);
}

On some phones this gives much smoother animation (on others it doesn't make a difference, and sometimes and can work much worse).

shmoove
Offline Serethos

Junior Member




Java games rock!


« Reply #4 - Posted 2005-02-24 11:32:55 »

ah ok, i really didnt know that. now im richer in knowledge  Roll Eyes

some additional infos with my testing:
i experimented a second time with the ticktime and got a result:
if i slow down the fps to very bad 3-5 fps (throttled through a n unconditional Thread.sleep(ticktime)) i get the siemens phones to react much better on key events and to avoid this annoying beep sound.
my first thought was again that siemens has trouble painting bigger amounts of gfx data in 'short' times. but removing nearly all gfx didnt bring better results.
but i cant believe that im forced to accept such low fps even on better devices like the cx65.
Offline shmoove

Junior Member




Doh!


« Reply #5 - Posted 2005-02-24 11:54:18 »

I have a feeling that the beeping is from the key event queue getting filled up. Kinda like when my old computer was stalling with some processing and I would keep on typing without giving it a chance to react to keypresses, after a while there would be a beep for every keystroke because the input buffer was full.

It sounds that changing the threading implementation to use callSerially() might really pay off on this device since this way your game thread is synchronized with the rest of the events and it will block their thread less.

shmoove
Offline Serethos

Junior Member




Java games rock!


« Reply #6 - Posted 2005-02-24 12:07:56 »

MUAHAHAHAAHA ...
after month of testing the oddest routines, changing gfx and lots of code snippets i found the soulution.

my run method calls the two important methods, named cycle() and paint() for game logic and rendering. if i put after each call a simple Thread.yield() it runs perfectly.
sure you can assume that this is so easy that i have come to this solution much earlier, but!

i tried to replace sleep(..) with a time controled loop of only yields. i put a yield before and right after the sleep call. i raised the ticktime up to 300ms. all that has not the effect like this two stupid yields !

how can it be that a very long sleep can not replace a simple and much shorter yield !?!?!   Huh
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

atombrot (26 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (14 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (60 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!