Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (535)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  JNAG(Java Network API for Games) Project Approved!  (Read 7264 times)
0 Members and 1 Guest are viewing this topic.
Offline Athomas Goldberg

Junior Member




Grrrrrr...


« Posted 2004-11-11 17:00:03 »

The following project has been approved:

Quote
JNAG: Java Network API for Games

Message from the owner(s)

This project has been started already on my side. I made a client connection and a server connection, and also a stub-like compiler that is using reflexivity.

Actually, it works, but it is not finished.

I am planning to use the annotations of Java 1.5 to describe the network interface more precisely (with more semantic), so that the stubs will do more things and the programmers will have less things to do (= need less time to develop and produice potencially less bugs).

For the performance issue, I will use the compression methods described in the Game Programming Gems books + my own touch.

I also plan to add some utility classes that are using the main library. For example, they will be some predefined mother classes for lobby and chat components

Description

JNAG is a network API specialized for game applications.

It focus on the communication between 2 entities that are typically a client with a server, but can also be used between a client and another client.

The main goals of this project are :

   * To match the common needs of the game programmers for network games.
   * To make this library as convenient and easy to use as RMI is.
   * To obtain the level of performance needed by professional online games.


Please see http://jnag.dev.java.net for details

Athomas Goldberg
Project Lead / Wildcard
Game Technologies Group
Sun Microsystems, Inc.
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #1 - Posted 2004-11-12 06:55:52 »

1. How is it any better than RMI?
2. If it isn't done entirely with hand-crafted UDP packets, then IMHO there's no point at all, as far as games are concerned.

malloc will be first against the wall when the revolution comes...
Offline phazer

Junior Member




Come get some


« Reply #2 - Posted 2004-11-12 10:49:48 »

I think it's very hard (maybe impossible) to create a network library as convenient as RMI which also minimizes the data overhead sent. For example to support polymorphism you must include some kind of type information in the data sent. RMI uses the class name which is natural and simple, but a gaming network library can't afford this overhead. I typically use an integer to identify the type of object from a set of pre-specified types and then a switch statement to read the correct object from the stream. It's fast and have very little overhead, but it's not as convenient as RMI.

I'm not saying the project should not be approved, just that it's hard to make it as powerful and easy-to-use as RMI.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #3 - Posted 2004-11-12 10:55:02 »

I don't disagree, but that particular problem could easily be overcome with a "handshake" at the start in which the two sides of the connection agree on an integer mapping for classnames.

Kev

Offline phazer

Junior Member




Come get some


« Reply #4 - Posted 2004-11-12 11:05:24 »

Yes, that's probably a good solution, but how would you know at the start of the communication which classes that will be used in the communication? It is probably better that the sending part dynamically decide a mapping for a class when needed. Maybe RMI does this already, I don't know.

Even though the library might not be as convenient to use as RMI, I still think it would be very nice to have a network library with RMI functionality, but optimized for speed and very little overhead. I've planned to do something similar myself, but it's better to use something that already exists
Smiley

Btw, does this library use normal Java serialization or some other custom serialization mechanism?

Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #5 - Posted 2004-11-12 11:24:04 »

Presumably they'll add some radical new conformance interface/class that forces you to store the data you want to send across the network in a particular way...  which of course make it harder to use than RMI.

Kev

Offline phazer

Junior Member




Come get some


« Reply #6 - Posted 2004-11-12 12:27:58 »

With smart use of reflection and bytecode generation you can minimize the amount of manual work that has to be done for each serializable class, and at the same time minimize overhead and maximize performance. There is no need for version handling as found in normal Java serialization.

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #7 - Posted 2004-11-12 15:45:02 »

For now, "no". It doesn't seem to have a coherent point.

Is it trying to replace RMI? Why? For performance? ...then it MUST be a cunning UDP scheme (or else not be for games).

RMI is actually "good enough" for a lot of games. And it's free, extremely widely documented and tested, and comes with every sun JVM automagically.

malloc will be first against the wall when the revolution comes...
Offline phazer

Junior Member




Come get some


« Reply #8 - Posted 2004-11-12 16:47:23 »

RMI is certainly "good enough" for most games. But what if you have hundreds or even thousands of clients connected to a server? I don't think RMI was designed for this. I have some concerns regarding:

