Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3
1  Java Game APIs & Engines / Java 2D / Re: VolatileImage and BITMASK on: 2003-09-08 06:26:31
Thanks  Smiley

But anyway I've ported my lib on JOG and now I really don't have such problems...
2  Java Game APIs & Engines / JOGL Development / Re: [OGL newbie] Vertex buffers on: 2003-08-23 11:30:55
Are VBO an openGL 1.5 specific feature?
I've downloaded "openGL extension viewer" (www.realtech-vr.com) and it lists that feature under openGL 1.5.
It seems that my "Intel 82845G" doesn't support it (maybe it's acceptable) but also my GeForce4MX don't support it.

Maybe it's a driver problem, because also a test program says "unsupported extension" on both computers...

Anyway you know a site with example code?
3  Java Game APIs & Engines / JOGL Development / Re: [OGL newbie] Vertex buffers on: 2003-08-23 08:43:05
So If I want to modify structures I have to use VertexArrays but I don't gain so much (maybe nothing) in performance, right?

Otherwise If I want static structures I have to use DisplayLists gaining something in performance (especially with T&L hardware such as GeForce):
how much is this increase?

Vertex Buffers speed up things (especially with GeForce) above 50% in my tests...
4  Java Game APIs & Engines / JOGL Development / [OGL newbie] Vertex buffers on: 2003-08-23 08:01:01
Hi

I've used DX for a while and to create static 3D graphics I used VertexBuffers...
I've also used openGL but never thought about optimizations...

Now I'm using JOGL for my 2D/3D...
Since pumping vertex each frame is not always a good solution, I want to create static structures (in vram Smiley) to speed up things.

What is the equivalent of VertexBuffers?
Is it DisplayList or VertexArray?

Many thanks
5  Java Game APIs & Engines / Java 2D / Re: Java2D pipeline problem? on: 2003-08-20 09:31:58
As I thought... This is a very hot argument!

Quote

Now while i'll be the first to recommend a switch to a vector based rendering API, I really don't think you want to be using J3D, the whole thing really isn't designed for 2d graphics - even doing a HUD in J3D is a pain, especially if you want crisp edges.


Bad news...

But maybe I can divide 2D games from 2D/3D ones:
I can continue using my 2D library (pure Java2D) for 2D games that do not require rotation or transparency.
And I can write a new hybrid library using J3D ONLY to make 3D games AND mixed 2D/3D games.

For mixed 2D/3D games I mean something like G.T.A. 2, so I've no problem with the edges (or the non-pixel-exact dimension) of the sprite cause all the graphics can be scaled using filtering.

Quote

The argument about 'non-standard' librarys doesn't hold any water, especially since using J3D will need an extra download anyway.


Yeah but the probability to found J3D on a client are more (in my opinion) than to found JOGL, and J3D is related with users' library (DX or OGL) and don't force users to use OGL if they have a ULTRA-VIDEO-CARD designed for DX.


Quote

How about abstracting away your 2D layer altogether, then you can switch from rendering method to rendering method as you see fit.


Well I've already a 2D library which I've ported from DX 7, to SDL/openGL and then to Java2D.
It's rich of features that I don't want to trash... so an abstraction layer should be a good idea.

But I must hope that it will possible to revert it to Java2D the next year...
Because I'm making games to attract people on websites and if I use WebStart adios banners.

Maybe I can give a good look to your J2DA and see if I can integrate it with Pyro2D (my library), maybe I can give help to the cause as well Smiley

It's already online?

Anyway JOGL seems to be the only way out for now.

Thanks to all

PS: I've downloaded Kevglass JOGLtest but it gives this result
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
--------------------------
Target was:
GLCapabilities [DoubleBuffered: true, Stereo: false, HardwareAccelerated: true,
DepthBits: 24, StencilBits: 0, Red: 8, Green: 8, Blue: 8, Alpha: 8, Red Accum: 0
, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0 ]
--------------------------
Would have chosen:
GLCapabilities [DoubleBuffered: true, Stereo: false, HardwareAccelerated: true,
DepthBits: 24, StencilBits: 8, Red: 8, Green: 8, Blue: 8, Alpha: 8, Red Accum: 1
6, Green Accum: 16, Blue Accum: 16, Alpha Accum: 16 ]
--------------------------
Exception in thread "main" net.java.games.jogl.GLException: Error swapping buffe
rs
        at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.swapBuffers
(WindowsOnscreenGLContext.java:140)
        at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:193)
        at net.java.games.jogl.GLCanvas.reshape(GLCanvas.java:119)
        at java.awt.Component.setBounds(Component.java:1664)
        at java.awt.BorderLayout.layoutContainer(BorderLayout.java:691)
        at java.awt.Container.layout(Container.java:1020)
        at java.awt.Container.doLayout(Container.java:1010)
        at java.awt.Container.validateTree(Container.java:1092)
        at java.awt.Container.validate(Container.java:1067)
        at java.awt.Window.show(Window.java:461)

