Pandaemonium
Enjoying the stay
Offline
Posts: 85
If at first you don't succeed; call it version 1.0
|
 |
« Reply #45 on: 21. December 2007, 12:12:24 AM » |
|
But for an online game there must be some kind of master server, which holds a list of servers. Exactly. I will know more about the implementation of this "master server" in the future. Right now, I only have 1 server (localhost) and everything works great. That's good enough for me for the moment. Have a good Christmas.
|
|
|
|
|
Logged
|
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4337
May the 4th, be with you...
|
 |
« Reply #46 on: 21. December 2007, 10:59:41 AM » |
|
Have a good Christmas.
Thanks  . You too. Marvin
|
|
|
|
|
Logged
|
|
|
|
karmaGfa
Enjoying the stay
Offline
Posts: 38
Miaow!
|
 |
« Reply #47 on: 05. January 2008, 02:41:26 PM » |
|
Hello, I didn't read the whole thread, so maybe I may miss your real goal, but here is my question: Xith is a scene graph API. What's the relationship with the network? Now, if you want to have some network code ready-to-run for any game loop provided by xith, well here is my recommendation: Use project darkstar. Project darkstar is a server that is developped by Sun and it rocks. Its topology is a star (1 server to N clients, where N can be big). For the transportation of the messages, it is pluggable and by default it is using mina. For the presentation of the data, only the basic is provided, that's the raw "session.send(byte[] message);". But ... there is a cool small lib that helps you to encode/decode the function calls to/from arrays of byte. Its name: Jnag ( https://jnag.dev.java.net/ - that's my lib  ). It is not really efficient, but it is pretty convenient to write programs easily. I successfully wrote a prototype in my company using it. Vincent
|
|
|
|
|
Logged
|
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4337
May the 4th, be with you...
|
 |
« Reply #48 on: 05. January 2008, 03:18:38 PM » |
|
The problem is, that any sun code will produce a whole lot of garbage, since it is not meant for games ,which we cannot use here. Your description of your own lib sounds like you're using object serialization, which also creates a lot of unnecessary garbage.
If I am mistaken, please forgive me. I will happily take the best approach. But currently Mina looks like it.
Marvin
|
|
|
|
|
Logged
|
|
|
|
|
Mathias 'cylab' Henze
|
 |
« Reply #49 on: 05. January 2008, 04:32:15 PM » |
|
project darkstar is designed for games afaik.
|
|
|
|
|
Logged
|
|
|
|
karmaGfa
Enjoying the stay
Offline
Posts: 38
Miaow!
|
 |
« Reply #50 on: 06. January 2008, 04:15:07 AM » |
|
Your description of your own lib sounds like you're using object serialization, which also creates a lot of unnecessary garbage. jnag is not using serialization. however, I didn't check for optimal performances for th GC. I think that it is currently using some new, most of the objects are quickly released ("young generation"). If I am mistaken, please forgive me. I will happily take the best approach. But currently Mina looks like it. 3 independent Layers: - Mina is a good choice. But mina only handle the transportation of messages.
- Darkstar can be used as the server to help users to not have to write/maintain their own.
- Jnag is optional. It can help, but you don't need to use it.
|
|
|
|
|
Logged
|
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4337
May the 4th, be with you...
|
 |
« Reply #51 on: 06. January 2008, 01:48:18 PM » |
|
I don't think, any net layer should force you to use one singe server environment. Xith's net-layer should be designed to be interoperate with any server env. This could be darkstar, your own server implementation or any other.
I am not a network pro. So I will take any advice I can. Could you maybe write a simple example, how your idea of a net-layer should look like? That would help me (and others) in their decision.
Marvin
|
|
|
|
|
Logged
|
|
|
|
karmaGfa
Enjoying the stay
Offline
Posts: 38
Miaow!
|
 |
« Reply #52 on: 06. January 2008, 05:23:22 PM » |
|
Maybe someone need to list the objectives of such layer in this forum.
My personal advices is that if you list the goal of abstracting the different network API so that the user can switch between them, then remove this goal from the list: It won't work.
Any other objective?
|
|
|
|
|
Logged
|
|
|
|
Jonas
Just dropped in
Offline
Posts: 5
|
 |
« Reply #53 on: 06. January 2008, 07:15:12 PM » |
|
In my opinion, I wouldn't integrate a netcode api into xith at all.
I mean, the type of netcode I use heavily depends on the kind of application I'am going to write and doesen't care much about the presentation of it. If i simulate my game with Java2d or with Xith3d won't affect my netcode or server side code. If you guys want to offer services to many different kinds of applications..well..then this is a big project in its own. At least thats what I think.
|
|
|
|
|
Logged
|
|
|
|
|
kukanani
|
 |
« Reply #54 on: 06. January 2008, 07:35:58 PM » |
|
Grr...so many opinions...we should just vote...
|
|
|
|
|
Logged
|
xith.setCoolnessLevel(10); jMe.setCoolnessLevel(0); xith.rock();
|
|
|
Pandaemonium
Enjoying the stay
Offline
Posts: 85
If at first you don't succeed; call it version 1.0
|
 |
