Handling minigame rooms
Posted: 30 Mar 2009, 12:38
Hi, I'm trying to code minigames working with openSpace map. The question is how to handle this with respect to joining rooms. The minigame should be initialised after clicking on something on the map(I've got this already). I saw only 2 ways:
1) Create an openSpace "virtual" game room which would be joined, so I would emulate what smartfox does, join the player into the new room. And then over that show some movieClip layer with the actual minigame. It would seem a little odd to me, to play tic tac toe or something to disappear from the park where you stand and join this virtual room just to play tic tac toe. But it would work correctly I guess.
2) More natural approach to me seemed to leave the user standing in the park and also join the minigame room. I'm currently sending a command to the server extension to initialize a minigame room for me(+attach extension). Then I join the player in the room, also from server side. Now of course, smartFox gets onJoinRoom event, so I'm checking if the name of the room is minigame_something, if not it is processed like a normal openSpace room, if it is, it should just diplay the new minigame layer which communicates with smartFox server outside of openSpace. After I close the minigame layer it should just remove the player from the dynamic smartfox room and I should be able to continue walking on openSpace map.
Now my questions:
1) Not sure if its right to display another layer with minigame over openSpace(while it is still "active"), wouldn't that mean performance problems?
2) The main problem, after I join the minigame room on the server(and even I see in my admin panel that the user is in BOTH rooms, eg. the "map" room and the "minigame" room), other people see the user joining also the minigame being deleted from openSpace(it shows "removing user id ..."). When that other user now present in 2 rooms tries to move on openSpace map, he is recreated again, but doesn't move, can't chat etc. From the users perspective the user can walk normally but can't chat also. Seems like the user is not really in the room anymore?
1) Create an openSpace "virtual" game room which would be joined, so I would emulate what smartfox does, join the player into the new room. And then over that show some movieClip layer with the actual minigame. It would seem a little odd to me, to play tic tac toe or something to disappear from the park where you stand and join this virtual room just to play tic tac toe. But it would work correctly I guess.
2) More natural approach to me seemed to leave the user standing in the park and also join the minigame room. I'm currently sending a command to the server extension to initialize a minigame room for me(+attach extension). Then I join the player in the room, also from server side. Now of course, smartFox gets onJoinRoom event, so I'm checking if the name of the room is minigame_something, if not it is processed like a normal openSpace room, if it is, it should just diplay the new minigame layer which communicates with smartFox server outside of openSpace. After I close the minigame layer it should just remove the player from the dynamic smartfox room and I should be able to continue walking on openSpace map.
Now my questions:
1) Not sure if its right to display another layer with minigame over openSpace(while it is still "active"), wouldn't that mean performance problems?
2) The main problem, after I join the minigame room on the server(and even I see in my admin panel that the user is in BOTH rooms, eg. the "map" room and the "minigame" room), other people see the user joining also the minigame being deleted from openSpace(it shows "removing user id ..."). When that other user now present in 2 rooms tries to move on openSpace map, he is recreated again, but doesn't move, can't chat etc. From the users perspective the user can walk normally but can't chat also. Seems like the user is not really in the room anymore?