I'm using Java 1.4.2
6  Java Game APIs & Engines / Java 2D / Re: Java2D pipeline problem? on: 2003-08-20 07:21:33
Yeahh!

That was the problem!

So Java detects "too many" readings from VRAM and moves images to SysRam trying to speed up things, right?
But the result is to slow down things more than before Sad

Many thanks

[OT]
Too many problems...
If you want simple graphics Java2D it's OK, but if you try to add some cool effects all the problems comes to block you...

I think I'll give up and start to write down a 2D library upon J3D!
No more strange problems with Java2D but only *REAL* 3D acceleration...

Using openGL is surely much simpler but I DON'T WANT to use non standard libraries...

Also if rotation and alpha transparency will come with 1.5 I think I'll get ever lower FPS than a J3D implementation.
[/OT]


There's no difference in the drawings log before and after that "effect".


Following there's the Profiler log before FPS fall...



Flat profile of 4.03 secs (204 total ticks): main

 Interpreted + native   Method                        
14.2%     0  +    27    sun.awt.windows.Win32SurfaceData.initDDraw
 5.3%     0  +    10    sun.java2d.loops.MaskBlit.MaskBlit
 1.6%     3  +     0    org.apache.crimson.tree.TreeWalker.<init>
 1.1%     0  +     2    java.io.WinNTFileSystem.getBooleanAttributes
 1.1%     1  +     1    fishbros._spacetroopers.Playfield.init
 1.1%     0  +     2    sun.awt.image.BufImgSurfaceData.initRaster
 0.5%     1  +     0    java.awt.image.DirectColorModel.getRedMask
 0.5%     0  +     1    java.lang.ClassLoader.defineClass0
 0.5%     0  +     1    sun.awt.font.NativeFontWrapper.registerFonts
 0.5%     0  +     1    java.util.zip.ZipFile.open
 0.5%     1  +     0    sun.java2d.loops.SurfaceType.pixelFor
 0.5%     0  +     1    java.io.WinNTFileSystem.checkAccess
 0.5%     0  +     1    java.lang.Math.<clinit>
 0.5%     0  +     1    java.lang.Class.getDeclaredFields0
 0.5%     0  +     1    sun.awt.Win32GraphicsEnvironment.registerFontWithPlatform
 0.5%     0  +     1    sun.java2d.Disposer.addRecord
 0.5%     0  +     1    fishbros.pyro.GameEntity.<init>
 0.5%     0  +     1    java.lang.ClassLoader$NativeLibrary.load
 0.5%     0  +     1    fishbros.pyro.SpriteBank.<init>
 0.5%     0  +     1    sun.java2d.pipe.AlphaPaintPipe.startSequence
 0.5%     1  +     0    org.apache.crimson.parser.AttributesExImpl.addAttribute
 0.5%     0  +     1    java.lang.ref.Reference.<init>
 0.5%     1  +     0    fishbros.utils.XMLhandler.getElement
 0.5%     1  +     0    org.apache.crimson.tree.TreeWalker.getNextElement
 0.5%     0  +     1    sun.awt.windows.WComponentPeer.pShow
44.7%    16  +    69    Total interpreted (including elided)

    Compiled + native   Method                        
 8.4%    16  +     0    vtable chunks
 6.8%    13  +     0    org.apache.crimson.tree.ParentNode.item
 3.2%     6  +     0    org.apache.crimson.tree.NodeBase.getNextSibling
 3.2%     6  +     0    org.apache.crimson.tree.TreeWalker.getNext
 2.6%     5  +     0    org.apache.crimson.tree.ElementNode2.getNodeType
 2.6%     5  +     0    org.apache.crimson.tree.TreeWalker.getNextElement
 1.6%     3  +     0    org.apache.crimson.tree.TextNode.getNodeType
 1.6%     3  +     0    org.apache.crimson.tree.ParentNode.getFirstChild
 1.1%     1  +     1    java.util.HashMap.addEntry
 0.5%     1  +     0    java.awt.RenderingHints$Key.hashCode
 0.5%     1  +     0    java.util.Arrays.fill
 0.5%     1  +     0    java.util.Vector.addElement
 0.5%     1  +     0    org.xml.sax.helpers.AttributesImpl.getValue
 0.5%     1  +     0    java.util.Vector.elementAt
 0.5%     1  +     0    StubRoutines (1)
 0.5%     1  +     0    java.lang.String.equals
 0.5%     0  +     1    java.awt.image.Raster.createPackedRaster
 0.5%     1  +     0    org.apache.crimson.tree.AttributeSet.createAttributeSet1
 0.5%     1  +     0    java.util.HashMap.put
 0.5%     1  +     0    sun.java2d.SunGraphics2D.makeHints
 0.5%     1  +     0    java.util.Hashtable.put
 0.5%     1  +     0    sun.awt.image.IntegerComponentRaster.<init>
 0.5%     0  +     1    sun.java2d.pipe.SpanShapeRenderer.renderRect
