EmberJS and Multi-Player Card Games.

Need help with an engine or coding not on the list? Need help with a game or the website and forums here? Direct all questions here.
Post Reply
User avatar
doctor penguin
Posts: 3
Joined: Fri Oct 04, 2013 2:32 am

EmberJS and Multi-Player Card Games.

Post by doctor penguin »

So I'm currently trying to build a multi-player card game (almost like YGO). I already know about nodeJS and socket.io and how to use them.

Up until few days ago, I didn't know anything nor showed an interest in JS Framewroks. But when I took a look at EmberJS, my only response was "Wow.. Everything is easy now..". xD

Anyway, what I'm thinking about is making the list of rooms where players play by EmberJS. Automatically updating the DOM without the need for loops or anything is just what I needed for this. Also, I'm thinking about using EmberJS for my in-game events, like drawing, summoning..etc.

EXAMPLE:
1 - Player "A" hosts a game.
2 - Socket.io sends some info.
3 - EmberJS updates the rooms list immediately.
4 - Player "B" clicks on the room of Player "A"
5 - Player "A" gets a list of people who clicked on the rooms. (i.e. a list of players to choose from).
6 - Player "A" chooses Player "B".
7 - They both get in a room in which they play.
8 - Player "A" plays a card.
9 - Changes must be streamed to Player "B" at the same time but in the right position. (like.. the card appears on opponent's field).

The only issue is, would that be possible via EmberJS AND Socket.io? Won't that make a lot of load on the server? It seems like a lot of work for simple steps..
Thanks. :D
User avatar
hallsofvallhalla
Site Admin
Posts: 12031
Joined: Wed Apr 22, 2009 11:29 pm

Re: EmberJS and Multi-Player Card Games.

Post by hallsofvallhalla »

does not seem like a lot on the server at all.
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: EmberJS and Multi-Player Card Games.

Post by Jackolantern »

I don't think an online card game in almost any form could put much load on the server. If you contrast that with 2D or 3D MMOs where each change of direction and each button press has to be handled by the server, you can see how that would add up orders of magnitude faster. An online card game match would be considered to be "moving at light speed" if the players were making moves every 5 seconds, whereas an MMO may have up to 45 server hits in that same length of time.
The indelible lord of tl;dr
User avatar
doctor penguin
Posts: 3
Joined: Fri Oct 04, 2013 2:32 am

Re: EmberJS and Multi-Player Card Games.

Post by doctor penguin »

Hmm. that makes a lot of sense. But would using EmberJS be better than using plain javascript/jQuery?
It's true that EmberJS does a lot things for me, but I feel all the animations would be implemented more simply using jQuery. =.=
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: EmberJS and Multi-Player Card Games.

Post by Jackolantern »

doctor penguin wrote:Hmm. that makes a lot of sense. But would using EmberJS be better than using plain javascript/jQuery?
It's true that EmberJS does a lot things for me, but I feel all the animations would be implemented more simply using jQuery. =.=
I investigated several JS frameworks for browser game development, but unfortunately EmberJS was not one of them. I looked into AngularJS, Backbone, Spine and KnockoutJS. What I found was that, at least in my humble opinion, these types of frameworks only helped in very specific situations. And those situations were mostly where you wanted to have a "multi-page" app all on one page. If you are not making a SPA (Single-Page App), most JS MVC frameworks are out, because they aren't designed to work for multi-page apps.

And when you consider an online card game, I am not sure a SPA would be the best setup. That is because there are wildly varying GUIs that need to be shown: login/logout, registration, match lobby, deck organization, card trading, dueling, etc. I am not sure you would see a large benefit trying to cram all of these GUIs into a SPA.

If I were making the application, I would make it multi-page and use jQuery and standard JS OOP techniques for organization within scripts.
The indelible lord of tl;dr
User avatar
doctor penguin
Posts: 3
Joined: Fri Oct 04, 2013 2:32 am

Re: EmberJS and Multi-Player Card Games.

Post by doctor penguin »

Jackolantern wrote:
doctor penguin wrote:Hmm. that makes a lot of sense. But would using EmberJS be better than using plain javascript/jQuery?
It's true that EmberJS does a lot things for me, but I feel all the animations would be implemented more simply using jQuery. =.=
I investigated several JS frameworks for browser game development, but unfortunately EmberJS was not one of them. I looked into AngularJS, Backbone, Spine and KnockoutJS. What I found was that, at least in my humble opinion, these types of frameworks only helped in very specific situations. And those situations were mostly where you wanted to have a "multi-page" app all on one page. If you are not making a SPA (Single-Page App), most JS MVC frameworks are out, because they aren't designed to work for multi-page apps.

And when you consider an online card game, I am not sure a SPA would be the best setup. That is because there are wildly varying GUIs that need to be shown: login/logout, registration, match lobby, deck organization, card trading, dueling, etc. I am not sure you would see a large benefit trying to cram all of these GUIs into a SPA.

If I were making the application, I would make it multi-page and use jQuery and standard JS OOP techniques for organization within scripts.
The only issue with that is, when I think of the list of currently active "hosts", I find that EmberJS would do it easily and perfectly well. On the other hand, I don't really need it except for that feature, and some chatting to an extent.

gonna give it a shot either way and try to post back what I get.
I will try making a footer-only layout with the basic tools(constructor, chatting...etc) and then change the other content depending on the route itself(might as well use hidden routes to prevent some un-expected behaviours).
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: EmberJS and Multi-Player Card Games.

Post by Jackolantern »

Yeah, I don't know much about EmberJS. If it fits your needs go for it. If you only need one feature, maybe try checking if there is a modular design that would allow you to only distribute that one feature set.
The indelible lord of tl;dr
Post Reply

Return to “Advanced Help and Support”