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 - Disastorm

Pages: 1 ... 9 10 [11]
Support / Re: Some questions.
« on: February 08, 2010, 09:16:37 am »
Thanks for the responses everyone.  btw wojtek i wasn't wondering about how to do collision via server/client but rather how to make something collidable with everything.  Since you havn't done collision yet, maybe you have not seen it , but it seems you can set an object as to COLLISION_CHECK_SELF or COLLISION_CHECK_OTHERS and those 2 different types can collide with each other, but for example a CHECK_SELF and another CHECK_SELF cannot collide with each other.  So the question is how can you make 3 objects all able to collide with each other?

oh yea raft I remember looking at your website for karga awhile back, that game looks really cool.  I'm trying to make an mmo game with jpct.  Is there some way to test the bandwidth required for your program?  If I am running my program on 2 computers in a local network is there some way I can check how much bandwidth is going through?

It looks like if you "attach" stuff together you don't get the weird positioning problem with .3ds files.

Support / Some questions.
« on: February 07, 2010, 05:17:30 am »
Hi, I have some questions.  Whats the best way to sync two objects together over a network.  Right now I send transformation and rotation matrix clones every 50 ms over an ObjectOutputStream or something like that and also have the keypresses sending so that it can continue to translate the objects in between those 50ms. its pretty good but doesn't seem to be perfect when i have 2 clients open it has a slight delay before one can see the movement.  I was just wondering if theres a better way or perhaps this delay is due to my logic in constructing a pojo to send across the stream and then checking all the objects on the client side to find the one that is referenced by the pojo, etc.

Also how can I make something collidable with everything? I only see that theres a setting that check collision self and check collision other.  Is there no way to make it collidable with everything for example if I have 3 objects that can collide with each other?

Also if I use a .obj how do I get material to work?  If I use a .3ds exported from 3ds max with texture coords and then import the jpegs itto jpct, it will automatically put them on my model.  But I tried with a .obj exported from 3ds max and i set the .mtl file also and then i noticed that jpct imported all the correct jpegs after it read the .mtl file but it didnt seem to show up in the actual world.

Also why does it seem like sometimes parts of my 3ds file will be in the wrong position when i load it into jpct instead of the position it was in when i open it in 3ds max.  If i use a .obj file though this position problem doesn't happen but i'm not sure how to use textures.  So far I believe this 3ds problem only happened if I cloned a copy of an object, but im not sure.


Support / Re: what causes this?
« on: December 11, 2009, 06:48:22 pm »
I think java.util.Timer also executes in a separate thread.  I can't figure out how I can use it.

*edit I couldn't figure out how to get it working using timer but I got it working using that method u said kind of mvc but not really.  This is what I ended up doing, I have a class called ObjectMover that stores 2 lists, one of objects to be moved and one of objects to be removed (not be moved anymore).  I made a class called RunnableObject3D which extends Object3D but also has a run method and a getTime(how many times it should be run before stopped) method.  When I add an object to the world , I also will add it to this ObjectMover's list.  then in the main rendering loop I call moveObjects on the ObjectMover will check the value of time in the RunnableObject3D and if its greater than 0 it will run it, otherwise it will add it to the removeQueue list and remove it from the world.  After that, it will go through the remove queue and remove these items from the object List and then clear the queue.

public static void moveObjects(){
    for(RunnableObject3D obj : list){
        if(obj.getTime() > 0){;
    //remove objects that are done executing
    for(RunnableObject3D obj: removeQueue){
    //clear removeQueue

Support / Re: what causes this?
« on: December 11, 2009, 08:12:10 am »
Hey I have another problem now.  Can you tell me why this happens?

i have a class that looks like this:

public class Pellet extends Object3D implements Runnable{
    Shoot shoot;
    public Pellet(SimpleVector direction){
        shoot = new Shoot(this, direction);
   public void run() {
    private class Shoot extends Thread{
        SimpleVector direction;
        Pellet pellet;
        float speed = 10;//speed of bullet
        int time = 15; //time bullet exists
        Shoot(Pellet pellet, SimpleVector direction){
            this.direction = direction;
            this.pellet = pellet;
        public void run(){
            int count = time;
         while(count > 0){  
            try {                
            } catch (InterruptedException ex) {
                Logger.getLogger(Pellet.class.getName()).log(Level.SEVERE, null, ex);

and implement it like this:

case (Keyboard.KEY_LCONTROL) :{
                if(event == KeyState.PRESSED){
                combat.Pellet pellet = new combat.Pellet(model.getXAxis());

It basically creates a sphere where the player is standing and it shoots forward and then dissapears after awhile.

at first it seems to work fine but if you spam it really fast at some point it causes a null pointer exception at com.threed.jpct.World.renderScene(Unknown Source).

However, this null pointer exception does not happen if I remove the from the Pellet class, in other words I don't get the error if I keep the sphere on the world.  Is this because I'm doing these changes to this object outside of the main Thread again? How can I make something keep moving outside of the main thread?

Here is a link to the program again:


Support / Re: what causes this?
« on: December 10, 2009, 04:40:32 am »
thanks man it works now.  thats great you can tell the problem just by looking at it lol.

Support / what causes this?
« on: December 09, 2009, 09:40:33 am »
Hello.  In this program I am making when I try to move my character it looks like it flickers/jerks now and then.  What can cause this?
I noticed it doesn't seem to do it if I don't move the camera at all.

Here is my program.  You can run it with runGame.bat and move with the arrow keys.


Support / Re: How to make a HUD?
« on: August 25, 2008, 01:09:40 am »
How would you put a FengGUI onto the jpct window?

Support / Re: Any Way to Speed Up an Animation?
« on: August 23, 2008, 07:28:23 pm »
Where is the advanceAnimation method?  I've been using the animate(float index, int seq)  method for my animations, which u can speed up or slow down depending on the value of the float index.

Support / How to make a HUD?
« on: August 23, 2008, 07:00:09 pm »
Is there any classes or anything that let you make a HUD like in-game text windows, Health Bars, Skill buttons, etc??

Support / Re: how to sync stuff online??
« on: August 20, 2008, 04:19:34 am »
thnx i fixed it, i had a typo in my code.
i had:
                        matrix.set(2, 0, nine);
                        matrix.set(2, 3, ten);
                        matrix.set(2, 3, eleven);
                        matrix.set(2, 3, twelve);
instead of
                        matrix.set(2, 0, nine);
                        matrix.set(2, 1, ten);
                        matrix.set(2, 2, eleven);
                        matrix.set(2, 3, twelve);

Support / how to sync stuff online??
« on: August 19, 2008, 05:52:01 am »
Hi i'm making a program for fun, this engine is awesome.  How can I sync two players together online?
Right now I have it so the client sends the other client the keypresses every 50 ms to simulate as if they were playing locally, but that still resulted in quite a bit desync so then i made it so they send that and also the translation matrix every 100 ms which now has no position desync, but when i try to send the rotation matrix so theres no rotation desync , it works but for some reason the other players model looks 2d instead of 3d (very strange.. it becomes flat..), while your model still looks 3d.  How can i get around this, or possibly is there a better method other than sending the matrices?

Pages: 1 ... 9 10 [11]