- Serialization overhead
- The distributed GC
- RMI creating new sockets on demand

I think there is room for improvement over RMI even when using TCP.

Offline karmaGfa

Junior Member




Miaow


« Reply #9 - Posted 2004-11-13 03:15:45 »

Quote
1. How is it any better than RMI?
2. If it isn't done entirely with hand-crafted UDP packets, then IMHO there's no point at all, as far as games are concerned.


Hello,

I am the one who propose this project.

1. It will not do the same things than RMI, but will be used in a similar way. Since they won't do the same thing, you can understand than one can do better that the other one in what one doesn't do.

2. At the beginning, I will use TCP, but for the feature concerning the semantic information of the data sent that I want to add later, I will have to use UDP.

For now, java programmers who don't want to program with RMI for some various reasons have to implement them-self their network layer.

Why games programmers won't use RMI ? I personnaly tried to use it, but I ran into some problems :
- I could not just send a function call and wait the return of the remote function. I could not also create a thread per new remote call since the number of calls were too numerous. In a game, the programmer often need a "fire & forget" remote function call, whose return type is void.
- I was curious, so I went to see the code generated by the stub ... even when it is about to insert an int into a stream, they need an object, so they create a new Integer(value) before they can serialize it. I don't know if it will affect the performance or not .. but I felt a little .. afraid.
- RMI was designed for the general purpose, and it makes it nicely. There is some assumptions that are definitly different between the general purpose and the games. For example in games, the network entities knows more about each other, since they all come from the same game development company. They can suppose more things about the behavior of the one that will receive the remote call, and it is usually used to improve the performances of the network.

So, if the programmer don't want to use RMI, for the previously mentionned reasons, he have to make himself his own RMI-like framework with some solutions to those problems, or he have to give-up the ease to use of the RMI-like framework.

Here, I propose an open source API that will do that for the programmer. The API won't support all the features of RMI, it just aims to be as easy as it to use.

I will also implement some components that are commonly used in games, as a demo of how to use the library, and as something that can be used directly by the game programmer.

Now, what my API will do that RMI won't do is to add some special type of information, so that some data can be transmited between the entities in a more efficient way.

A few days ago, I saw your nice network engine. The API I will implement have different purpose. For now, it only deal with the communication between 2 entities.
... and this one will be LGPL, I want to enable everybody to use it for free, in order to promote Java for games.

Regards,
Vincent

Ps: I voted "abstain" when arriving on this thread .. that's more fair  Smiley

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline karmaGfa

Junior Member




Miaow


« Reply #10 - Posted 2004-11-13 03:37:15 »

Quote
I think it's very hard (maybe impossible) to create a network library as convenient as RMI which also minimizes the data overhead sent. For example to support polymorphism you must include some kind of type information in the data sent.


Usually, since each entity are implented by the same team, the entities can be prepared in advance to not have to use this feature.

Perhaps I am wrong (tell me if it is the case), but game programmers don't use it in their games. JNAG won't support it if nobody need it.

Quote
RMI uses the class name which is natural and simple,


I agree.

Quote
but a gaming network library can't afford this overhead.


I agree.

Quote
I typically use an integer to identify the type of object from a set of pre-specified types and then a switch statement to read the correct object from the stream. It's fast and have very little overhead, but it's not as convenient as RMI.


What if an API make it for you, and send less than an interger on the network, with a HashMap intead of a switch, and with a final call of your remote function instead of you having to add it in the switch ?

It seems that you may be one of the potencial users of JNAG.

Do you use the polymorphism often in the parameters of the remote functions ? Are they in the main loops of intensive network usage like in a game where each client need to know the new position of a player at every frame ? Are you ready to do a (little) extra work to not use it as RMI enable it ?

Quote
I'm not saying the project should not be approved, just that it's hard to make it as powerful and easy-to-use as RMI.


Hard, but not so hard. I will post my first results on my project's page within 2 weeks, as a preview.

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Offline karmaGfa

Junior Member




Miaow


« Reply #11 - Posted 2004-11-13 03:44:23 »

Quote
Presumably they'll


I am 1 man.

Quote
add some radical new conformance interface/class that forces you to store the data you want to send across the network in a particular way...  which of course make it harder to use than RMI.


