 |
|  |
 |
|
rentgen
|
|
Novosibirsk, Russia
Oct 1999 time: 05:13
|
|
Guys,
I've read through this thread and i still don't get it. WHY do you prefer peer2peer to client/server?
How is combat outcome is going to be determined in your model? Specifically, on which machine? Having rmi server running on each machine is a HUGE overhead and RMI is SLOW.
Concerning server crashes -- first, it is possible to write a server that WON'T crush, and even if it does crush it is fairly easy to implement RECOVERY protocol. Do we want Clash to be a GOOD game or just a bunch of code put together? What if one of the players in peer2peer crashes -- not so fun for him/her, and having a recoverable server he can just restart and get the data.
Well, these are just few ideas. If i'm getting something wrong, please enlighten me 
Osiris, about the compiler -- why not use JDK?
Regards,
Anton.
|
|
|  |
 |
|
Osiris
|
|
First off.. I am back!!
wow, back from the underworld parse..
concerning making a chat program, well,
I can make the networking for it.. it would be nice if I can work with a GUI person for that part.. wouldn't be that hard.
Second off.. concerning saying that having a client/server model is more reliable and faster.. well to put it bluntly.. not in my lifetime..
Starcraft has one of the best Multiplayer designs I have EVER seen, and it has a peer to peer model. and it would be a LOT easier to make a recovery protocol with a peer to peer, now yes for each computer it takes a bit more processing, BUT it takes a lot less on the server, because there really isn't one, basically its not really peer to peer, its server to server, and every machine is a server(except when you are setting up the game) but when you launch the game then every host becomes a server and the person that started the game no longer matters.
|
|
|  |
 |
|
robin
|
|
Reading, Berks, UK
Oct 2000 time: 05:13
|
|
quote:

Second off.. concerning saying that having a client/server model is more reliable and faster.. well to put it bluntly.. not in my lifetime..
 |
What?? Cuss you've never had more than two clients??
quote:

Starcraft has one of the best Multiplayer designs I have EVER seen, and it has a peer to peer model.
 |
& a v.heavy client comms setup. It maybe fast, but it rips the guts out of your system!
quote:

and it would be a LOT easier to make a recovery protocol with a peer to peer, now yes for each computer it takes a bit more processing, BUT it takes a lot less on the server, because there really isn't one,
 |
..easier recovery system - WHAT, THIS JUST ISN'T TRUE!
Peer to peer recovery MUST be harder (than a Server/Client one), since the server (in the client/server setup) knows nothing ~ the client, thus won't care if connection is lost (cuss it was never static), where as, a peer to peer network will 'see' the loss of a client and this must be handled (to avoid errors when you try to send/recive packets from it)
quote:

basically its not really peer to peer, its server to server, and every machine is a server(except when you are setting up the game) but when you launch the game then every host becomes a server and the person that started the game no longer matters.
 |
You are _never_ going to get a way without a server, peer to peer like this with high volumes of traffic just won't work! Each client would need to store all other clients addresses and keeps comms open (even if you reinvoke), then if you thread each comm agent, wow thats gona kill most OS's for even the smallest # of clients!
Peer to Peer is better with a v.small set of clients. Server to client is a MUST FOR ALL SERIOUS networked relationships.
AND (on a unrelated post)....
Object _can_ be resolved even if you don't know their type @ design time (using Class.forName etc)!
|
|
|  |
 |
|
F_Smith
|
|
Austin, Tx 78728
May 1999 time: 05:13
|
|
For what it's worth, I absolutely favor a 'client/server' approach -- or, more accurately, I favor a 3-tiered approach, with the game engine running on a server, the game's Interface running on the client, and a 'middle-tier' server that interfaces between the two (which in a perfect world would be on a seperate machine/group of machines).
This is how the game is currently planned. A 'database' server for the game engine code, a servlet-based middle tier running on it's own server (or many servers, for balancing the load, if/when traffic becomes heavy). And an 'applet' front-end.
The applet and servlet will communicate thru a socket.
Does this sound reasonable? Any suggestions/corrections?
|
|
|  |
 |
