How to Design a Distributed 2-Player Tic Tac Toe Game?

  • Thread starter Thread starter FrostScYthe
  • Start date Start date
  • Tags Tags
    Designing
Click For Summary
The discussion revolves around designing a distributed Tic Tac Toe game, with various suggestions on implementation. A key recommendation is to use a server-based architecture to avoid complications with firewalls and NAT issues common in peer-to-peer connections. The server can be web-driven, utilizing technologies like PHP or ASP, while the client-side can be developed using JavaScript with AJAX or Flash for a more engaging interface. The server would manage user connections and game state, allowing clients to communicate their moves and receive updates through periodic queries. Some participants suggest that using tools like GameMaker can simplify the process, while others advocate for a more hands-on approach using Python and Tkinter for learning purposes. The conversation emphasizes the importance of considering networking challenges and the potential for creating a fully functional multiplayer experience with accessible web technologies.
FrostScYthe
Messages
80
Reaction score
0
Hi everyone,

I have to design a distributed game of Tic Tac Toe. I have to basically write what would be a good way to design this, but I really don't know much about this stuff, I'd be grateful if some of you could give me some design ideas.

Thanks in advance.
 
Last edited:
Technology news on Phys.org
A great, and easy to use, program is Gamemaker. If you pay $20 for the registered version you can get even better stuff. Anyways, its easy to use, fun, and can include programming in the reg. version. There is also very simple graphical programming, done by dragging icons for commands into position.
 
The interface is basic. The functionality is simple turn based action. The only design consideration is in the networking/communication side. For anything multiuser you always have the options of using client-to-client connections or server based. Unless the players are inside the same local network i would go with server based because Firewalls and NAT usually get in the way (you see this a lot in P2P apps).

For a server based tic-tac-toe i would have it be web-page driven - not required but there are no disadvantages. Use a server-side technology like PHP or ASP for the server, or build a game server with JAVA/C/C++, or use existing servers like the Flash Communication Server (if you're using flash at the client).

For the clients, since the game is so simple, i would use javascript with AJAX or possibly Flash to make a more appealing interface - no Java. Silverlight is now also an option - very much like flash but simpler - it's XML based.

The javascript/flash/silverlight client, running on a user's browsers connects to the server. The server keeps track of users and game tables. When two users are joined in a game the clients use AJAX (or the flash xmlSocket/loadVars depending on implementation) to query the server every x seconds to get any new messages from the other user, or the other user's game move, or to check if it's the user's round yet. When a user makes a move, the client tells the server what the move was, the server keeps the move in memory and passes it to the other client whenever it does the next of it's x-per-second queries. And so on.
 
Last edited:
Good lord, -Job-, that's incredible overkill.

An hour with Python and Tkinter or wxPython would be more than enough to write a basic networked tic-tac-toe client. No need for a server or database engine...

- Warren
 
Multiuser? With a client-2-client connection you'll have firewall and NAT issues. For example if you're within your University's network and would like to play a game with someone on the exterior. How do you suggest you get around this without getting into more complex programming or using an existing server or P2P framework (like JXTA)? As far as a multi-user game goes web-based is actually the simpler option - a little bit of Ajax and PHP/ASP and you have a fully working solution.

I bet i could put together a multiuser tic-tac-toe in Ajax/ASP faster than you can write it in Python and it would be more compatible and accessible.

It may sound like overkill - but if you're doing this with the purpose of learning then there's no sense in taking shortcuts.
 
Last edited:
Well, -Job-, he didn't tell us anything about his intentions -- particularly whether or not he intended the program to be able to be used across firewalls or NAT. :smile:

- Warren
 
Seriously, check out gamemaker, with the registered version you can make multiplayer games, even network or peer to peer type.
 
chroot said:
Well, -Job-, he didn't tell us anything about his intentions -- particularly whether or not he intended the program to be able to be used across firewalls or NAT. :smile:

- Warren

Why would i not mention firewall/nat issues when someone asks specifically on the design aspects of a multiplayer game as simple as tic-tac-toe? Should i have focused instead on how big the cells should be, or how to draw the window?
 
-Job- said:
The javascript/flash/silverlight client, running on a user's browsers connects to the server. The server keeps track of users and game tables. When two users are joined in a game the clients use AJAX (or the flash xmlSocket/loadVars depending on implementation) to query the server every x seconds to get any new messages from the other user, or the other user's game move, or to check if it's the user's round yet. When a user makes a move, the client tells the server what the move was, the server keeps the move in memory and passes it to the other client whenever it does the next of it's x-per-second queries. And so on.



Hello, Job! I'm from Kazakhstan!
I'm writing network game, like tic-tac-toe, called Points. The game technology works like you written above. (I use php, JavaScript and Ajax). Can you help me how to keep data in the server side.
I'm looking forward hearing from you!
My e-mail is saule2007@gmail.com.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 195 ·
7
Replies
195
Views
24K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
10
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K