Game-Extension per Room or per Zone?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
thomers1
Posts: 125
Joined: 13 Aug 2008, 07:36
Contact:

Game-Extension per Room or per Zone?

Postby thomers1 » 13 Jun 2011, 12:41

Carrying on from my last question: what is the recommended way to handle many (hundreds to maybe thousands) game states?

I was thinking about one extension-instance per room, but I see that the BattleFarm example handles this differently (by keeping all game states in ConcurrentHashMap within a single extension instance).

So, I guess what I am asking is - what is the overhead to create one extension per (game) room, rather than one extension per zone?

Best,
Thomas
bart4president.com
Posts: 74
Joined: 23 Mar 2010, 02:35

Postby bart4president.com » 13 Jun 2011, 17:52

It would make sense to have one dedicated controller than many if you have thousands of game states. Since things come in cue, one dedicated extension can feasibly handle all of such actions in a zone. This would have vastly reduced footprint on your server than having thousands of the same instance.

Its just like in flash, its often better to have one onEnterFrame event that controls everything right? Try having thousands of onEnterFrame events and see how much it will slow down your flash.

That's the way I figure it, correct me if I am wrong?

My only concern with this method is dropped messages if you have a turn-based game. Since things are step by step in a turn-based game, one dropped message might break a game somewhere in the system. I am curious if this method is suited for that, or if it should be room specific?
User avatar
thomers1
Posts: 125
Joined: 13 Aug 2008, 07:36
Contact:

Postby thomers1 » 14 Jun 2011, 13:23

lapo, any comments or thoughts?

i'd be interested what is the officially recommended way to do this.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 142 guests