Sign in to follow this  

RMI Good Enough for Java TBS?

This topic is 3551 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone, I'm working (slowly!) on a Java-based clone of the original Master of Orion, a space-based TBS game. One feature I'd like to add is multiplayer support. It would be nice to be able to put in this feature as seamlessly as possible. This brings me to Java RMI. It allows one to implement distributed objects with very little effort (compared to more traditional methods). However, I'm concerned about its performance. While the performance requirements for a TBS game aren't as strenuous as for an RTS, I'm not sure if using RMI will meet even these lower expectations. Has anyone here worked with RMI before? If so, what kind of performance have you seen? Would it be good enough for a TBS game? Thanks in advance for your replies!

Share this post


Link to post
Share on other sites
I wouldn't worry about performance, as long as your method invocation is not blocking the main game/GUI loop.
However, I would worry about security -- are you sure that you can secure both the server and the clients such that a malicious user couldn't screw with the other machine?

Share this post


Link to post
Share on other sites
From what I've read, you can install a Java Security Manager in your RMI setup. Otherwise, RMI will not download objects that are not on the local class path. Source: http://java.sun.com/docs/books/tutorial/rmi/implementing.html "Creating and Installing a Security Manager"

Share this post


Link to post
Share on other sites
Quote:
you can install a Java Security Manager in your RMI setup


The problem is somewhat harder than that. You have to make sure that players CAN introduce objects with states that are part of the rules, but cannot introduce objects or states that are not part of the rules. I'm sure the problem can be solved, even when you have untrusted players, but it's a problem that needs very careful attention.

By contrast, a traditional messaging method already has that problem solved, because message validation is easy and well-known (and close to automatic in most systems).

Share this post


Link to post
Share on other sites
Looking back, I should have mentioned this earlier, but I was really just wondering whether Java RMI would be fast enough for a TBS game. It sounds like it would be, from what you wrote. You did raise some good points about managing security in RMI, and I will look into them. Thanks!

Share this post


Link to post
Share on other sites

This topic is 3551 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this