38.4%    70  +     3    Total compiled

        Stub + native   Method                        
 4.2%     0  +     8    sun.java2d.loops.MaskBlit.MaskBlit
 2.1%     0  +     4    sun.awt.image.BufImgSurfaceData.initRaster
 0.5%     0  +     1    java.lang.System.identityHashCode
 0.5%     0  +     1    java.lang.Object.clone
 7.4%     0  +    14    Total stub

 Thread-local ticks:
 6.9%    14             Blocked (of total)
 3.7%     7             Class loader
 0.5%     1             Interpreter
 4.7%     9             Compilation
 0.5%     1             Unknown: no last frame

Flat profile of 7.96 secs (450 total ticks): Image Fetcher 0

 Interpreted + native   Method                        
54.5%     0  +     6    java.awt.MediaTracker.setDone
 9.1%     1  +     0    java.awt.ImageMediaEntry.imageUpdate
63.6%     1  +     6    Total interpreted

 Thread-local ticks:
97.6%   439             Blocked (of total)
36.4%     4             Compilation


Flat profile of 7.72 secs (440 total ticks): Image Fetcher 1

 Interpreted + native   Method                        
90.5%     0  +    57    java.awt.MediaTracker.setDone
 1.6%     0  +     1    java.lang.System.arraycopy
 1.6%     0  +     1    sun.awt.image.PixelStore32.allocateLines
 1.6%     1  +     0    sun.awt.image.PixelStore.setPixels
 1.6%     1  +     0    sun.awt.image.ImageRepresentation.setPixels
 1.6%     0  +     1    java.lang.Thread.setPriority0
98.4%     2  +    60    Total interpreted

 Thread-local ticks:
85.7%   377             Blocked (of total)
 1.6%     1             Compilation
7  Java Game APIs & Engines / Java 2D / Re: Java2D pipeline problem? on: 2003-08-19 16:29:40
The GC is OK...

Here is the Profiler Log:

----------------->>>    FPS CHANGE HERE   <<<-----------------------

----------------->>>    CLOSING APP  <<<-----------------------


Flat profile of 57.06 secs (3581 total ticks): AWT-Windows

 Interpreted + native   Method                        
99.9%     0  +  3576    sun.awt.windows.WToolkit.eventLoop
 0.0%     1  +     0    sun.awt.SunToolkit.targetToAppContext
 0.0%     0  +     1    sun.awt.windows.WToolkit.run
 0.0%     0  +     1    sun.awt.windows.WToolkit.init
99.9%     1  +  3578    Total interpreted

 Thread-local ticks:
 0.1%     2             Compilation


Flat profile of 0.08 secs (5 total ticks): Thread-1

 Interpreted + native   Method                        
80.0%     1  +     3    sun.reflect.Reflection.ensureMemberAccess
20.0%     1  +     0    java.lang.reflect.ReflectAccess.copyField
100.0%     2  +     3    Total interpreted


Flat profile of 53.78 secs (3425 total ticks): DestroyJavaVM

 Thread-local ticks:
100.0%  3425             Blocked (of total)


