Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - manumoi

Pages: 1 ... 6 7 [8] 9
Projects / Technopolies
« on: July 27, 2005, 09:02:17 pm »
Egon you re right once again... However i think this problem is unlikely to happen on my own application (and it has not occured for the moment), But there is a chance... I will try to find something to avoid such problem (maybe a little collision detection on my update method on the serverSide. If a collision is detected, this will result in the rebound - not sure of the english word - of players, in the next update)
Maybe also asking an update from the server just before and just after movements calculations on the client side will also reduce the opportunity for such problem to occur given the fact that the time slot will be very short...
anyway... more work to do :S

Support / help on an LWJGL exception
« on: July 27, 2005, 01:57:55 am »
Ok I didn t fix this problem but i remarked that when my HTML file are local, the problem doesn't occur... And in my app, files are supposed to be local so i m lucky.... But if someone has an idea on how to deal with this exception, i m still interested by it.


Support / help on an LWJGL exception
« on: July 27, 2005, 12:53:19 am »
hello my question is not a full jpct question but maybe...

I have a JPCT application with a panel showing a AWTGLCanvas and next to it a JEditorPane...

When clicking on some object in my JPCT panel, i ask  the JEditorPane to load different HTML Page at different url... It works fine 1 time, 2 times... and then i have this exception. I tried to look at LWJGL doc but i m not familiar. I don t fully undertand every processes acting when i do such operation... So, if anybody has an idea on how to deal with it, i would greatly appreciate....

