voluspa / yggdrasil

server portion
0 stars 1 forks source link

Multiple games #16

Open matthewphilyaw opened 8 years ago

matthewphilyaw commented 8 years ago

I believe it would be trivial to add the ability to select a game to play, and us support multiple games. If we go ahead and tackle this now I think it will set this up nicely to be a platform and keep us from doing too many global things.

This can all be supported by one ui screen where the user issues commands, no need for multiple pages or anything.

matthewphilyaw commented 8 years ago

I think we could easily do by making the following modifications to the GameChannel module

For the PlayerChannel I think we can do this

The client changes would be minimal I think and the transition between channels would be transparent to the user.

This will pipe the game_id around and if we only have one game it's ok but it's there and we don't have global modules that assume there is only one game etc - then we have a platform/engine that the build tools can be layered on to.

matthewphilyaw commented 8 years ago

https://github.com/voluspa/yggdrasil/commit/99252b584ea3e82b04d27d83623d99175a4646ca

Quick example of what I mean, the client here doesn't join the player channel, but does log the join_event from the game channel which contains the channel to connect to. Didn't have time to finish it out completely. Just an example of what I had in mind.

client does work though, so if you type list games it will, and join 1, for example will log the response. Games are also just hard coded for now.

copenhas commented 8 years ago

Ok, a lot to digest here. I think I got the gist of what you are talking about. I would prefer that that web app side shows the game list and gives info on them. Everything doesn't have to go through the client and be command based. I think most users would rather browse a list and click or hover on links/buttons to get info and descriptions. The user could click a join button for the game to jump to the client which will receive the game_id for which one was chosen. Everything else sounds reasonable. We pass the game_id for all the topics.

matthewphilyaw commented 8 years ago

Yeah, that is good point. Kind of a console addict :) the api could return a list of games by all means and the user clicks into the one they want to play.

I mocked up the game stuff, but can be ignored was just trying to express it in code it was how I was thinking at the moment.

copenhas commented 8 years ago

Ha, yeah no problem. I'm thinking that using ember directly outside of the client would make rendering some content easier and richer.

matthewphilyaw commented 8 years ago

So with that in mind I think it would really be more like:

I'm not sure we need "game:lobby" anymore if we went that route, I think game:[game_id] would suffice and scope events to each game.

copenhas commented 8 years ago

Yeah I agree. "game:lobby" was partly from following the chat tutorial. The topic is more for broadcasted messages. Hell it could be dropped all together. Maybe we only need "player#game_id#user_id" or something.

On Jan 17, 2016, at 10:34 AM, Matthew Philyaw notifications@github.com wrote:

So with that in mind I think it would really be more like:

the user logs in navigates to some page that makes an api call to list the available games the user selects one the client then can connect up it connects to game:[game_id] for game level events which returns player channel it connects to given player channel that the game channel returned I'm not sure we need "game:lobby" anymore if we went that route, I think game:[game_id] would suffice and scope events to each game.

— Reply to this email directly or view it on GitHub.

matthewphilyaw commented 8 years ago

The client is fully capable in this model to connect directly to player:game_id#player_id, so maybe we start there and add back in game:game_id when we need it. I think this channel would only be used if we had a in game chat, but honestly probably be cleaner if it was chat:chat_id.

if we needed to support game level chat then chat_id is the game_id, if we wanted to have private chats then we could issue uuid's that gets distributed to the parties wanting to chat and they connect there.

I'm starting to see where we could have multiple channels with one task and we can scope it either by user, groups games or what ever.