Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (843)
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]
1  Game Development / Shared Code / Re: PureSwing on: 2009-12-12 03:21:00
any plans for date of next release ?  Roll Eyes i'm not in a hurry, just for wonder..
2  Games Center / Archived Projects / Re: Pathfinder on: 2009-12-04 00:12:13
I really, really appreciate you sharing that.
np, it's a just a demo Grin

Your Javascript page showed the path found in 74 MS on a comparable map with 30 rows x 50 cols.
interesting, it obviously depends on browser and computer itself. on my old laptop, (ubuntu + firefox)  it's around 10-15 MS.

12 MS not bad, but i still think it can be better Wink

this is a java application running same demo. run it a few times to give JVM a chance to warm up. it runs 0-3 MS on my machine. the jar also contains the source code except AStar itself, which is JKilavuz's generic AStar implementation

r a f t
3  Games Center / Archived Projects / Re: Pathfinder on: 2009-12-02 08:57:12
3 milliseconds is good but it could be better. on such a tiny grid, the result should be almost instantaneous.

have a look at this pathfinder. it's in JavaScript but does almast equally well in small portions of grid. in chrome it runs even faster. chrome's JS engine perform really good btw..
4  Game Development / Shared Code / Re: Multiplayer Game on: 2009-11-30 16:22:19
jPCT's advanced example feud. simple multi player FPS
5  Game Development / Shared Code / Re: PureSwing on: 2009-11-30 04:53:08
I've tried porting Karga to PureSwing (with default Desktop). Most went quite smootly Smiley

below are some issues i've faced (some important some not)
* ImageIcon(url) waits indefinetely if given url is an animated gif
* JDesktopPane does not correctly stack (render and dispatch mouse events) components
* JLabel doesn't support multilines (separated with \n) 
* JFrame.pack() does not take window decorations (title bar, borders) into account
* JFrame.setDefaultCloseOperation(CloseOperation.EXIT_ON_CLOSE) does not work
* switching to another window and coming back results in losing keyboard focus. we even can not regain it by clicking
* pressing Tab does not iterate over focusable components

and some opinions:
* re-adding JOptionPane.showInternalXXDialog makes sense to show the dialogs embedded in same window
* re-adding basic HTML support can make sense (JEditorPane, JTextPane, html in JLabel) they are very handy to create multi color/line/format texts.   

and below is a test case:
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Rectangle;

import cz.advel.pureswing.CloseOperation;
import cz.advel.pureswing.EventQueue;
import cz.advel.pureswing.JDesktopPane;
import cz.advel.pureswing.JFrame;
import cz.advel.pureswing.JPanel;
import cz.advel.pureswing.JTextField;
import cz.advel.pureswing.event.MouseAdapter;
import cz.advel.pureswing.event.MouseEvent;