here is the exception
Code: [Select]

Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: From thread Thread[AWT-EventQueue-0,6,main]: Thread[AWT-EventQueue-0,6,] already has the
 context current
        at org.lwjgl.opengl.Context.checkAccess(
        at org.lwjgl.opengl.Context.makeCurrent(
        at org.lwjgl.opengl.AWTGLCanvas.paint(
        at org.lwjgl.opengl.AWTGLCanvas.update(
        at sun.awt.RepaintArea.updateComponent(Unknown Source)
        at sun.awt.RepaintArea.paint(Unknown Source)
        at Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at Source)

and here is the code of my picking method
Code: [Select]

  public void pickingObject(int mouseX, int mouseY){
SimpleVector ray=Interact2D.reproject2D3D(camera, buffer, mouseX, mouseY);
  int[] res=Interact2D.pickPolygon(theWorld.getVisibilityList(), ray);
if (res!=null) {
   Object3D pickedObj=theWorld.getObject(Interact2D.getObjectID(res));

loadURL method is a call to the setPage(String s) method of JEditorPane



Projects / Technopolies
« on: July 26, 2005, 09:08:48 pm »
Is there a specific reason you choosed to do all your processing on your server? My own approach is to separate processing. Each clients will do collision detection... etc and send periodically its new position to the server... The server will maintain a collection of object position and it will send that collection to clients... It is more or less oriented on a grid topology:  each node/client participates to the processing...I think if the number of clients grow, the performance should not differ that much. So is there something that made you choose to centralize your processing?

Projects / Technopolies
« on: July 26, 2005, 08:56:02 pm »
Rolz, did you look at ConcurrentModificationException page in the JDK javadoc? there is a small discussion concerning when it can occur. As i said before my own problem was that i was modifying a collection (removing elements) while there was an iterator working on the same collection. I resolved it by not directly removing the element but putting its key (the collection is an hashmap) in a vector and deleting every elements referring to keys that are in my vector after the end of the iterator work (hope i m clear  :? )...

Projects / Technopolies
« on: July 25, 2005, 11:19:19 pm »
i think i fixed my ConcurrentModificationException . I was trying to modify a collection (a Hashmap) while i was iterating it and of course it is not allowed... Maybe your error is similar.

Projects / yop
« on: July 25, 2005, 10:14:02 am »
I did this stuff about synchronising my collections access... But the problem with this bug is that it doesn't appear so much... So it  s hard to point where it comes from...
Concerning your start/end strategy, i thought about that before but my concern was that, for two clients with different hardware speeds (and faster game loops) movements may differ,  I mean if you are 10 units far from your objective, the avatar that is representing you may arrive earlier on it on your computer than on another one.... That would give problems of consistency to my world. That s why i prefer to send positions of all my moving objects at each game loops... since my server receives updated positions of each objects when they are moving.
Maybe the best solution would be to use your technic and find a technique for controlling frame rate and game speed of each client but I don t know such trick.
Anyway I will check for the exception tomorrow (4 am here) and come back if i found something.
bye bye

Projects / same problem
« on: July 25, 2005, 01:17:46 am »
Hello, I got the same exception with my NIO client/server... I thought it was a question of synchronizing some of my collections... But it may not be this. I now think that maybe I receive too much updates for a time slot(in fact i send and receive an updatePosition method at each loop of the game loop of each of my clients)... If you have any ideas about this bug, I will be interested to see it...

Support / Thanks
« on: July 21, 2005, 08:42:18 pm »
Once again, you found the correct answer... I modified the lights and I just had also to correct my picking method and now, everything is working fine (and faster thanks to openGL rendering). Thanks for all.


Support / Oki
« on: July 21, 2005, 01:00:58 am »
I understand. I was doing it in the wrong way...
 I must not be so far now from the solution but currently, my canvas shows a dark square...

here is my code :

// constructor of my JPanel

  public WorldInterface(String [] args, JFrame theFrame){
   this.playerName = args[0];
   connectToServer(args[1], Integer.parseInt(args[2]));
   //   receiveUpdatesFromServer();
   this.setSize(width, height);
[\color]          buffer = new FrameBuffer(width, height, FrameBuffer.SAMPLINGMODE_NORMAL);
[\color]   Config.maxPolysVisible = 10000;
   keyMapper = new KeyMapper(myCanvas);
   theWorld = new World();
   texMan = TextureManager.getInstance();
   mainPlayer = this.initPlayer(this,"alita", "alita2.jpg", this.playerName, Float.parseFloat(args[3]),-13f, Float.parseFloat(args[4]));
   playersMap.put(playerName, mainPlayer);
   // optimization stuff
   this.addMouseListener(new WorldInterfaceMouseListener(this));
    }   [\color]

// and here is my game loop

 private void startWorldLoop(){      
   while (!exit){
       if(!isIdle){   [\color]
      Set playersList = playersMap.keySet();
      Iterator it = playersList.iterator();
      while (it.hasNext()){      
      catch (InterruptedException e){
          System.err.println("World loop error: "+e);

do you see what is missing?

And just another small question. At the end of the messages in my console, i have this:

OpenGL (AWTGLCanvas) renderer initialized
Expanding command queue to 2000 entries!
Expanding command queue to 2000 entries!

What "Expanding command queue to 2000 entries! " means?


Support / WOW
« on: July 21, 2005, 12:04:53 am »
Damn Egon, you are good.... and fast   :P

So the first problem is no more

Concerning the KeyMapper,
What do you mean by "JPCT's canvas" and how can I access to it?

A really big thanks for all...


Support / similar problem
« on: July 20, 2005, 11:48:59 pm »
I m back.
As you can see on my previous screenshots, my app is composed of 3 panels.  Except the problem I described in my previous post, my app works fine. But i just remarked that when I had a swing JButton to one of my two others panels (the white or the black).... the button appears but the KeyMapper is no more functional. I used
new KeyMapper(myFrame);
to init it (here myFrame refers to the JFrame of my application... I don t know why but it has never worked when i tried with the JPanel of my JPCT view)

I suspect both my problems are linked... :cry:

Support / launching problem
« on: July 20, 2005, 10:56:14 pm »
Hello folks,

I have a problem that i can t fix....

My app run correctly when i launch it with all necessary arguments (i.e. name, name of the server, port of the server, position at the beginning)  in the command line.
Here are some screenshots

What appears just after launching the app

a upper view of the same map

The code of my main function in my Test class is the following:

  public static void main(String [] args){
   Test t =new Test(args);   
and an example of command line would be

java  -Xmx128m Bob pamela 9000 520 520

I decided to add a form in a graphic menu (inside a JFrame) to make it easier for a client to enter new values... When I click on a button, the Test class will be launched.

The code is very basic

   public void actionPerformed(ActionEvent e){
          String [] args = new String [5];
          args[0] = loginText.getText(); // JTextField containing the login
          args[1] = serverIDText.getText(); // JTextField containing the server name
          args[2] = serverPortText.getText(); // // JTextField containing the lserver port
          args[3] = ""+520;
          args[4] = ""+520;
          myMocas.closeMocas(); // i tried to close my frame either with calling dispose() or with using setVisible(false)
          Test t = new Test(args);

When I launch my app using this JFrame, there are many problems.  Only the panel containing the JPCT view is started (the black one on the left and the white one on the down aren't... The keymapper seems not to be loaded so i have no control on my avatar... And my system is slow down drastically.
I put some "System.out..." in my code to see where the application had problems... But the code seems to be read correctly... the client is correctly connected to the server and my game loop is running.
I checked if the args value that were passed to the Test class were corrects... and they are...

I tried with software or hardware rendering. Here are some config information for the buffer of my jpct Panel

//   buffer = new FrameBuffer(width, height, FrameBuffer.SAMPLINGMODE_HARDWARE_ONLY);
buffer = new FrameBuffer(width, height, FrameBuffer.SAMPLINGMODE_NORMAL);

I tried 2 different configs by inverting red and green lines. blue lines remained in both configs. I don t know if it can be related to that but in fact, there was no runtime difference.

So I m lost. Is there a problem launching a JPCT app from another JFrame? If so, is there a way to bypass it?

Thanks you,


Support / collision detection
« on: July 04, 2005, 11:49:13 pm »
Hello, i m having a problem with collision detection...
I create a terrain object with many triangles.

then i call this function

 public void setupTerrainOctreeAndCollision(){
   OcTree oc = new OcTree(terrain, 100, OcTree.MODE_OPTIMIZED);
   Config.collideOffset = 250;

After that i create an avatar with an md2 file

public void loadModel(){
   model=Loader.loadMD2(modelPath+"tris.md2", 0.5f);

In this configuration, collisions occur and my avatar can t go through walls... But the problem is it can go through others avatars... When i try to put:


there is no more collision and i don t understand why

Do you have an idea ???

PS :

my forward method is :

// ELLIPSOID_RADIUS is defined as in the FPS example
 private void moveForward(){
   SimpleVector a = model.getZAxis();
   a = model.checkForCollisionEllipsoid(a,ELLIPSOID_RADIUS, 5);

Tell me if you need something else to understand my code

Support / OK
« on: June 02, 2005, 01:19:18 am »
I didn t see that the link in the download section wasn t the one for 1.06. With version 1.06, it rocks. Thanks you very much.

Just another small question.
Currently, my world is loaded with a 3DS file.... and it works. But when I try to replace it by a Primitives.getPlane() call (in order to have a flat world), nothing appear. I think something is missing. What do I need?

Here is my code :

public void loadingTerrain(){
   Object3D[] objs = Loader.load3DS(PATH+SEP+"models"+SEP+"terascene.3ds", 400);
   if (objs.length >0){
       terrain = objs[0];

   // Replacing all the precedent line with the commented line below
//   terrain = Primitives.getPlane(200f);


Do I need to use setOrigin or something like that?

Again, thanks for all.


Pages: 1 ... 6 7 [8] 9