RMI Good Enough for Java TBS?

Started by
3 comments, last by RobAU78 16 years ago
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!
Advertisement
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?
enum Bool { True, False, FileNotFound };
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"
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).

enum Bool { True, False, FileNotFound };
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!

This topic is closed to new replies.

Advertisement