Hi,
User logs in to the zone (custom login) and immediately sends a request to the zone extension for a list of games(rooms). I plan on returning only a hundred.
Ok. Just make sure to create a "landing room" of type Limbo before that. Just-logged-in users are not yet allowed to call extensions, they first need to join a Room.
Limbo Rooms are specifically designed for these types of preliminary tasks such as consulting/search a database of users, registering profiles, setting up one's character etc...
One idea I'm working on since the game is a real time design, is maybe having the client spend a few seconds checking its round trip time. In this way I might be able to group like latency's together for a better experience.
Good idea. The lag monitoring could also go on during the game if you need to adjust any client side parameter according to it.
The server side game logic requires an update tik on a 30 ms timer. I realize that if each room extension was to create a timer task than I think I'm looking at 10k threads which will be no bueno.
30 ms is quite ambitious as it requires that the client has a lag <= 30ms
While this is certainly possible most users are likely to have have a lag time of 50-100ms, so you should probably tune your game for these timings.
50-100ms is still considered good, while 150-200 starts to get bad for real-time as you can get 5-7 updates per second.
As regards the 10K threads... I agree, no good. You would kill even the most performing JVM in a few seconds
I would simply recommend using an ExecutorService backed by a thread pool and shared across all Room extensions. (Java 5 provides a great choice of thread pools)
You might also consider to keep the game logic at Zone Level and govern each game for that Zone in a central place. While it might add a 10-15% extra code it would probably also optimize the general performance quite a lot and simplify the approach to the global thread pool.
The scenario that I'm exploring is to instance a timer task class called Game Manager from the zone extension. I imagine having like 20 Game Manager instances, each responsible for running 500 or so games.
20 threads - no big deal right?
Probably the centralized game logic would simplify this as well.
Hope it helps