Flat profile of 53.79 secs (3426 total ticks): Thread-2

 Interpreted + native   Method                        
 0.3%     0  +     9    sun.awt.image.ImagingLib.transformBI
 0.1%     0  +     3    sun.java2d.loops.Blit.Blit
 0.1%     0  +     2    fishbros._spacetroopers.Alien.live
 0.1%     1  +     1    java.awt.image.PackedColorModel.<init>
 0.1%     2  +     0    sun.awt.windows.Win32OffScreenSurfaceData.validatePipe
 0.0%     1  +     0    sun.awt.image.IntegerInterleavedRaster.<init>
 0.0%     1  +     0    java.awt.image.BufferedImage.getSubimage
 0.0%     1  +     0    java.awt.Component.getBackground
 0.0%     1  +     0    java.lang.ThreadLocal$ThreadLocalMap.get
 0.0%     1  +     0    fishbros.pyro.EntityRoster.makeEmLive
 0.0%     1  +     0    fishbros._spacetroopers.Game.drawGame
 0.0%     1  +     0    fishbros.pyro.SpriteBank.drawPrimitive
 0.0%     1  +     0    java.awt.AlphaComposite.<init>
 0.0%     0  +     1    sun.java2d.SunGraphicsEnvironment.createGraphics
 0.0%     1  +     0    sun.java2d.pipe.Region.isEmpty
 0.0%     1  +     0    sun.awt.windows.Win32OffScreenSurfaceData.getRenderLoops
 0.0%     1  +     0    fishbros._spacetroopers.Player.drawShadow
 0.0%     1  +     0    sun.java2d.pipe.DrawImage.imageReady
 0.0%     1  +     0    sun.awt.image.IntegerInterleavedRaster.createCompatibleWritableRaster
 0.0%     1  +     0    java.awt.image.AffineTransformOp.<init>
 0.0%     1  +     0    sun.awt.image.IntegerInterleavedRaster.setDataElements
 0.0%     1  +     0    java.awt.geom.RectangularShape.getBounds
 0.0%     1  +     0    java.util.Vector$1.<init>
 0.0%     1  +     0    java.lang.Integer.getChars
 0.0%     0  +     1    sun.awt.windows.Win32BlitLoops.Blit
 1.7%    32  +    25    Total interpreted (including elided)

    Compiled + native   Method                        
 2.5%    85  +     0    fishbros.utils.SysTimer.waitUntilNextTick
 0.4%     5  +     9    java.awt.image.Raster.createPackedRaster
 0.3%    11  +     0    vtable chunks
 0.2%     3  +     4    java.awt.image.SinglePixelPackedSampleModel.createDataBuffer
 0.1%     5  +     0    java.util.HashMap.get
 0.1%     2  +     2    sun.java2d.SunGraphics2D.checkFontInfo
 0.1%     2  +     1    java.awt.image.SinglePixelPackedSampleModel.<init>
 0.1%     3  +     0    sun.java2d.loops.GraphicsPrimitive.tracePrimitive
 0.1%     2  +     0    java.lang.Math.abs
 0.1%     2  +     0    java.util.Hashtable.put
 0.1%     2  +     0    java.awt.image.ComponentSampleModel.getNumDataElements
 0.1%     2  +     0    fishbros.pyro.Map.drawLayer
 0.1%     2  +     0    fishbros.pyro.SpriteBank.drawPrimitive
 0.1%     2  +     0    sun.java2d.loops.Blit.getFromCache
 0.1%     2  +     0    sun.java2d.SunGraphics2D.drawImage
 0.1%     2  +     0    sun.awt.image.IntegerComponentRaster.<init>
 0.1%     1  +     1    sun.java2d.pipe.DrawImage.transformImage
 0.1%     2  +     0    sun.java2d.SunGraphicsEnvironment.createGraphics
 0.1%     1  +     1    sun.java2d.pipe.ValidatePipe.scaleImage
 0.1%     1  +     1    java.awt.image.BufferedImage.getSubimage
 0.1%     2  +     0    sun.java2d.loops.MaskBlit$TraceMaskBlit.MaskBlit
 0.0%     1  +     0    sun.java2d.SunGraphics2D.setDevClip
 0.0%     1  +     0    fishbros._spacetroopers.TopDownEntity.clipAngle
 0.0%     0  +     1    java.awt.image.DataBufferInt.<init>
 0.0%     1  +     0    java.awt.image.PackedColorModel.countBits
 5.8%   175  +    23    Total compiled (including elided)

        Stub + native   Method                        
66.6%     1  +  2275    sun.awt.windows.Win32BlitLoops.Blit
12.2%    41  +   375    sun.misc.Perf.highResCounter
 6.1%     0  +   207    sun.java2d.loops.MaskBlit.MaskBlit
 2.4%     1  +    81    sun.awt.image.ImagingLib.transformBI
 2.2%     0  +    75    sun.java2d.loops.Blit.Blit
 0.8%     0  +    29    sun.awt.image.BufImgSurfaceData.initRaster
 0.7%     0  +    24    java.lang.Object.clone
 0.1%     1  +     4    java.lang.Object.hashCode
 0.1%     1  +     3    java.lang.StrictMath.ceil
 0.1%     0  +     3    java.lang.StrictMath.floor
 0.1%     0  +     3    sun.awt.image.BufImgSurfaceData.setSurfaceData
 0.1%     1  +     1    sun.awt.image.BufImgSurfaceData.getSurfaceData
91.5%    46  +  3080    Total stub

 Runtime stub + native  Method                        
 0.7%    24  +     0    d2l_stub Runtime1 stub
 0.1%     4  +     0    interpreter_entries Runtime1 stub
 0.8%    28  +     0    Total runtime stubs

 Thread-local ticks:
 0.2%     8             Blocked (of total)
 0.1%     3             Interpreter
 0.1%     5             Compilation
 0.0%     1             Unknown: no last frame


Flat profile of 57.01 secs (3578 total ticks): AWT-EventQueue-0

 Interpreted + native   Method                        
