Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (492)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Networking & Multiplayer / Re: What to do to improve real time? on: 2008-04-02 05:32:48
In a real-time game it is better to send at intervals.  Otherwise, how do you deal with "when it moves"?  When the positional value changes you send a message? If you are constantly moving you could be sending thousands of messages a second depending on the frequency of updates in your game or however you are dealing with this.  Intervals are really the only way you can keep traffic to a consistent level as well as giving your network a consistent flow that keeps the game from getting jerky when lots of stuff is going on and really smooth when nothing is going on.  If programmed well you'll have a consistent flow throughout.

I would recommend taking a look at the synchronization system in JGN that provides exactly this:

http://svn.javagn.org/core/trunk/src/com/captiveimagination/jgn/synchronization/

For an example in jME that uses a synchronization implementation and allows multiple connected clients see here:

http://svn.javagn.org/synchronization/jme-networking/trunk/src/com/captiveimagination/jmenet/

The "flagrush" is an example based on the FlagRush tutorial in jME.  As you can see from the JMEGraphicalController it is trivial to create implementations for other systems to allow JGN to work with them.

For more information on JGN see:

http://www.javagn.org

Thanks for the info,

By the way, can anyone help me by giving me which are the best time rates to send info (every ? milliseconds)
2  Game Development / Networking & Multiplayer / What to do to improve real time? on: 2008-04-01 18:34:40
Hi, I am trying to do a java real time networked game. Right know the client is only sending data to the server when it moves (change of position) and the server sends data to clients when any client has moved. My question is the following: Is it better this approach or maybe its better to constantly send the info every certain time. Thanks and any suggestions to improve real time are welcome.

Elioncho
3  Discussions / General Discussions / Real Time in Java on: 2008-04-01 09:55:00
Hi, I am currently working on a networked game. I want to know if with good socket programming and game design it is possible to make a real time game in Java, or is there the need of another tool? Thanks,

elioncho
4  Game Development / Networking & Multiplayer / Re: About sending data on sockets on: 2008-03-28 00:21:26
Being more explicit:

Maybe I dont understand the theory on DataOutputStreams. Anyway I am going to try to be more explicit.
When I have the following:

out.writeInt(x);
out.writeInt(y);

I believe that the x is sent first in a frame that includes the address where it should go etc (IP frame). And then the y is sent on another independent frame with its header, address where it should go etc.

So if the aforementioned is true, wouldnt it better to send x and y in only one frame. I could make my own protocol to hande the data. For example

out.writeUTF(P@X@Y);

When I receive something like this, I will break it into parts by using .split("@") and then check that if it has a "P" is a Positional message. So I know the other two data splitted are X and Y.

If I have a out.writeUTF(M@HELLO); , The M will tell me its a textMessage and I will take the rest of the content as a message.

Does anyone has donde something like this? Please help.
5  Game Development / Networking & Multiplayer / Re: About sending data on sockets on: 2008-03-27 23:49:02
Does anyone here uses like a protocol or a communication frame. Maybe one frame could be :

out.writeUTF(P@X@Y);

When the other side receives it and do an split("@");. It will understand its a Position frame(because of the P) and then use x and y.

If the frame is :

out.writeUTF(M@SADASDASDASD);

M stands for message so it will manage the frame as a text message.

Anyone has used this kind of idea?
6  Game Development / Networking & Multiplayer / About sending data on sockets on: 2008-03-27 21:59:52
Hello,

I am using right know dataOutput and Input Streams to send data between server and clients. Using WriteInt and ReadInt I send and receive positions over the net. What I understand is that if I have:

out.writeInt(x);
out.writeInt(Y);

I am sending one packet after another, so Im trying to make like a frame protocol where I could send x and y in only one packet. Any ideas of how to do this?

Thanks,

Elías
7  Game Development / Networking & Multiplayer / If I want to have a little chat on my game what should I do? on: 2008-03-18 22:17:16
Do I work with another socket connection and declare a new DataInputStream or DataoutputSream?
8  Game Development / Networking & Multiplayer / Re: DataInput and Dataoutput Stream (approach for I/O) on: 2008-03-18 22:11:00
Thanks!!! Wink
9  Game Development / Networking & Multiplayer / Re: DataInput and Dataoutput Stream (approach for I/O) on: 2008-03-18 19:40:17
Thanks,

Someone tolde me to do this: Use a BufferedOutputStream between the DataOutputStream and the socket's output stream, and only flush() the DataOutputStream when you've sent all the data for a particular transaction.

What´s your opinion on this option?
10  Game Development / Networking & Multiplayer / DataInput and Dataoutput Stream (approach for I/O) on: 2008-03-18 07:38:56
Hello,

I am currently working on a networked game. I was sending positions and that kind of stuff like this:

//out and in are DataOuput and DataInput Streams

out.writeInt(x);
out.writeInt(y);

and receiving it:

in.readInt(x);
in.readInt(y);

I then thought that it was a better practice to send x and y in a single outputstream like this (Thought it will generate less traffic if I send data once and not twice):

out.writeUTF(x@y);

Then I will receive the data like this:

String data[] = in.readUTF.split("@");
x = Integer.parseInt(data[0]);
y = Integer.parseInt(data[1]);

I want to know if this is truly a good approach, is it faster than the one aforementioned. Or is there any other better approach or any suggestion. Thanks,

Elías
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Nickropheliac (16 views)
2014-08-31 22:59:12

TehJavaDev (24 views)
2014-08-28 18:26:30

CopyableCougar4 (33 views)
2014-08-22 19:31:30

atombrot (42 views)
2014-08-19 09:29:53

Tekkerue (41 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (26 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (73 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!