Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Going as low as possible without JNI  (Read 1826 times)
0 Members and 2 Guests are viewing this topic.
Offline Captain-Goatse

Full Member
**

Posts: 231


I suck at teh 2D. XBOX IS BIG LOL!111


« on: 2002-12-29 01:36:11 »

I'm attempting to build my own little library for my physics engine/game where I'm trying to do everything from as low as possible.

I have couple of performance questions:

Is it true that Canvas3D negates all the bonuses achieved from Fullscreenmode since it is heavyweight?

Is there any way to disable the innate AWTEvent processing and implement your own on top of it? The way I see this, it would give a nice speed boost to customize the code work with the rendering engine and FPS update interval.

What internat threads can be accessed by the program? It would help a lot if I could implement one of those internal threads to do the input monitoring and perhaps the game physics(collision detection). This would leave the main game thread totally free of unneccescities.

Does anyone have any tips and tricks what to do to get the optimal performance by tweaking the innate processes without JNI?
Offline Herkules

JGO Kernel
*****

Posts: 1522
Medals: 1


Friendly fire isn't friendly!


« Reply #1 on: 2002-12-29 06:17:56 »

Quote

Is it true that Canvas3D negates all the bonuses achieved from Fullscreenmode since it is heavyweight?


No.

Quote

Is there any way to disable the innate AWTEvent processing and implement your own on top of it? The way I see this, it would give a nice speed boost to customize the code work with the rendering engine and FPS update interval.


Just don't produce events. Then the event thread just sleeps. I've never heard that the event thread itself produced any noticable load.


Quote

What internat threads can be accessed by the program? It would help a lot if I could implement one of those internal threads to do the input monitoring


It already does. That's the event thread.

Quote

and perhaps the game physics(collision detection). This would leave the main game thread totally free of unneccescities.


Physics in the input processing thread? Normally physics runs as an integral part of the gameloop and does not count under 'unneccescities'.

Quote

Does anyone have any tips and tricks what to do to get the optimal performance by tweaking the innate processes without JNI?


Just use them, they are fine.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline Captain-Goatse

Full Member
**

Posts: 231


I suck at teh 2D. XBOX IS BIG LOL!111


« Reply #2 on: 2002-12-29 12:50:11 »

They are fine, arguably.

Can someone tell me why not to use AWTEventListener and eventDispatched, on suns site it says that it is kind of slow and should not be used, why is this so? I would have only two three kinds of events to dispatch, those from mouse and those from keyboard.

What does the java3d behaviour use to get the events?
Games published by our own members! Go get 'em!
Offline markuskidd

Full Member
**

Posts: 151
Medals: 1



« Reply #3 on: 2002-12-29 16:10:06 »

Do you have a link to where Sun's talking about the event thread?
Offline Captain-Goatse

Full Member
**

Posts: 231


I suck at teh 2D. XBOX IS BIG LOL!111


« Reply #4 on: 2002-12-29 23:18:32 »

Sun is talking about the AWTEventListener:

http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/awt.html

If you mean if I got the link where the event thread is explained then no.
Offline markuskidd

Full Member
**

Posts: 151
Medals: 1



« Reply #5 on: 2002-12-30 11:16:12 »

Quote

Note:
It is advised to not use AWTEventListener in a shipping product as it will degrade system performance


This is pretty distressing. And, of course, pretty vague.
Offline Pyros

JGO n00b
*

Posts: 38


Let's make Java games rock !


« Reply #6 on: 2002-12-30 11:20:40 »

Quote
This is pretty distressing. And, of course, pretty vague.


Quite so. Apparently it is best to experiment for best performance.
Offline Captain-Goatse

Full Member
**

Posts: 231


I suck at teh 2D. XBOX IS BIG LOL!111


« Reply #7 on: 2002-12-31 08:00:49 »

YES! eventDispatched is faster if you have only few listeners launching elements, such as mouse and keyboard, but with many, there is no speed difference, in fact it is slower.

I'm not totally through with the experiments yet, but this seems to be the case. At least on my computer.

I used java 3d timer to get count the time spend in each event.

I'll post here when done.
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.094 seconds with 19 queries.