12.5%     0  +     1    java.lang.Object.wait
12.5%     0  +     1    sun.awt.windows.Win32Renderer.doFillRect
12.5%     1  +     0    java.awt.EventQueue.noEvents
12.5%     1  +     0    java.util.LinkedList.clone
12.5%     0  +     1    sun.awt.windows.WInputMethod.disableNativeIME
62.5%     2  +     3    Total interpreted

 Thread-local ticks:
99.8%  3570             Blocked (of total)
37.5%     3             Compilation


Flat profile of 57.02 secs (3578 total ticks): Java2D Disposer

 Thread-local ticks:
100.0%  3577             Blocked (of total)
100.0%     1             Compilation


Flat profile of 57.14 secs (3586 total ticks): AWT-Shutdown

 Thread-local ticks:
100.0%  3586             Blocked (of total)


Global summary of 57.82 seconds:
100.0%  3673             Received ticks
 1.1%    39             Received GC ticks
 0.8%    28             Compilation
 0.0%     1             Other VM operations
 0.2%     7             Class loader
 0.1%     4             Interpreter
 0.1%     2             Unknown code



Excuse this very long log...  Shocked

I don't understand exactly what this output means; if someone can decrypt it...

Thanks
8  Java Game APIs & Engines / Java 2D / Re: Java2D pipeline problem? on: 2003-08-19 14:10:06

I've never used WebStart  Roll Eyes

But my development is oriented at online gaming, so there are sponsors, banners, and so I don't know if bypassing the browser is always a good idea...

Thanks for the suggestion
I'm thinking about it...
9  Java Game APIs & Engines / Java 2D / Re: Java2D pipeline problem? on: 2003-08-19 13:53:08
It seems that I'm not able to reproduce the problem...

I've created a simple demo containing rotations and alpha transparency but it runs fine also after minutes.

Maybe I'm wrong and the problem is not directly connected with alpha transparency or rotation... and in some way it is related with my scrolling...

BUT the problem doesn't exist with the previous release and it is not present if I switch off DDraw acceleration.

Sot I must think it is related with Java2D.

I've uploaded a test with graphics badly altered (sorry but I cannot show real graphics right now).
The entities shadows are transparent, rotation is filtered and HW transparency is enabled.

http://www.fish-bros.it/test.zip


If you use "Run.bat" (I hope you're using Windows!) you get accelerated version, with RunSW the unaccelerated one...

Use Arrows to move and CTRL to shoot.
After a while you run around you should notice (in the log window) a drastic fall of the framerate. That's it...

The scrolling is very bad cause I've used CopyArea instead of DrawImage, because CopyArea works fine also in software mode. But it is veeery slow because CopyArea sucks: when scrolling to the left or upward it slow down all.

I'm interested in JOGL (I've worked with OpenGL) but I'm also very interested in creating online games so no ZIP so no additional DLLs...

Maybe if it was a part of Java core...
10  Java Game APIs & Engines / Java 2D / Java2D pipeline problem? on: 2003-08-19 11:36:30
Aaarghhh!!!

Another strange problem with VM 1.4.2 ...

After a random period of time after the startup, my new game slows down form stable 60FPS to a permanent 10FPS situation...

It happens only in two cases:

1. If alpha transparency of shadows is enabled:

1  
2  
3  
g2.setComposite( java.awt.AlphaComposite.getInstance( java.awt.AlphaComposite.SRC_OVER, alphaValue) );
// DRAW SPRITES
g2.setComposite( java.awt.AlphaComposite.getInstance( java.awt.AlphaComposite.SRC_OVER, 1f) );

Doesn't matter if hardware accelerated transparency is enabled or not.


2. If I use rotations -=WITH=- interpolation active:

1  
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);



I've discovered that the problem is not related with my PC, I've tested the demo also on a P4 1.7Ghz with  GeForce2MX: The SAME result.

For SURE it the problem doesn't exist with VM 1.4.1_02 (tested five minutes ago).

Probably the drawing pipeline in some way wrecks after many "state" changes...

Maybe Abuse (who seems to work with rotations) have encountered a similar problem???

I hope the problem won't be present in the future release, otherwise I'll better turn back on my steps and
restart from ZERO with DX (I hate them!).

May Java 1.5 be with you.
11  Java Game APIs & Engines / Java 2D / Re: [INPUT] KeyListener has strange behaviour in 1 on: 2003-08-19 07:47:34
Quote
yeah, i've encountered the problem of 'stalled' Event Delivery.
I've known about it since 1.4.0, but havn't managed to work out what exactly was the cause.

It seems to only happen when I spawn my app. from within JCreator.
It also seems to only happen on Win98, and only when when running in Fullscreen using BufferStrategy.

