Flier Match

Started by Melssj5, January 18, 2006, 04:07:06 PM

Previous topic - Next topic

EgonOlsen

Assuming that those threads are properly synchronized (otherwise, everything may happen...), the craft looks static for the bullet moving and vice versa.

Melssj5

then I guess I must do all movements (all crafts and all bullets) on a same thread??. Actually each client has an Atention class on the server side that moves its craft.
Nada por ahora

raft

Quote from: EgonOlsen on May 23, 2008, 08:05:25 PM
7.- No problem. You can simply wrap your stream into a GZIPOutputStream/GZIPInputStream. That's basically all that has to be done to zip the data.

this works for you since (as far as i know) you send data continuously. if you send data only when required (as i do in karga) you will run into problem: ie: you cannot guarantee all your data is sent after a flush

these compressed input/output stream pair by Dawid Kurzyniec are designed for this purpose. see the discussion in javadoc. i use them in karga. they work standalone, just copy the two source files and they will work.

i have a link to dawid's home page in karga's credit page but it seems to be dead. google for it if interested

r a f t

Melssj5

Thanks I will check it for sure later. Now I am running in problems for changing the way in which everything is moved inside my game, I have still to migrate some stuff before worring about the size of my stream.
Nada por ahora

EgonOlsen

Quote from: raft on May 29, 2008, 12:12:50 AM
this works for you since (as far as i know) you send data continuously.
I wasn't aware of this issue...however, the stream has a finish()-method. Doesn't that help? Anyway, i'm not using this on the socket's stream directly but on ByteArrayXXXStreams, so that i can close the GZIPXXXStream directly after reading/writing. That way, the data should have been written correctly. I'm then sending/receiving these compressed byte arrays over the uncompressed sockets' streams. I'm doing this, because not everything should be zipped. I also include some status data (length, type,...) that has to remain uncompressed because it controls the reading from the actual stream.

raft

i'm not sure if finish will help. it may help writing but reading may be problem. you may need to initiate another gzip in, not sure..

your method of compressing byte array streams then writing should obviously work. i just prefered the other way as it's completely transparent to user. just writing to an ordinary stream


Melssj5

well, Actually I am using ObjectInput/OutputStreams constructed using the getInputStream and getOutputStream from the Socket. I used to have a lot of delay until I set the setTcpNoDelay to true.

I am using this becausse Sometimes I have to send object3D, World, craft parameters, etc. So sending them as bytes will require a lot of extra work on my project. Which should be the best aproach to do. So I have to do this????:



CompressedOutputStream cos=new CompressedOutputStream (Socket.getOutputStream);
ObjectOutputStream oos= new ObjectOutputStream (cos);
oos.writeObject (whatever);

Nada por ahora

raft

i use ObjectInput/Output streams too, constructed over a deflater/inflater stream over socket streams. it's arguable if this is the best approach but it certainly makes things easier.

just make sure you call flush and reset on ObjectOutputStream after sending one bulk of data to make it independent of others bulks.

for sending object3d and world:  i wont do that, they are simply too big objects to send over network

Melssj5

I JUST SEND THE WORLD ONCE TO EACH CLIENT AT THE BEGGINING OF THE GAME. AND A OBJECT3D WHEN A NEW PLAYER GETS IN.
Nada por ahora

Melssj5

Well, I have to say it. This project is dead, I am dissapointed of everything and I wont continue this. :'( Anyway, I wont delete it at all as the other times. Egon, May I upload it to the download section with the rest of third party apps to anyone can continue it if wanted?

Or If anyone is interested on finishing it for me for a price just let me know.
Nada por ahora

EgonOlsen

Bad news... :'( Anyway, i can of course host the current state for download on jpct.net. Just send it over and i'll upload it next week.

Melssj5

Well, I was waiting to see if I can put it in English, but I wont, on this weekend I will public the project as is. Hope somebody can found it usefull, intersting or even may want to finish it.
Nada por ahora

fireside

Was that written for internet multi-player?
click here->Fireside 7 Games<-

Melssj5

That was the idea but I never tested in on internet just from LAN and works at a good speed. on Monday I will post the project.
Nada por ahora

fireside

I've been trying to read up on it a little. The only thing I would like to do someday is write some turn based games, but I think it probably wouldn't be allowed on a free site like the one I have.  Apparently I would write a little server socket program and then have to start it somehow on the server site so it would communicate with the applets.  I guess it's ok to talk to the applets from the host where the applets got downloaded, but applets can't talk to each other.
click here->Fireside 7 Games<-