Not at all, but I won't debate about it before you see how the API will behave.

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Offline karmaGfa

Junior Member




Miaow


« Reply #12 - Posted 2004-11-13 03:49:45 »

Quote
With smart use of reflection and bytecode generation ...


I am generating java source code, like rmic is doing.

Quote
... you can minimize the amount of manual work that has to be done for each serializable class, and at the same time minimize overhead and maximize performance. There is no need for version handling as found in normal Java serialization.


For the performance issue, I ordered the priorities like that :
- First, the size of the data sent over the network.
- The CPU performance.

My main purpose is to have the less data possible on the network, but I won't sacrifice the need of CPU time of game developpers neither.

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Offline karmaGfa

Junior Member




Miaow


« Reply #13 - Posted 2004-11-13 03:59:25 »

Quote
For now, "no". It doesn't seem to have a coherent point.

Is it trying to replace RMI? Why? For performance? ...then it MUST be a cunning UDP scheme (or else not be for games).


The UDP scheme is a detail for now, I reserve it for later. It is time consuming to implement things based on it, and for now I need to have the framework well-defined.

I would like to point out that not a lot of games are using UDP, and the players and game developers are still happy with the game they obtain.

Quote
RMI is actually "good enough" for a lot of games.


I am surprised ! Perhaps some turn-based games are using it, but I don't know about the other games .. never heard about them using RMI.

Quote
And it's free, extremely widely documented and tested, and comes with every sun JVM automagically.


JNAG is also free, it will be documented of course, tested also, and it won't be big at all. Just a few classes.

I would like to point out also that jogl, with is also a game library (binding), is a lot bigger that what jnag will probably be. JNAG is designed to be in pure java, and can run in an applet without any security issues.

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Offline phazer

Junior Member




Come get some


« Reply #14 - Posted 2004-11-13 07:19:09 »

Quote

What if an API make it for you, and send less than an interger on the network, with a HashMap intead of a switch, and with a final call of your remote function instead of you having to add it in the switch ?


Yes, that will work. With polymorphism I mean the ability to send different types of objects (which are sub classes of the parameter type) as argument to a method call. This is very common, even in games. Each sub class would of course have its own serialization code.

About the mapping of class names -> int IDs, I think it's nice to have the possibility to explicitly specify the mapping in the code. That will work better with obfuscation for example and the mapping never has to be sent over the network. If an ID is not found for a class a runtime exception would be thrown. Of course, dynamic mapping can also be implemented.

About serialization: it would be nice if serialization code was generated automatically and dynamically for a class. It would of course take into account transient fields. It would also be nice if you can override the write and read methods for a class (similar to Serializable). And also the instance factory.

About method calling: if you can make it similar to RMI that would be great. Otherwise a simple method ID -> Runnable mapping would probably work for me. I think both the client and server should be able to run single threaded, so asynchronous method calls is a must. This requires some smart buffer handling to store the method calls until they can be put on the socket buffer. If you have 1000 clients you can't allocate a 1MB buffer for each client Smiley. Also, buffering can cause some latency problems, so message priorities would be nice (for example player positions have high priority, world data low). Synchronous method calls are nice, but not necessary for games I believe.

About TCP/UDP: I think TCP is a very good protocol that will work for almost all games. I think many MMORPG use TCP communication.

Both the client and server should be controlled by a single socket select loop to get best performance.

So, it's quite a complex network library we are talking about. Are we thinking the same way?  Wink

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #15 - Posted 2004-11-13 07:56:11 »

Quote


So, if the programmer don't want to use RMI, for the previously mentionned reasons, he have to make himself his own RMI-like framework with some solutions to those problems, or he have to give-up the ease to use of the RMI-like framework.


Or...do what thousands (tens of thousands?) of people do and use one of the 5-10 massively popular open-standard (usually open source) alternatives to RMI that RMI was attempting to be compatible  / competitive with. The obvious starting point is CORBA. Then you go off and look at the masses of improvements that have been made on CORBA over the last decade...

malloc will be first against the wall when the revolution comes...
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #16 - Posted 2004-11-13 08:03:44 »

Quote


I would like to point out that not a lot of games are using UDP, and the players and game developers are still happy with the game they obtain.


