We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Network library for multiplayer
Page Index Toggle Pages: 1
Network library for multiplayer (Read 1618 times)
Network library for multiplayer
Dec 5th, 2009, 1:32am
 
Hello,
I'd like to ask if there is some suitable network library (or how to use vanila library for this purpose) for processing which offer functionality usefull for network aplication such as games or cooperative work (like painting or 3D modeling) .... (better realtime, but not necessary)

In vanila network library included in processing I miss this features:
1]Passing structured data (objects of some class) throught network instead of just strings or bytes.
2]Some sinchroinization functionality
3]Response as fast as possible

I know that all these things could be probably programmed by user, but it's much of work, and I don't know anything about networking. Processing looks like very very friendly way how to start with programing graphics. It would be nice if it has such a great functionality also in networking.

If I look and some network shooter or simulator like IL-2 sturmovik or QuakeIII arena, I can't imagine how to do something similar using this vanila network library in processing.

As I tried, even the example of network network drawing fails if I switch to some common frameset (like 30 or 60fps) even on localhost. Why, if there are cooperative painting programs which work on internet and multiplayer shooters which need also such a fast response and passing throught much more of data?

Is there any good tutorial about synchronization and parsing of datastructures for network?  

If not, can you advice me how to implement "passing object throught network" by myself?

I mean something like

Code:


byte[] parseObjectIntobytes(object obj, length){
...
};

void writeObjectToNetwork(object obj){
byte[] buff = parseObjectIntobytes(object obj, obj.length);
client.write(buff);
}

object readObjectFromNetwork(){
....
}

Re: Network library for multiplayer
Reply #1 - Dec 26th, 2009, 1:01pm
 
I'm also interested in finding out how to fine tune processing's network library to work for online multiplayer. I got it to do the basics locally, but I can't seem to get it running smoothly with a remote server. Any suggestions - a new, more powerful and well documented library, perhaps?
Re: Network library for multiplayer
Reply #2 - Dec 27th, 2009, 3:17am
 
The first thing that comes to my mind is serialization. I don't know much about this in Java, but this link to the javadoc might help :

http://java.sun.com/j2se/1.4.2/docs/api/java/i/ObjectOutputStream.html

Page Index Toggle Pages: 1