I think its something to do with the Thread scheduler in Windows, because I can interrupt the 'stall' by opening and closing my CD drive. (which i gather sends an interrupt, which results in the Thread scheduler 'fixing' itself.)

A *very* peculiar bug.


I don't run from JCreator, simply build and run from a batch...

In standalone mode no problems, but with applets the problem is serious  Sad
With previous versions all was OK (Mozilla 1.3 and Explorer 6.0), now with exactly the same code no way to get smooth event handling...

This happens with XP...
I'll try on Win98se  to see the result.
12  Java Game APIs & Engines / Java 2D / Re: Either PSP or Java has a broken gif codec :S on: 2003-08-18 12:33:25
Very strange effect! Shocked

I've tried with PSP and you're right, probably it's a Java problem (I've always used the first color as transparent).

Probably with 256 colors Java will give different results...

I'm now using rotation in my new game using PNG images and no problem with color 0 as transparent.

I've tried using PNG images (4 bit) with 13th color as transparent, all is OK...

Maybe it's really a problem with GIF codec.
:-/
13  Java Game APIs & Engines / Java 2D / VolatileImage and BITMASK on: 2003-08-18 05:38:13
Hi

I remember that in older VM versions VolatileImages cannot have one BITMASK of transparency...

Now I don't know what is the situation, but when I create images using CreateCompatibleImage (with BITMASK) I cannot take acceleration (the drawings are slow compared with opaque VolatileImages).


Anyone can help?

Many thanks
14  Java Game APIs & Engines / Java 2D / [INPUT] KeyListener has strange behaviour in 1.4.2 on: 2003-08-16 13:01:03
Hi

As Herkules noticed in my game (Castle Trouble) some days ago, my library has problems with catching keyboard events with VM 1.4.2.

At that time I was using J2SE 1.4.1_02 and all was OK, but now (only in Applet mode) with 1.4.2 sometime key events (key pressed or released) come after a while...

This is a piece of the Input class:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
public class Input implements KeyListener,MouseListener,MouseMotionListener {
      
      ...
      
      public void keyPressed(KeyEvent e){
            changeKeyboardState(e,true);
            
            System.out.println("KEY Pressed: "+e.getKeyCode());
      }
      public void keyReleased(KeyEvent e){
            changeKeyboardState(e,false);
            System.out.println("KEY Released: "+e.getKeyCode());
      }
      public void keyTyped(KeyEvent e){
            
      }
      
      ...

}


As you can notice the same class intercepts Events from keyboard and mouse (maybe is this the problem?).

With J2SE 1.4.2 key events simply arrive late (the same time the relative string is printed out)...

Someone else have noticed this mulfunction of KeyListener Class?
15  Java Game APIs & Engines / Java 2D / Re: Accelerated transformations on: 2003-08-14 16:07:58
Quote


Yep, for more info, see the thread over in the JOGL forum.  We definitely try to accelerate complex transforms in hardware, especially when rendering images to accelerated surfaces.  It's pretty amazing having this stuff work at hardware speeds.  (Turn on bilinear filtering, and you don't even take a performance hit!)

Chris



Cool! Cheesy

This means there's a hope that we will have hardware transformation using ONLY Java2D (not other non-standard libraries) in release 1.5?

16  Java Game APIs & Engines / Java 2D / Re: Accelerated transformations on: 2003-08-14 09:40:56
Quote
Isn't java 2d being implemented on top of OpenGL in Tiger for linux and solaris? I'd have guessed that the new implementation will use accelerated transforms, I could be wrong tho..

Campbell!

Kev


I hope you're right!

I'm basing my game heavly on rotations and because I don't want a fake 2D engine made with Java3D I must use Java 2D and hope in the future!  Cheesy

Maybe Sun will use openGL in windows VM also for 2D graphics...  Huh
17  Java Game APIs & Engines / Java 2D / Accelerated transformations on: 2003-08-14 04:50:06
Hi

Anyone knows if Java2D transformations will have some sort of acceleration in J2SE 1.5?

Now they sucks...  Sad
18  Java Game APIs & Engines / Java 2D / Re: Gage Timer on: 2003-08-11 16:32:15
Quote
Well yes, you could do that. In fact that's basically what GAGETimer does internally. It's just as easy (any probably a bit cleaner) to just use another instance of the timer. All instances are working off the same timing source, but the individual instances are dealing with the naggling details for you. Smiley


Yes it's a good solution...

But you can generate Events and make entity classes receive them simply implementing a EventListener interface...
In my case tasks have a name string so it's simple to create em and receive their messages.

For example in CastleTrouble I have used many of this simultaneous tasks:

- "Hurry up!" (only in beta) after 60 secs it alters the enemies' speed.
- Intro delays and events...
- One cyclic to make a hourGlass run (only in beta)
- Delay before opening doors
and many others...