« Reply #55 on: 06. January 2008, 07:45:33 PM » |
|
Now, if you want to have some network code ready-to-run for any game loop provided by xith, well here is my recommendation: Use project darkstar. @Vincent, afaik, darkstar uses object serialization to achieve it's data persistence. This method of persistence is unacceptable in my application, where I need to have an actual database. Do you know if there's a way to "override" darkstar's persistence layer? I mean, the type of netcode I use heavily depends on the kind of application I'am going to write and doesen't care much about the presentation of it. If i simulate my game with Java2d or with Xith3d won't affect my netcode or server side code. If you guys want to offer services to many different kinds of applications..well..then this is a big project in its own. At least thats what I think.
I've been thinking about this too and I agree with Jonas. However, I've been thinking that the "net" implementation could be its own project called XithNet (or whatever, this is what I'm going to call it  ). Especially since a game server should be able to utilize the net code and only the net code (e.g, the server shouldn't have to ever create an opengl context). Of course, any xith3d based game client could then utilize the XithNet api. No rendering related code should exist in XithNet. The problems solved by XithNet could be: 1) Efficiently handles message transport and be fully configurable (UDP vs. TCP). This can be accomplished by using Mina. 2) Provide a framework for custom data persistence. We shouldn't force users to use object serialization or a database. They should have a choice on what they want to use. This is where imo, Darkstar comes up short. 3) Scalability (being able to use more than 1 server to represent and handle the game world). This is also related to load balancing. Darkstar effectively and efficiently solves this problem, but has the shortcoming explained above.
|
|
|
|
|
Logged
|
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4337
May the 4th, be with you...
|
 |
« Reply #56 on: 06. January 2008, 08:51:38 PM » |
|
Well, XithNet sounds funncy. But actually I wouldn't integrate it with the Xith3D project, but with the JAGaToo one, since this is something, that perfectly matches JAGaToo's goal: providing gaming tools  . Therefore it would never carry any rendering information unless you don't make it to. My (naive) imagination of the net layer (which is, how I would have written it), is the following: I would make it two layered. The first layer is just an API, that takes objects of the types - Serializable/Externalizable
- VMSerializable (This is an interface, that I need to write, which provides some methods to cheaply serialize vecmath2 objects. The vecmath2 classes already have these methods, but without an interface so far).
- primitive types (float, int, etc.)
- arrays of primitive types (especially byte[] / char[])
- Maybe a NetSendable interface, that provides a "netSend( netLayer )" method.
The second layer would be user-defineable and I would only provide a default/example implementation using Xith's Command interface. Maybe I will port it to JAGaToo. Did you ever have a look at the org.xith3d.utility.commands package? Through these commands you could create the following environment: Write a set of command-pairs, where each Command has a unique int-id. Each class of a pair must know its partner. One of the partners is the sender and the other one is the receiver. The execute method of the sender gets its parameters and knows, how to handle them to make them "first-layer-sendable" and passes them to the first-layer carrying the id of the receiver Command. the receiver Command knows, how to handle the data input and will also do, what has to be done with the data to do something in your game (of course it does, since you've written the Command yourself  ). I think, this structure is most flexible is should be able to be integrated with any server- or client-architecture, since you can do, what ever you want within the Command implementations. I would even say, that this kind of architecture could be the only one, since we can provide sets of Command implementations, that automatically integrate it with darkstar or other server environments. What do you say? Please ask, if I wasn't clear about anything. Marvin
|
|
|
|
|
Logged
|
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4337
May the 4th, be with you...
|
 |
« Reply #57 on: 06. January 2008, 09:00:15 PM » |
|
Oh, one thing, that I am not sure about Mina: Mina is quite a basic net-layer, but still needs some lines of code to work and doesn't do anything else than transporting, what you pass to it.
What is its benefit over simply using the built-in Java Classes to create the net-layer, what Mina will do internally? Shouldn't be much more lines of code if it will even be more.
Marvin
|
|
|
|
|
Logged
|
|
|
|
Pandaemonium
Enjoying the stay
Offline
Posts: 85
If at first you don't succeed; call it version 1.0
|
 |
« Reply #58 on: 07. January 2008, 02:44:33 AM » |
|
Oh, one thing, that I am not sure about Mina: Mina is quite a basic net-layer, but still needs some lines of code to work and doesn't do anything else than transporting, what you pass to it.
What is its benefit over simply using the built-in Java Classes to create the net-layer, what Mina will do internally? Shouldn't be much more lines of code if it will even be more.
Marvin
For starters, Mina is blazing fast. I don't have any benchmarks with my own code, but check out: http://mina.apache.org/performance-test-reports.htmlFor features: http://mina.apache.org/features.htmlMina makes it extremely easy to implement the transport layer in an application. It also makes efficient use of a byte buffer. This is surely why it was chosen by the guys at Darkstar. I think, this structure is most flexible is should be able to be integrated with any server- or client-architecture, since you can do, what ever you want within the Command implementations.
I would even say, that this kind of architecture could be the only one, since we can provide sets of Command implementations, that automatically integrate it with darkstar or other server environments. Sounds good to me, though instead of NetSendable, I think I would call the interface Transportable (sounds better to me, and is high level).
|
|
|
|
|
Logged
|
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4337
May the 4th, be with you...
|
 |
« Reply #59 on: 07. January 2008, 02:54:53 AM » |
|
Gotcha! Sounds good to me, though instead of NetSendable, I think I would call the interface Transportable (sounds better to me, and is high level).
OK. Why not. Marvin
|
|
|
|
|
Logged
|
|
|
|
|