Shrug. Serious games with competent network programmers typically use UDP-derived protocols. No computer game ever wants to use TCP (bar a tiny number of exceptions, e.g. possibly card games where things happen only every few seconds or every minute, and other board games with no time limits), but TCP is there and what they want doesn't yet exist in java for free and open source, so...

If you were proposing a UDP derived protocol then that would seem to me to have much bigger value to games devs (there is NO java implementation of the main free UDP-derived protocols that C and C++ games programmers use on almost every project! Where is "java eNet" for instance? Sob).

Quote


About TCP/UDP: I think TCP is a very good protocol that will work for almost all games. I think many MMORPG use TCP communication.


No, "most" games want a working alternative of RDP (TCP clone minus IIOD and with optional GD). Many games put up with TCP because it costs less programmer time; most of those that do suffer because of it (unless they are very simplistic games with no real-time gameplay and little decision making and little data to send)

Quote

JNAG is also free, it will be documented of course, tested also, and it won't be big at all. Just a few classes.


Ah. I was thinking you were aiming at something considerably larger than just a few classes.

malloc will be first against the wall when the revolution comes...
Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #17 - Posted 2004-11-13 10:38:19 »

I vote "yes", as I'm going to be doing a deathmatch game next year and I want to see some code Wink

...but only on one condition:

It exlusively uses Buffers, and exclusively uses UDP, and looks remarkably like Quake3 communications protocol, which is proven to work.

Cas Smiley

Offline karmaGfa

Junior Member




Miaow


« Reply #18 - Posted 2004-11-13 13:28:18 »

Quote
I vote "yes", as I'm going to be doing a deathmatch game next year and I want to see some code Wink

...but only on one condition:

It exlusively uses Buffers, and exclusively uses UDP, and looks remarkably like Quake3 communications protocol, which is proven to work.

Cas Smiley


Yes, it will use buffers.
But no, I can't guarantee that it will use "only" UDP.

does jogl only bind what you need ? ;-)

Thank you for your support, you won't be deceived.

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Offline karmaGfa

Junior Member




Miaow


« Reply #19 - Posted 2004-11-13 13:47:46 »

Quote
RMI is actually "good enough" for a lot of games. And it's free, extremely widely documented and tested, and comes with every sun JVM automagically.

Quote