Another great pro of this method is that other "sources" can generate events, my library can generate events:

- When a sprite change a frame during an animation
- At the end of an animation (this is really useful to concatenate animations or to use animations as precalculated delays)
- At the end of a MOD or a MIDI
and so on...

So having a Task based timer is a great thing expecially if you have (or want) also an Event driven system.



19  Java Game APIs & Engines / Java 2D / Re: Erasing transparent images on: 2003-08-10 11:15:36
Cool!  Grin

Many thanks

Only a stupid formal correction...

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
Graphics2D g = (Graphics2D) img.getGraphics(); 
g.setColor(new Color(0x00000000,true));
g.setComposite(AlphaComposite.Src);
// Erase area
g.fillRect(area.x,area.y,area.width,area.height);
// Reset composite mode
g.setComposite(AlphaComposite.SrcOver);
// Draw anything...
// Dispose Graphic object
g.dispose();
20  Java Game APIs & Engines / Java 2D / Erasing transparent images on: 2003-08-10 08:54:44
Hi

I've got a transparent image:
1  
Image img=App.gc.createCompatibleImage(Game.width,Game.height,Transparency.BITMASK);


Now I past some graphics (with 1 bit transparence) at init time, and then past the image every graphic cicle to the screen (this to speed up things).

But what I've to do if I want to erase some area of that image using its TRANSPARENT COLOR?

Any color I use, makes the area opaque, when I simply want to a transparent area...
21  Java Game APIs & Engines / Java 2D / Re: Gage Timer on: 2003-08-10 08:51:55

If the problem is having more timers running...

No need to create other timers for misc events...

I'm using a simple algorithm:

1. Calculate delta millisec elapsed since the last logical frame.
2. Subtract this time slice to all "task" pending.
3. When a task expire you generate an event.
4. If the task is ciclical you may want to reset the delay for that task

Pack this concept in a Class able to handle more task at the same time and you've got a perfect timer for all your game's event

Hope it helps.
22  Games Center / Archived Projects / Re: Castle Trouble on: 2003-08-08 14:38:05
Quote

Nope, IE6.


Nooo! Cry

I've understand why on my computer it doesn't work on Opera.

The game loader is an Applet: it waits until the other Applet (the game) is loaded. Then the Game applet is attached (using add()) to the Stub of the loader Applet.

I add all the event listeners to the Game Applet. This works (on my computer as Haerkules show) on IE6, Mozilla 1.3 but not on Opera.
Otherwise if I add the listeners to the Loader App, the game works fine on Opera but not on the other browsers.

It seems also that IE6 has different behaviours!

Obviously no way to add simultaneously listeners to the Loader and Game applet...

Strange!  Shocked

I will try to fix this problem for the beta.

23  Games Center / Archived Projects / Re: Castle Trouble on: 2003-08-08 07:30:30
Quote
I'm using 1.4.2


Did you have experienced similar problems with other applet games?
24  Games Center / Archived Projects / Re: Castle Trouble on: 2003-08-08 07:29:19
Quote
I experience trouble with the controls. Just doesn't react...


Are you using Opera?
I don't know why but on Opera my lib (which works great with Netscape, Explorer e Mozilla) can't catch key events!

I'm working on it...

Thanks
25  Games Center / Archived Projects / Re: ALPHA 2 on: 2003-08-08 04:04:59
Quote

Huh Now you've got me really confused. With the DLL, GAGETimer is designed to guarantee 1000 ticks per second or better on all systems. This means that it should be a "perfect timer" on all systems. The DLL is a workaround for Windows only! When Sun gets their own hi-res timer in, we won't even need that. The timer now known as GAGETimer, is simply an abstraction to allow code to manage time effectively. The old timer and the GAGETimer are one and the same. I just added an alternate timing source.


Never mind...
Now I've understand what you said  Cheesy

So the resolution trick has been integrated in GAGEtimer as one of differents beat source right?
And one of them is based on the DLL and works only on windows.  Shocked

