New coder - 2D Board Game

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
Ubiq
Posts: 3
Joined: Wed Apr 16, 2014 10:58 pm

New coder - 2D Board Game

Post by Ubiq »

Hey all,

I hope this is the right place for this thread, if it's not, please redirect me.

For the last 6 months I've been wanting to code for fun. At the time my job, while it did involve coding to a degree, was intermittent in the neccessities of writing script and I found myself wanting it scratch this itch of being a hobbyist coder in my off hours. That, and I wanted to bulk up my resume because I wanted to move back to my home state and get a job in the industry.

At the time, it was pretty hard to find people to play this board game I really loved. So I decided to try and tackle the challenge of making it online for my (then-out-of-state) friends to jump on without physically having to be in the same room. The board game is fairly complex but a lot of it is reliant on the player interactions among each other and a neutral threat.

To get to the point: I stumbled on Hall's HTML5+Impact+Node.js tutorials and was wondering if it would be a good engine/framework for this "beginner" project.

Some details about the board game that will influence it's online design:
  • Up to 6 players. But no more. Preferably around 3.
  • Game's AI is simple enough to run independantly without a GM but player-interaction (via in game chat or 3rd party voip) is critical.)
  • Rounds are turned based with a clear progression of who's turn it is but certain cards can be played by another player even it's not their turn. (Allow turn 'interrupting' even though the general gameplay will be based on turns.
  • Needs to hold multiple gamestates, particularly around the use of multiple card decks that players draw from. (Possibly by arrays of 'Card'-typed classes.)
  • No free movement. Players occupy a space unless they opt to occupy another of their choosing at the start of their turn. (i.e. No need for directional movement.)
  • Gamestate should preferably be saved while offline but it's not intended for other players to come and go as they want. (Players are the same from start to finish but can take group breaks.)
  • No collisions are needed. (See no free movement.)
I'm watching the videos now and while I like the concept of browser-based, hardware-agnostic implementation, I just want to make sure that I'm not putting down $99 on an engine that only really does 2d/isometric and can't be modified for a table-top game implementation. (I doubt it would be impossible but I'm open to alternatives that do this better.)

Let me know if you'd like any further details. I've mostly worked with C# and a little javascript but I've always been kind of put off by the like of runtime debugging with JS. (I guess I spoiled on Visual Studio.)

Thanks!

-Ubiq
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: New coder - 2D Board Game

Post by Jackolantern »

I think Impact/Node/Socket.io is the wrong direction. It is a great platform, but I think it is over-kill, and maybe the wrong choice all together. Impact is flexible, but I think a turn-based board game may stretch Impact just an inch too far.

There is an important question: Do you want (near) real-time chat so players can communicate while the game is being played? If so, I would suggest to go with Node and Socket.io for the back-end, and then just make the client in the browser as a webpage. All the pieces for a board game are really already there in the browser: square images for board locations (or larger images if you don't want squares, or don't want cells at all), events for clicking on locations and pieces, etc. In fact, I think it would be easier to make a board game in the DOM (the place where all the pieces to a regular website are kept) rather than doing it in an animated way in Canvas.

If you don't want or need chat, even PHP would work. That is because you can do turn-based multiplayer, like in board games, quite easily just using AJAX. Just check for new moves or to see if it is your move once every few seconds. Since the number of players in a session is limited, you wouldn't have to worry about the wasted bandwidth the way you would have to worry about it for an MMO.
The indelible lord of tl;dr
Ubiq
Posts: 3
Joined: Wed Apr 16, 2014 10:58 pm

Re: New coder - 2D Board Game

Post by Ubiq »

Thanks for the reply Jack. It did seem like overkill but I considered incorporating it now to get a general feel for it and apply it to future projects.

I'll continue investigating node and socket.io though, you're right, wasted bandwidth is a non-issue but I'm trying to temper my exploration into new platforms and technologies with the practicality of existing ones.
User avatar
hallsofvallhalla
Site Admin
Posts: 12031
Joined: Wed Apr 22, 2009 11:29 pm

Re: New coder - 2D Board Game

Post by hallsofvallhalla »

I have been wanting to make a board game through the browser for a long time now. Just no time. Especially something like HeroQuest.

I agree with Jack that if you are wanting to make a simplistic 2d game then it might be overkill. However if you are wanting to make say a HeroQuest remake then it I would use it but I already own it. Its not really to do with Real time or turn based but the simplicity of getting the graphics in and designing the board.

Socket.io might be overkill as if it is plain turn based then ajax would work perfect. However if you are wanting to have live chat and not have to worry about polling for turns and such then Socket.Io would work great.
Ubiq
Posts: 3
Joined: Wed Apr 16, 2014 10:58 pm

Re: New coder - 2D Board Game

Post by Ubiq »

Well the thing it relys on users being able to affect the gameplay even if it's not their turn. I do not require text chat per se, a standard voip running in tandem would be the preferably way to interact as it is a very social game. But there are actions granted by cards that would allow a user to act before their turn. I suppose I could poll for a "window" that these kind of actions would be acceptable but not ideal.
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: New coder - 2D Board Game

Post by Jackolantern »

Ubiq wrote:Well the thing it relys on users being able to affect the gameplay even if it's not their turn. I do not require text chat per se, a standard voip running in tandem would be the preferably way to interact as it is a very social game. But there are actions granted by cards that would allow a user to act before their turn. I suppose I could poll for a "window" that these kind of actions would be acceptable but not ideal.
It would still be doable with PHP, if you just planned out a turn lifecycle sequence.

However, I do think heading in that direction, node + Socket.io would be preferable. You will probably find the single-instance server model to work much better. In PHP, each user runs in isolation and has their own version of the scripts running, and interaction is facilitated by the database. In node, there is only one instance of the scripts running, and it handles all connections. It really eases multiplayer game design :cool:
The indelible lord of tl;dr
Post Reply

Return to “Beginner Help and Support”