public class MultiLayer {
    public static final Integer BACKGROUND_LAYER = new Integer(10);
    public static final Integer HELPERS_LAYER = new Integer(30);
   public static void main(String[] args) {
      JDesktopPane desktop = new JDesktopPane();
      desktop.setPreferredSize(new Dimension(800, 600));
      JPanel backgroundPanel = new JPanel();
      desktop.add(backgroundPanel, BACKGROUND_LAYER);
      // this should be centered in frame but is not
      backgroundPanel.setBounds(new Rectangle(50, 50, 700, 500));
      backgroundPanel.addMouseListener(new MouseAdapter() {
         public void mouseClicked(MouseEvent event) {
            System.out.println("mouse clicked on background");
      // this text field should be rendered on top of background but is not
      JTextField textField = new JTextField();
      desktop.add(textField, HELPERS_LAYER);
      textField.setBounds(0, 50, 200, 20);
      textField.addMouseListener(new MouseAdapter() {
         public void mouseClicked(MouseEvent event) {
            System.out.println("mouse clicked on textField");
      JFrame frame = new JFrame("PureSwing - test");

hope this helps,
r a f t
6  Game Development / Shared Code / Re: PureSwing on: 2009-11-27 15:50:55
great. i can't wait it Smiley
7  Game Development / Shared Code / Re: PureSwing on: 2009-11-27 14:27:41
i see. thanks.

I'll look into it for next release.

any plans when to do it ?
8  Game Development / Shared Code / Re: PureSwing on: 2009-11-27 04:53:19
this is a great and very promising project, the one i'm looking for quite a while Smiley

i have a 3d virtual world application with a complicated Swing GUI rendered with jPCT's software renderer. i had been looking for ways to port it to OpenGL. now it seems i've found the solution Cheesy

however i'm having difficulty running Modern3D demo. below is the exception. any ideas why this happens ? this is a ubuntu 8.04 on a toshiba sattelite laptop with an onboard intel chipset. i got the same exception at Win XP on a similar toshiba laptop.

SlickDemo runs ok although layout is a bit garbaged (texts does not fit into components)

i've also posted the problem to LWJGL forum

Exception in thread "main" java.lang.IllegalStateException: Function is not supported
   at org.lwjgl.BufferChecks.checkFunctionAddress(
   at org.lwjgl.opengl.EXTFramebufferObject.glBindFramebufferEXT(
   at cz.advel.modern3d.opengl.LWJGLContext.flush(
   at cz.advel.modern3d.opengl.LWJGLContext.<init>(
   at cz.advel.pureswing.test.Modern3DDemo.main(
9  Game Development / Artificial Intelligence / Re: Multiple pathfinders and memory usage on: 2008-03-21 17:35:45
cant you try the solution I told about there ?

I mean using a temporal dimension ? as if you were using a 3D array rather than a 2d Array with third dimendion representing turn/time, one unit can only be in one 2d pos for a given 3d/temporal index this way you do not have to make parrallel path search. but just a 3 dimension path finder once an unit find a path, this path is stamped as occupied than you find for unit two, than unit three, etc...

you are talking about cooperative pathfinding. but as described in that paper, if you only add a 3rd dimension as time to your search space and use same heuristic as before, you will run into performance issues (possibly not noticable for small maps) you need some other heuristic like that true distance heuristic feeded by reverse A* search. in that case I argue that it's simple to implement
10  Game Development / Artificial Intelligence / Re: Multiple pathfinders and memory usage on: 2008-03-21 16:09:51
it has been months since you posted this, but here is my 2 cents.. 

- However, it is only possible to execute one pathfinding operation at a time on the same set of nodes. This is because I use the nodes, define values in them, like if the node is "visited", the "parent" node, and the costs (estimated and totalfromstart).
i do the same in my A* implementation too. that's a good thing for performance IMHO.

How can I have more than 1 pathfinding thread searching in the same set of data (nodes) at the same time without duplicating all the nodes for each pathfinder?
my short answer is dont Wink why do you need spreading pathfinding amoung multiple threads ? more threads wont give you any more cpu time. they're mostly useful to parallelize blocking operations like i/o. it's true you can benefit from dual-core cpu's by spawning a thread for pathfinding but even in that case one pathfinding thread will be enough. just queue the pathfind requests in that thread

but, if you really really want to spawn a thread for each pathfind request, you need to decouple A* information from your nodes: that is, move f, g, h and parent fields from node to another class (say NodeAData) and some how lookup for them. if each of your nodes has a unique id, you may put them into a HashMap or so (and face the lookup performance issues Wink). or assigning an id to each pathfind request, and allow your nodes to hold more than one NodeAData maybe another option. this will reduce the lookup time, but you will need to clean them later

hope this helps,
r a f t
11  Game Development / Artificial Intelligence / Re: jKılavuz - a guide in the polygon soup on: 2007-10-01 22:31:31
I'm really impressed with the API you got there, and it seems you target it at the professionals on your website with those licenses.
thank you Riven, i'm glad you liked it  Grin and yes i aim for professionals although jKilavuz has a limited freeware option

Get rid of that - not only the text, just fix it. If you're pointing out the downsides to potential customers that might just be about to spend that $1000, you're really are making it hard for yourself.
you may have point here. indeed there is nothing to fix. most possibly such a version break will never occur, i have serial version id's set , in case of a data structure change a conversion is almost always possible etc. what i was trying to say was like a disclaimer. there is a minimal chance that this may happen, but if it happens dont blame me then.. just like the statement in almost all licenses: we dont accept any responsibility if you get harmed by this product

12  Game Development / Artificial Intelligence / Re: jKılavuz - a guide in the polygon soup on: 2007-10-01 18:19:52
here is an interesting A* application: nowadays a puzzle is traveling with email: take a car out of a maze where turn directions at corners are restricted and predefined. below is an image of the puzzle:

a copy of the original interactive power point version of car puzzle can be found here

and this is an A* based solution of puzzle based on jKilavuz's generic A* implementation  Wink it's a demonstration of how A* can be used for different search problems

r a f t
13  Game Development / Artificial Intelligence / Re: Pathfinding in buildings on: 2007-10-01 18:12:58
You dont need better pathfinding, you need a better search space.

exactly agree. indeed that's what jKilavuz aims for. it's designed with the purpose of collecting pathfind data from arbitrary geometry. from it's tutorial:

There are numerous good algorithms for determining a path given a connectivity graph. The actual problem is creating a connectivity graph which correctly represents the enviroment. For simple 2D games the connectivity graph was a side affect of the tiling system used to create the map. For 3D games, especially those constructed from arbitrary geometry, no such simple solution exists. jKılavuz is meant to solve this problem.

r a f t
14  Game Development / Artificial Intelligence / jKılavuz - a guide in the polygon soup on: 2007-06-13 14:47:05

I'm proud to announce the first public release of jKılavuz: the first and only available path engine for Java.

jKılavuz consists of an extensible set of tools for collecting pathfind data and finding and executing paths. Despite the complexness of subject it is designed for ease of use.

jKılavuz is written in Java 5 and is pure Java.

jKılavuz can work on almost arbitrary geometry. To collect pathfind data, it flood fills over surface starting from a set of points on ground. This way a kind of 2d grid in 3d space is created which can take us up or down slopes, across bridges and over and under overpasses. The process also takes care of jumping over obstacles and gaps. The default implementation uses jPCT's collision detection system but a custom implementation may be plugged. Later this massive information is collapsed into sectors and portals which are then converted into a very compact form to use in runtime. All the process is automized although users can intervene. Custom portals can be defined for elevators, teleporters etc.

Pathfinding is performed among sectors and hence can be considered as a hierarchical approach. This makes it quite fast and efficient even for very large maps.

jKılavuz provides the necessary methods to actually execute the found path. It provides a clean and uniform interface to iterate over paths over time. The iterator is suitable for both fixed and delta time approach. Paths can be merged and customized in certain ways. Users can still create their own executable paths by using Lego like path segments.

More can be found on

Here is a web start demo where jKilavuz is applied to a Quake level.

Move the camera around and click anywhere on the map. If the clicked point is reachable, markers will be placed on the corners of the path and the avatar will follow them. Press F to follow avatar and return back to free camera mode again. Although very unlikely if avatar stucks press R to reset to starting position. Use arrow keys, A, Z, S, X to move the camera around, Control to strafe, V to visualize path finding sectors.

Here is a shot from demo. Top view with sectors visualized

And this is how our grid looks like. Notice how the found path goes upstairs passing over itself. You can see the cells (the small circles), transitions between cells and sectors and portals here

r a f t
15  Discussions / Community & Volunteer Projects / Re: aptal karga / 3d chat on: 2006-05-01 21:40:08
well, karga is still a work in progress project but close enough to end of first phase Wink

the new girl avatar

the new boy avatar

girl and boy kissing in test tool

r a f t
16  Discussions / Community & Volunteer Projects / Re: aptal karga / 3d chat on: 2005-08-10 07:05:43

i'm re-organizing terrain structure, including:

* an xml based terrain configuration as usual
* allowing max instance and reference clones (via max script) to decrease memory usage
* a simple LoD (level of detail) implementation
* switching between nodes is more like games now, simply walk to door
* changed to way balloons pop up

i used a transition area for LoD to minimize pop effect. i.e. only after the transition area is passed the object is replaced with a different mesh

following diagram demonstrates the transition area in LoD system (1, 2 are different LoD levels and the arrows indicates movement direction)

---- LoD (1) --->| (1) |---- (2) -->
<--- LoD (1) ----| (2) |<--- (2) ---

below image shows an extreme sample demonstrating LoD running. that is a huge map (1km x 1km in human scale) consists of 10x10 tiles each has 1000 polygons. that maps loads in a couple of minutes on my box and doesnt fit into a 256mb jvm. but runs fast enough

the new look of avatar panel. those transparent panels are addictive on me with no doubt Tongue

r a f t
17  Java Game APIs & Engines / Java 2D / Re: BufferStrategy and Swing Components on: 2005-08-01 19:34:10
BTW.: Is it possible to have completly transparent components (swing/lightweight) without the anoying lightgrey background?
you must put something behind that transparent component or what will it show ?
or if you mean, you want to see your desktop through that transparent components, you can manually (i dont know how or if possible ?) grap the desktop image that lies behind your frame and put it behind your components

r a f t
18  Java Game APIs & Engines / Java 2D / Re: BufferStrategy and Swing Components on: 2005-08-01 19:27:15
II'm working on a basic JFrame extension that uses active rendering via BufferStrategy. I have overridden the RepaintManager with a null version and setIgnoreRepaint(true) for all Swing components. Rather than painting directly on the JFrame, I want to paint onto a JPanel that I am placing inside the frame, so that I can take advantage of the LayoutManagers. I've got the basic framework up and running, but the performance seems awful. I've placed a JPanel inside the frame, and a JLabel inside the panel that I am displaying the fps on. When the window is maximized (1280x1024), the fastest framerate I get is around 140. This seems ridiculous for such a simple setup, since I can play Quake3 at over 200fps on this machine (yes, I know Q3 uses OpenGL, but still..).

The two factors that seem to change performance the most are...
1. The number of buffers in the BufferStrategy. Basicly, the more buffers I use, the slower the framerate. double buffering gives 140fps, while single buffering gives 170fps. Triple buffering runs at 105fps.

2. Use of getLayeredPane().paintComponents(g) vs paintComponents(g). Using the layeredPane's paintComponent method is about 30fps faster than using the JFrame paintComponent method, but it causes the layout to be shifted up and to the left, which defeats the entire purpose of the layout managers.

Any suggestions would be greatly appreciated. 

seems as BufferStrategy is aimed to be used with awt (native-heavy weight) components. for instance there seems to be no way to get a BufferStrategy for a JPanel. you can get one for a JFrame but besides it is a swing component, it has a native peer too

i'm doing something similar to yours with layout managers but i dont use a BufferStrategy. i simply depend on swing's paint routines in 'regular way'

using a BufferStategy and then blitting other components on top of it seems as a good idea. but be prepared for 'weird symptoms' especially when your gui gets complicated since you are hacking swing in some way and seems as swing doesnt like it ;-)

for your shifted layout, make sure you make that paintComponent call in awt-thread. this maybe makes no sense at first glance but i've seen many strange things that are fixed by simply making the call in awt-thread

you may also want to have a look at the topic

good luck
r a f t
19  Java Game APIs & Engines / Java 2D / Re: active rendering and swing on: 2005-07-26 01:00:31
If you're using 1.4 or later, the BufferStratergy class lets you have manual control over a Canvas or Window's display surface, including when it gets swapped to screen. Easiest way to do active rendering.
i use java5. i cant use Canvas since i use other swing components over my graphics component. if you mix awt and swing components in a JLayeredPane, awt components simply hide swing ones independent of their layers (heavy vs light-weigt)

similarly i cant use BufferStrategy since there seems no way (or i couldnt find yet) to get a BufferStrategy for a swing component, except top level containers. i dont want to draw to JFrame's surface but to a JPanel's as i need layering described above

r a f t
20  Java Game APIs & Engines / Java 2D / Re: active rendering and swing on: 2005-07-26 00:51:37
In order to do active rendering u must get Graphics of desired component with getGraphics() method. I used to do this only with frames, but panels can do fine i think.
Then u use normal drawing procs and it will apear on the screan instantly(actively rendered).
Note that u should do double buffering.
sorry for late answer. some how forum engine didnt notify me Huh

if you do rendering over what getGraphics() return, then you loose swing layout features. compile and run the following sample. the JLabel over the custom graphics component always remains there, without flicker. then run it the other way with getGraphics, JLabel will dissapper or flicker

note this is a basic sample so calling paintImmediately either in AWT-Thread or not does not matter that much. in a more complicated gui, swing simply gets out of sync. that part shows up here etc

import java.awt.*;
import javax.swing.*;

public class Active extends JPanel {
    public void run() {
        while (true) {
            //render(getGraphics()); // --- > uncomment this
            paintImmediately(getBounds()); // --> comment this
            try {
            } catch (Exception e) {}
    protected void paintComponent(Graphics g) {
    int textPosition = 0;
    void render(Graphics g) {
        Dimension size = getSize();
        g.fillRect(0, 0, size.width, size.height);
        textPosition += 3;
        textPosition = (textPosition > size.width) ? 0 : textPosition;
        g.drawString("moving string", textPosition, textPosition);
    public static void main(String[] args) throws Exception {
        JFrame frame = new JFrame("active rendering test");
        JLayeredPane layeredPanel = new JLayeredPane();

        Active active = new Active();
        layeredPanel.add(active, JLayeredPane.DEFAULT_LAYER);
        active.setBounds(0, 0, 400, 400);
        JLabel label = new JLabel("a long long label");
        layeredPanel.add(label, JLayeredPane.DRAG_LAYER); // above active
        label.setBounds(0, 0, 200, 40);
        layeredPanel.setPreferredSize(new Dimension(400, 400));

r a f t
have a look at my application at you will see a deep hierarchy of semi-transparent components (even a JLayeredPane in a JLayeredPane) where all depend on swing layout managers

edit: updated the link
21  Java Game APIs & Engines / Java 2D / active rendering and swing on: 2005-07-23 17:39:35

what is the correct way of active rendering in swing ? such an animation loop doesnt cause the component (a custom JPanel) to be repainted immediately ?
while(running) {
    // game and render stuff here
    component.repaint(); // this wont make the component to be painted immediately, but later

repaint(0) wont help either since loop will continue running and repaint(0) requests will coalesce

if component.repaint() is replaced with

this also fails since animation loop doesnt run in AWT-Thread's context. If we run these in AWT-Thread then we block the AWT-Thread and cause AWT and Swing events not to be dispatched. i looked for a method to dispatch all waiting AWT events and return but couldnt find.

well, infact running this loop in another thread will succesfully and actively draw the component but that way we lack swing layout features. to be precise, i use the component at bottom of a JLayeredPane and there are other components on top of that. since we call component.paintImmediately() in another thread swing gets out of sync and those other components disappear or flicker

the only solution i can think of is to use:
SwingUtilities.invokeAndWait(new Runnable() {
    public void run() {

instead of component.repaint(). but this is error-prone and one can easily fall into deadlock trap (as i did Roll Eyes), and worse enough it is too expensive because of context switching

so what is the solution ?

r a f t
22  Discussions / Community & Volunteer Projects / Re: aptal karga / 3d chat on: 2005-07-23 16:58:48
hi there,

it has been a long time since my last post and i did a lot in that time. now there is texture based dressing, mesh based accesories, 2d talking balloons, sky box, registration and more in karga. and i'm still looking for sponsors and 3d artists..

r a f t
23  Discussions / Community & Volunteer Projects / Re: aptal karga / 3d chat on: 2005-04-29 14:52:28
i've added a node switching mechanism and third person view. well not that smooth but will do the job for a start

a scene from karga:

to see it running (requires java5):

r a f t
24  Discussions / Community & Volunteer Projects / aptal karga / 3d chat on: 2005-04-25 15:56:41
hi there,

i am developing a 3d chat system where users will move around, see each other, change their appearance and hopefully dance, kiss etc each other at later phases

one may find an early prototype at

i am developing it on my own and seeking sponsors and/or modellers/animators. if interested, you may always contact me at my site

r a f t
Pages: [1]
EgonOlsen (42 views)
2018-06-10 19:43:48

EgonOlsen (22 views)
2018-06-10 19:43:44

EgonOlsen (43 views)
2018-06-10 19:43:20

DesertCoockie (197 views)
2018-05-13 18:23:11

nelsongames (124 views)
2018-04-24 18:15:36

nelsongames (123 views)
2018-04-24 18:14:32

ivj94 (863 views)
2018-03-24 14:47:39

ivj94 (124 views)
2018-03-24 14:46:31

ivj94 (768 views)
2018-03-24 14:43:53

Solater (140 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!