This means you have more sources (more than two) or just that the old timer (the one I'm using) is simply more accurate on other systems?

Quote

Hmm... I can't seem to find where logs are in Safari. On the bright side, while looking for the logs, I found out that I just need to wait long enough and the game will appear. It works, but it's slllloooooowwwwwwwww... I think this is related to the Accelerated images problem. Mac Java Gaming is DOA until Apple fixes this. (Just tested GAGE Shooter example. Sure enough, 8 frames per second.)


I don't know if the problem is related only with accelerated images...
On my computer, running in pure software mode I cannot tell the difference.

Are you having the same transparency problem of swpalmer ?

26  Games Center / Archived Projects / Re: Castle Trouble on: 2003-08-08 03:54:35
Quote
Hmmm nope, the sound is still freezing the game for a while. Maybe it's for a shorter time now, hard to tell, no big difference anyway.


Maybe there's no difference at all...
I've done only a try.

I can't explain what that lag is, but for sure it is related with JavaSound.

What VM do you have?
27  Games Center / Archived Projects / Re: ALPHA 2 on: 2003-08-07 17:32:57
Quote

I think you missed what I was saying. You can drop the DLL from existance and the timer will run just fine, albeit a little slow on windows. The worst that will happen is a nice exception printed in the Java log. The exception *is* trapped and will not impact your program in any way. Sorry you had to do all that work. Shocked


I've understand, but also if is possible to have ONLY in Windows case a -perfect- timer, I don't like to use it. This will give "perfect" results on Win, but at the same time I will remain slave of the imperfect timer on other platforms.

For the same reason I don't use yet rotations or tranparency. I'll simple wait for an accelerated implementation...
Shocked

Only a point of view  Cool

Happly things can only get better.

Quote

Umm... huh? Beats are not tied to any framerate. It simply a matter of trying to keep your animation as smooth as possible. If the timer generates 1000 beats per second, for 10fps you only want to render once every 100 milliseconds. Usually you'll sleep in any left over time.


Hmm, Ehrr...
Excuse my "out of mind" travel!  Embarrassed
I've fixed the "draw frames continuosly" problem only one week ago!
In fact now there's no more reason to use that timer trick.  Wink

Quote
Sadly, no.  Sad The loading screen comes up, the load bar fills, then the screen goes black. I'm using Safari 1.0 and OS X 10.2.


Can you give me a log of the game (taken from the console)?
Maybe I can do something.

Many thanks for your interest
28  Games Center / Archived Projects / Re: Castle Trouble on: 2003-08-07 17:18:58
Quote
Sun has added a new Timer at sun.misc.Perf with 1.4.2, but that is not the postition it will stay, it is hidden there because officially the .2 is only allowed to have bug fixes, new features only in 1.5 ...


Do you know when it will be released (I mean 1.5)?
29  Games Center / Archived Projects / Re: ALPHA 2 on: 2003-08-07 15:59:18
Quote

I should probably clarify something. The timer concept did not change when it became GAGETimer. The only thing that has changed is the addition of a hi-res timer for Windows. This was added because games require that sort of precision, not because it was a "cool idea". Using GAGETimer without the DLL will revert it back into its pre-GAGE state, but your game will not be able to time more than 20FPS on Windows 9x machines.


I've only taken the "timer idea" (explained in your first post on that topic), because I'm not really interested in native solutions.
I know that a native timer is more accurate and that it don't gives problems on different Window versions, but my library is "online oriented" and so I cannot use any DLL.

I don't understand why Sun has not yet added a real timer (like the one packaged with Java3D) to Java2D.
In teory THEY could make a native timer for every platform!  :-/

Quote
Can you explain what you mean by this? Keeping time is a hardware task and should never strain the CPU. There has been some discussion on the use of AdvancedTimer.sleepUntil() since it uses Thread.yield() for as acurate of timing as possible. It won't actually overload the CPU tho, as the call simply tells other programs to do something while we're waiting.


I was not so clear.
The problem I've tried to solve happens when a computer has an "accurate" timer and its resolution (for example 15ms) forces the game to run above 50fps.
In that case I simply wait two beats in order to make the game run at half the framerate possible.
This to prevent the game from running at 100FPS (maybe too many for some computers) when it only needs 25FPS.

Nothing special  Roll Eyes


Quote

BTW, the game looks nice. When do I get to play it on my new iBook? Wink  Grin


Doesn't it run on iBook?

30  Games Center / Archived Projects / Re: Castle Trouble on: 2003-08-07 12:41:44
Quote
java.lang.NoSuchFieldError: BLACK
     at fishbros.pyro.Loader.init(fishbros/pyro/Loader)
     at sun.applet.AppletPanel.run(AppletPanel.java:339)
     at sun.plugin.navig.motif.MotifAppletViewer.maf_run(MotifAppletViewer.java:119)
     at sun.plugin.navig.motif.MotifAppletViewer.run(MotifAppletViewer.java:115)
     at java.lang.Thread.run(Thread.java:479) Sad


I've patched it...
It should work now.

Thanks.
Pages: [1] 2 3
 

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

The first screenshot will be displayed as a thumbnail.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (20 views)
2014-09-24 16:12:06

Grunnt (46 views)
2014-09-23 14:38:19

radar3301 (28 views)
2014-09-21 23:33:17

BurntPizza (64 views)
2014-09-21 02:42:18

BurntPizza (36 views)
2014-09-21 01:30:30

moogie (42 views)
2014-09-21 00:26:15

UprightPath (52 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
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!