|
Mark_Everson
|
 |
Canton, MI
Jan 1970 time: 00:13
|
|
robin:
An official welcome to the project .
I'm really glad you brought this thread back to life!
I think getting MP up fast is very important, because that way we can defer the AI till later and still really test out the game elements. So its great this is where you want to work, very timely.
All:
On the specifics... It looks like we need something thats scalable up to lots of players if F_Smith is to have his mega-game vision which does sound fun as an alternative. So that says client/server to me. But we need to make it so somebody's PC can be the server for a small game. So long as that can be achieved I'll be happy, and accept whatever the pros say.
Another issue to keep in mind, is with the complicated models there will be a lot of BW needed to send the info back and forth. For MP we may eventually need to cut down the model detail, at least until everyone has a hi-BW connection. F_Smith is convinced its not a problem (I hope I'm characterizing this correctly) while I'm not so sure about that. Anyway, for background info, I'd ideally like the turns to take max 10s to execute in 'streaming' mode, including all the communication that will go on. So all the info that needs to be there for each turn needs to take something like 2-3 sec Max. Thoughts on this?
One more thing. I would Really like to use the clients, at least those with enough muscle, to run AI processes also. My AI concept allows parallel processing, and the more computational power we can give the AI, the better it will be.
[This message has been edited by Mark_Everson (edited October 18, 2000).]
|
|
|  |
 |
|
Richard Bruns
|
|
NC, USA
Nov 1999 time: 06:13
|
|
Obviously I don't know about this programming aspect, but I do know about how the models interact with each other so I thought I'd throw out an idea:
If we do them right, the models will be "black boxes" that crunch numbers internally and then send a smaller amount to info to the other models. Could we fix things so that each machine is responsible for number-crunching a particular model? FE one computer could run the ecology and disasters model, another could run all the technology models, and so on. That way, the CPU and memory load is split up and less data has to be transmitted. The computers only need to share the data that has a direct effect on other models.
I'd also like to welcome robin. We need all the technical expertise we can get.
|
|
|  |
 |
|
robin
|
|
Reading, Berks, UK
Oct 2000 time: 05:13
|
|
quote:

Originally posted by F_Smith on 10-18-2000 11:42 AM
This is how the game is currently planned. A 'database' server for the game engine code, a servlet-based middle tier running on it's own server (or many servers, for balancing the load, if/when traffic becomes heavy). And an 'applet' front-end.
 |
Yea, although the databases server initially doesn't have to be on a different box. The database to servlet/server relationship is no problems as most DBH's can easily handle changes in db host (and port for that matter)! I would suggest Mysql as its free, well supported (i have a good Mysql Java dbh (database handle) if anyone needs one!) and will run on most platforms (even windows?).
Its such a joy to find a project working on java clients, @ last a chance to ditch those expensive (costing time) protocol routines, and get down to just parsing objects 
A (quick) note ~ client/server security:
The golden rule, even if you aren't worried ~ security, never, never let the client send sql statements to the server! A better way maybe to _loosely_ model the RMI system, basically only allow clients to call predefined functions.
You can setup an SSL (Secure Socket Layer) and encrypt each packet, but the dividend is performance, mostly on the server side. A less costly approach is to sign the clients, so that the server can identify them and allow packets. But this does mean that potentially someone could see the content of each packet (so no sending credit card info etc.).
(PS. (on a pedantic point) isn't it so, that, server side java is only called a servlet if it implements the HTTP protocol (i.e. a java cgi)??)
|
|
|  |
 |
|
F_Smith
|
|
Austin, Tx 78728
May 1999 time: 05:13
|
|
Mark:
Bandwidth can be a problem, but I think we easily can get around it by only sending the variables in 'gamedata' that change back to the clients.
* * *
robin:
Absolutely, you are correct. The db does not need it's own box until traffic gets heavy.
I use Oracle 8i at work, just storing everything as a blob. They say Oracle promises that 9i, which is 100% java, will outperform any other database by 3 times or else they'll give you a million $$s. Have you heard that yet?
Sounds incredible, to me.
I agree about only using canned routines. SQL direct from client to server is only for DB programmers!
And I don't really trust them, all the time . . .
Yes, a 'servlet' is just a java 'cgi'. It's a specific type of server-side program designed to be used with a webserver. A 'stand-alone' server, like a 'chat' server, is not a 'servlet'. They're excellent, the little differences are astounding.
|
|
|  |
 |
|
robin
|
|
Reading, Berks, UK
Oct 2000 time: 05:13
|
|
quote:

I use Oracle 8i at work, just storing everything as a blob. They say Oracle promises that 9i, which is 100% java, will outperform any other database by 3 times or else they'll give you a million $$s. Have you heard that yet?
Sounds incredible, to me.
 |
incredible, maybe the million would pay for all the licenses we would need 
blobs are a wonderful things but they aren't very efficient. You can't index a blob (so selects are slower), and i have a sneaky suspicion that they are stored _like_ filez so that there is a IO weight to each transaction!
I haven't ever played with Oracle, but i guess that any DB can be used if the DBH is well enough defined.
I'm assuming that the server platform will be a flavor of Unix and not an M$ product, dispute the client been windowz only (which is something that i think needs to be looked @)....
quote:

Yes, a 'servlet' is just a java 'cgi'. It's a specific type of server-side program designed to be used with a webserver. A 'stand-alone' server, like a 'chat' server, is not a 'servlet'. They're excellent, the little differences are astounding.
 |
Ah, yes my favorite replacement to all my perl code. But the http protocol is a higher level (ISO) than socket comms...
Do you have a database schema you could share with me??
[This message has been edited by robin (edited October 20, 2000).]
|
|
|  |
 |
|
robin
|
|
Reading, Berks, UK
Oct 2000 time: 05:13
|
|
quote:

Originally posted by Bernd Wieboldt on 10-22-2000 03:19 PM
No. Servlets generally allow any service to be implemented, just use
javax.servlet.GenericServlet or
javax.servlet.Servlet instead of javax.servlet.http.HttpServlet.
 |
Yep, but why would anyone want the extra load of implementing stuff their not going to use. One of the main points to servlets is that they can listen/write to the cgi stream (they can be launched, triggured exec, from a URL (well the web server really)), with all the stream handling taken care of. GenericServlet and Servlet are there to allow you to implement your own protocol over the stream.
Its not going to do us any good to use any servlet classes cuss we won't be using a global request server (such as apache).
quote:

One question: why are you squabbling over platforms? The biggest advantage of Java is IMHO platform independence. There are even databases that are available for both Windows boxes and Linux boxes (I have Adabas D running with Star Office 5.2 on my machine; it's even free). So, if implemented correctly, client and server shouldn't need to know what machine they're running on (at least in theory).
 |
Yea, but its over development platform i'm squabbling ~ (not that everyone needs to use the same OS through).
|
|
|  |
 |
|
F_Smith
|
|
Austin, Tx 78728
May 1999 time: 05:13
|
|
Hi, Guys:
Absolutely we should extend HTTPServlet, I think.
And I also don't mind using the Unix shell, but I've got to warn you, I'm a Unix idiot. But I definitely am interested in gaining some working knowledge, so this is great. I just bought a copy of Red Hat Linux, and am going to install it on an old machine next week, at work, for the experience, and for a test bed.
That will help me here, won't it? Or am I mistaken?
|
|
|  |
 |
|
robin
|
|
Reading, Berks, UK
Oct 2000 time: 05:13
|
|
quote:

Originally posted by F_Smith on 10-28-2000 12:16 PM
Hi, Guys:
Absolutely we should extend HTTPServlet, I think.
 |
NO, NO, NO, if you extend _any_ servlet class you _must_ use a webserver to fire them off, this means having to handle cgi/http streams (both in client & server). What we are trying to build is a _server_ (like apache, gets socket requests and replies on that socket (with http packets in this case)), and hads a main method just like a normal java program.
NB. Sorry i've been silent for a while (this is due to my house been flooded by the river Kennet).
|
|
|  |
 |
|
F_Smith
|
|
Austin, Tx 78728
May 1999 time: 05:13
|
|
Robin:
I'm sorry, I don't understand.
Why do we want to build our own server, instead of using a servlet?
We'll need to use a web server -- I like the Java Web Sever, personally, of course. But isn't that better than having to write all that server code ourselves? I don't understand the gain of using sockets in this case. I was thinking we'd be using doGet and doPost to pass data to the servlet, and just printing any response data (serialized) to the HTTPServletResponse, via a PrintWriter.
Are there reasons this would not work?
I've written a chat server and applet, it runs on our internal Project Office web page and gets used regularly. I've got the code for that, if we absolutely need to build our own server.
And later, I was absolutely hoping to migrate to a Bean architecture, which will absolutely require an App Server. Does this sound like a good idea?
|
|
|  |
 |
|
Bernd Wieboldt
|
|
Frankfurt/Hessen/Germany
Oct 2000 time: 05:13
|
|
Hi guys,
quote:

Originally posted by robin on 11-01-2000 08:02 AM
NO, NO, NO, if you extend _any_ servlet class you _must_ use a webserver to fire them off, this means having to handle cgi/http streams (both in client & server). What we are trying to build is a _server_ (like apache, gets socket requests and replies on that socket (with http packets in this case)), and hads a main method just like a normal java program.
 |
Another question: is the protocol that clash clients and servers will use to communicate already defined?
This definition has - in my opinion - a higher priority than the question about how to implement it. Before this definition is made, we just can't decide which way of implementation is used best. Maybe we decide to use servlets, make our definition and see we'll need a customized web server. To prevent this, we should *first* think about how clients and servers communicate and *after that* decide how to implement that.
If this definition is already made, I would be glad to be given a link to it (or get a mail with i).
|
|
|  |
 |
|
robin
|
|
Reading, Berks, UK
Oct 2000 time: 05:13
|
|
quote:

We'll need to use a web server -- I like the Java Web Sever, personally, of course. But isn't that better than having to write all that server code ourselves? I don't understand the gain of using sockets in this case.
 |
Well think of what the web server is actually doing. It takes socket requests from clients (you with your browser) and loads the requested (usual a file, of a file stream i.e. a CGI program), then sends that resource back down the socket to you. In-between those transactions are conversions to and from the http protocol. Well we don't want to use the http protocol cuss it would require object string parsing (heavy) and why take the extra load of a web server just to avoid socket routines?
quote:

I was thinking we'd be using doGet and doPost to pass data to the servlet, and just printing any response data (serialized) to the HTTPServletResponse, via a PrintWriter.
Are there reasons this would not work?
 |
No, but you could do that faster in perl 
quote:

And later, I was absolutely hoping to migrate to a Bean architecture, which will absolutely require an App Server. Does this sound like a good idea?
 |
Yes, I like this idea, do you think we could use beans to have a kind of 'plug-in' data processing, with the beans carrying the AI etc routines (bit I'm currently think Jini would do a better job of this)?
|
|
|  |
 |
|  |
 |
|
Bernd Wieboldt
|
|
Frankfurt/Hessen/Germany
Oct 2000 time: 05:13
|
|
quote:

Originally posted by robin on 11-04-2000 11:31 AM
I'g agree, but was thinking that since the client will be java, we can just send objects (i.e. without protocol) since its dead easy for the client to define the _type_ of an object.
 |
Perhaps I was not completely exact in what I wanted to say. I didn't want us to decide wether to use HTTP or something else. I wanted to know if it's already defined what data are to be exchanged, how this data are summarized in the 'sender' client, how they are brought into play in the 'receiver' clients and so on. It would fit nicely if the summarized data had the same form like the AI output, since we just had to give the data to Mark (sorry, to the 'executive part' of the AI). So, do we know what data to transfer? Do we know how to summarize them? Do we have a 'floor plan' which tells us where we have to collect them? I see models which produce the same data for all players, for example map generator and disasters: all players will play on one map and all players will see the same disasters in the same place (even to the canadians Chernobyl is clearly in what used to be the USSR). Will this parts run on one client, the server or someway else?
That is, in my eyes, more important than to decide at what OSI layer we transfer them. I agree with you in that it is pointless to do any data unneccessary protocol converions ourselves, for example encoding the content of an object into an HTTP stream. Sockets allow us to conveniently communicate from layer four to layer four, so using them (and avoiding full three layers of the model which are occupied by HTTP) seems OK to me.
Our next task should be completing the above list of questions and answering them. If this is done, we can look at our informations and decide if we are ready to start coding. If we are, we can decide what to code. Since there is no 'true' answer at the moment, the ongoing discussion is to be placed at that point. In my eyes, of course.
|
|
|  |
 |
|
F_Smith
|
|
Austin, Tx 78728
May 1999 time: 05:13
|
|
The http protocol is plenty fast enough for our purposes, isn't it? I've got some servlets doing heavy doPost parsing, and its very, very fast. The parsing delay is only a few dozen milliseconds.
I agree that there it might be possible to get slightly faster response time using some other methods, but the Web Server actually does more than just manage the socket connection, giving us other features that will be big bonuses for enhancement -- like session tracking and Bean managment.
From what I understand of 'Jini', it's design for running on small hand-held devices. I'm not sure I understand why it would be useful for the AI. Can you help me out with that?
I was thinking RMI and/or Corba, perhaps. RMI Allows us to use the processor on the client to actually process the AI methods on the client.
|
|
|  |
 |
|
F_Smith
|
|
Austin, Tx 78728
May 1999 time: 05:13
|
|
Bernd:
Yes and no.
The game data will all be held in a single object called 'GameData', which will be shared by all players.
The idea I was working with at this point is that the clients build 'TurnHandler' objects from all the orders given by the player. We then send that data to the servlet via a doPost. The servlet processes the turn, applying the turn orders to the game database, and then builds a new 'GameData' object, then serializes back out to the client the new 'GameData' object.
Does this sound workable?
|
|
|  |
 |
|
Bernd Wieboldt
|
|
Frankfurt/Hessen/Germany
Oct 2000 time: 05:13
|
|
Am I right in understanding that all the turn handling will be done in the server? If so, will all commands be sent to the server, enabling all players acting together, or will a full turn be sent to the server, most certainly forcing all players to make thrie moves separately? Two more questions for the list. I still have no access to the cvs repository (but already sent my key to robin), so excuse me if I ask a silly question: are you alredy at the point where I would place the ongoing discussion about which protocols to be used? If not, do you both agree in the way I suggested us to work?
|
|
|  |
 |
|
Bernd Wieboldt
|
|
Frankfurt/Hessen/Germany
Oct 2000 time: 05:13
|
|
I'm sorry I left it out in my first reply, yes, it sounds workable.
|
|
|  |
 |
|
robin
|
|
Reading, Berks, UK
Oct 2000 time: 05:13
|
|
quote:

The http protocol is plenty fast enough for our purposes, isn't it? I've got some servlets doing heavy doPost parsing, and its very, very fast. The parsing delay is only a few dozen milliseconds.
 |
-The communication relationship is wrong; (generally) webservers tie up the socket port. Clients are required to wait for a response from the server. When handling simultaneous updates from multiple clients this delay becomes a bottleneck.
-If we used a webserver the whole game server would be threaded for each request, this would be very heavy.
-Not all systems easily support webservers.
quote:

I agree that there it might be possible to get slightly faster response time using some other methods, but the Web Server actually does more than just manage the socket connection, giving us other features that will be big bonuses for enhancement -- like session tracking and Bean managment.
 |
All of which sould be doen via reflection classes.
quote:

From what I understand of 'Jini', it's design for running on small hand-held devices. I'm not sure I understand why it would be useful for the AI. Can you help me out with that?
 |
Jini uses a sub set of Java, a foot print if you will. It is light and optimised. Basically it allows the formation of a generic-processing network. It's a little complex, but the idea is that we have a core of Jini functions attached to a RMI server with access to the database server. Then We can 'plug-in' functions as they are defined (both background and client request).
This help AI, because you can use it to defines a backbone for distributed processing, allowing us to handle very complex models away from the main game data processing (i.e. we could have a sub set of clients simulate a years weather data).
quote:

I was thinking RMI and/or Corba, perhaps. RMI Allows us to use the processor on the client to actually process the AI methods on the client.
 |
Jini is based on and incorporates CORBA/RMI.
|
|
|  |
 |
|  |
 |
|  |
 |
|
robin
|
|
Reading, Berks, UK
Oct 2000 time: 05:13
|
|
I have added all code that i have to the cvs repository, i need a copy of the current client code (@ whatever state its @). People really now need to be using cvs so that we all have a current copy of the code, please send me you keys or i will make you one and send it to you (instructions on cvs can be found @ www.clash.ukshells.co.uk).
Is there any code documentation for the client, is it worth having a policy on this??
I guess its worth having some design diagrams so people know what object does what, any preferences over format (SSADM??)?
For now, i think we should just get the server doing the two basic functions (recording movement, resolving conflict).
Basic flow:
Client: completes turn, user hits 'End turn button';
Client: Send object* containing the position of all units, status of citys and conflicts this client has _caused_*;
Server: Get Turn packet (TurnPacket);
Server: if have TurnPacket from all clients, start turn processing***;
Server: Turn processing....
Client: Request new world data packet;
Server: if TrunProcessing complete, sent WorldPacket else refuse request;
Server: Send deny;
Client: Wait b4 trying again;
Server: Turn processing....
Server: Turn processing complete;
Client: Request new world data packet;
Server: if TrunProcessing complete, sent WorldPacket else refuse request;
Server: Send WorldPacket;
Client: get WorldPacket;
Client: update map;
* Example object format (PS this is an _example_ please don't comment on syntax!):
public class TurnPacket implements Serializable
{
Vector unitPositions = new Vector(); //vector of {object unit}.
Hashtable cityStatus = new HashTable(); //hash of {cityID}->{object city}.
Vector conflict = new Vector(); //vector of conflict object.
}
public class Unit implements Serializable
{
int unitUniqueID; //an unique id assigned to each unit, defined by client: clientID.unitID
Position unitPosition; //where on the map the unit is (now).
}
public class CityStatus implements Serializable
{
int cityUniqueID; //unique city ID defined by the client: clientID.cityID
CityData cityData; //city data??
}
public class Conflict implements Serializable
{
int unitUniqueID; //same as Unit.unitUniqueID
Position position; //disputed map position
}
** A client causes a conflict by moving a unit onto the same position as another non-allied players unit or city.
The conflict is only valid if the other players unit or city is still in the same place @ the end of turn (i.e. all players will be moved b4 resolving conflict! If two non-allied players collide @ end of turn (you moved you unit to the same place as another player) then a conflict occurs.
*** Turn routines not yet defined!
**** Example WorldPacket format (PS this is an _example_ please don't comment on syntax!):
public class WorldPacket implements Serializable
{
Vector unitPositions = new Vector(); //vector of _all_ {object unit}.
Hashtable cityStatus = new HashTable(); //hash of _all_ {cityID}->{object city}.
Vector resolvedConflicts = new Vector(); //vector of conflict results.
}
public class ResolvedConflicts implements Serializable
{
int unitUniqueID; //same as Unit.unitUniqueID
Position position; //disputed map position
boolean survived; //is this unit still alive?
}
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:13. Apolyton Time is 00:13. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|