Multiplayer game applet
843807Nov 5 2007 — edited Nov 5 2007Hi,
I'm currently developping a multiplayer game as a personnal project. I thought of applet as an ideal mean of making this available easily from anywhere.
I designed the game, developped the core game code, and made a quick GUI. Then came the time to plug that together with a communication protocol.
Applets can only connect to the server it was downloaded from. No problem there, I can run the game server on the http server (the DB's there anyway).
I thought about RMI, but my first tests, although totally successful on my LAN, proved a nightmare when crossing the little familiar boundaries of my home network.
So I was wondering about writing my communication code using sockets instead and controlling my own game data frames.
So my question is, from your experience, what would you do to communicate between an applet and a server? RMI or sockets? Is there anything else which I haven't considered?
From what I read, RMI would require me to make the user install a policy file on their local disk, which is out of question.
Most communications will be initiated by the client, hence why I chose RMI, but I would have ideally to make some communications on the other side. Sockets would allow this two way communication, but from what I understood, it wouldn't work using RMI because this would mean for the applet to start a rmiregistry and listen on some ports?
I would really appreciate your input on which way I should head for my communication layer, which pitfalls awaits me and where I can get more details from similar projects.
Thanks!