No computer game ever wants to use TCP (bar a tiny number of exceptions, e.g. possibly card games where things happen only every few seconds or every minute, and other board games with no time limits

Huh ... no comments.

Quote

Ah. I was thinking you were aiming at something considerably larger than just a few classes.

Does RMIC contains a lot of classes ? Is it important for the targeted application ?

Anyway, "big" or "small" is subjective, I don't want to debate about it, but I think that the size won't be a problem at all.

Ps: I moved my vote to "yes" as a symbol of me disapproving the reasons of the unique "no"  Cool

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Offline karmaGfa

Junior Member




Miaow


« Reply #20 - Posted 2004-11-13 13:56:44 »

Quote

Or...do what thousands (tens of thousands?) of people do and use one of the 5-10 massively popular open-standard (usually open source) alternatives to RMI that RMI was attempting to be compatible  / competitive with.


Can you give some links, please ?
I would like to see them, it can be instructive.

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Offline karmaGfa

Junior Member




Miaow


« Reply #21 - Posted 2004-11-13 14:41:17 »

Quote

Yes, that will work. With polymorphism I mean the ability to send different types of objects (which are sub classes of the parameter type) as argument to a method call. This is very common, even in games. Each sub class would of course have its own serialization code.


Do you need it because on the server side you use some functions that may be redefined by a subclass of the type of an argument, or is it because you want a customized serialization/deserialization function from the subclass ?

Can you give me an example of where you need it, please ? I would like to visualize concretly in what kind of situation it is may be usefull.

Quote
About method calling: if you can make it similar to RMI that would be great.


thank you Roll Eyes

Quote
About TCP/UDP: I think TCP is a very good protocol that will work for almost all games. I think many MMORPG use TCP communication.


It depends the company. If it is one of the little set of the big and famous development company (for example, Blizzard), they may use UDP because they have about 20 or more programmers just for their network stuff. If it is one of the really larger set of the average development company, they mostly use TCP because they have no time.

Note : We should not say "most of the games" when we speak about the 5% of the games that represents 95% of the sold games.

JNAG will use UDP when I will have time to add it. First, I need to finish the specification of my framework (i.e. how the programmer specify the semantic of the data). After this is finished, everybody can in theory start to use the lib. The UDP stuff is the implementation part - the programmer don't need to know if the lib is using TCP or UDP, they just need to use it. A reference implementation will be written first (i.e. not specially fast) so that the users can effectively start to use it, then I will start the optimizations of the implementation.

Quote
So, it's quite a complex network library we are talking about. Are we thinking the same way?  Wink


Globally yes.

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Offline phazer

Junior Member




Come get some


« Reply #22 - Posted 2004-11-13 15:20:14 »

Quote

Can you give me an example of where you need it, please ? I would like to visualize concretly in what kind of situation it is may be usefull.


Ok, let's say you have a class structure like this:

1  
2  
3  
4  
5  
6  
7  
interface Node {}

class Group implements Node {}

class Leaf implements Node {}

class MyLeaf extends Leaf {}


When a remote method "object.someMethod(Node node)" is called any type of Node object should be allowed to be passed as argument, for example MyLeaf. And at the remote system the correct type will be instantiated (MyLeaf) and deserialized. So, some kind of information about the actual argument type must be included in the method call.

Without this polymorphism no type information would be need to be sent because the receiving part would always know the type of the argument.

Btw, I totally agree about the TCP/UDP issue. Start with TCP and then if needed add UDP support transparently to users of the library. There are disadvantages to UDP, for example being blocked by firewalls.

Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #23 - Posted 2004-11-13 17:41:01 »

I don't use JOGL... Tongue

What I really need is basically as Blah3 says, RDP implemented on UDP. For RMI-style comms over TCP.. guess what! I shall use RMI Smiley

Cas Smiley

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #24 - Posted 2004-11-14 08:00:54 »

Howabout doing a java conversion of RakNet, eNet, or similar (all free, all C/C++ only, all very widely used in commercial and hobbyist games)? Or...explaining what you want to do in terms of why its different from doing that?

malloc will be first against the wall when the revolution comes...
Offline karmaGfa

Junior Member




Miaow


« Reply #25 - Posted 2004-11-15 00:37:57 »

I don't know those libraries, I will take a look on them.

Can you provide on this forum the 5~10 other free network solution in Java that you were talking about before, please ? I would also take a look on them.

Probably I won't port them as you request. I don't try to do a port but I try to use the capabilities of the language to obtain the best result, and I hope it will cover the needs that one can have when he decides to use the libraries you mentionned.

Regards,
Vincent

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Offline karmaGfa

Junior Member




Miaow


« Reply #26 - Posted 2004-11-24 09:05:21 »

Hello,

Good news for the community (I hope  Smiley) :
I have to make a port of a game in Java for my work, and I need to use jnag asap. I cannot spend time for now on the whole set of the functionnalities that I wanted in JNAG, but at least you will have a preview of the lib which will be used in a realistic context.

The lib will continue to involve as I described before, but later.

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Offline phazer

Junior Member




Come get some


« Reply #27 - Posted 2004-11-24 10:47:30 »

I'm very interested in using your project in my game engine. Doesn't look like your project has been approved yet, and maybe it won't be, so please keep me informed if you release something or put something on the web.

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #28 - Posted 2004-11-24 15:11:31 »

Quote

Can you provide on this forum the 5~10 other free network solution in Java that you were talking about before, please ? I would also take a look on them.


You should be able to find them if you do a little research. I cited enough jargon that you ought to hit most on a single google.

malloc will be first against the wall when the revolution comes...
Offline karmaGfa

Junior Member




Miaow


« Reply #29 - Posted 2004-11-25 06:55:52 »

Hello,

I went to see the documentation ofeach of the ones you cited, it was interesting. But none of them was in Java.

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Riven (4 views)
2014-07-29 12:53:52

Dwinin (7 views)
2014-07-29 10:59:34

E.R. Fleming (20 views)
2014-07-29 03:07:13

E.R. Fleming (8 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (26 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21

Zero Volt (51 views)
2014-07-17 23:47:54
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!