www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Disastorm on August 19, 2008, 05:52:01 am

Title: how to sync stuff online??
Post by: Disastorm 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?
Title: Re: how to sync stuff online??
Post by: EgonOlsen on August 19, 2008, 10:06:19 pm
Sounds strange. How are you transfering/setting the rotation matrix extacly (a small code snippet would help). I'm doing something similar in my game. If done right, it works quite well.
Title: Re: how to sync stuff online??
Post by: Disastorm 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);