Tag Archives: game

Dirty Marbles: A Board & Card Game

I was introduced to the board & card game combo Dirty Marbles years ago by friends of the family.  Being a lover of board and card games I fell in love with the game almost instantly.  The game is played using a board similar to the one displayed at the end of this post and a regular deck of 52 playing cards.  Unfortunately I haven’t been able to play in years, though I still talk about the game, due to not having a board.  Thus, I thought it would be an interesting project to develop the game myself with the networking/multiplayer component.  Since this thought first occurred to me back in 2014 I now have different ideas for implementation, like perhaps as an iOS app, Android app and/or desktop application for greater flexibility in play, but also added complexity (mainly because I’m still learning iOS and thus only have a faint idea as to what I would need to do for notifications).

My initial thoughts on a starting point were as follows:

  • Console app first
  • Multiplayer, on a single machine
  • Prints:
    • ‘-‘ for empty slots
    • First letter of colour for player marbles,  followed by num so can choose the one to play???
  • View:
    • P to print board
    • H to print hand contents of human players
    • M to move, ask for card and marble num, move if valid and print board or error message otherwise

Of course that is but the tip of the iceberg and some key features I want to implement include:

  • Graphical User Interface
  • Multiplayer, network play
  • Save/Load Games
  • Difficulty levels (Artificial Intelligence)

Now I am thinking of still getting the logic down first but doing an implementation for iOS and/or a Windows C# application first.  When I will actually get to start this I do not know as I currently have other projects preceding this one.  I don’t expect that I will implement every idea but I wanted to put this one out there, finally as it’s been in draft since 2014, for if I’m ever lacking in projects or have an over abundance of free time. 🙂

Dirty Marbles Board
Dirty Marbles Board

 

If you are curious to check out my most active project right now, which isn’t in the development realm but hands on building, is building a Sig 4 Star 60 which you can check out.

Tron Game

This was a group project in which my role was to handle the networking / multiplayer aspect of the game.  This application implements the Model-View-Controller (MVC) pattern.

The server runs in a thread and handles all client connections.  Each client connection is represented by its own class (Client) which handles sending a message to the individual client and receiving data from a particular client to the server.  Each client runs in its own thread.  The run function listens for messages from a particular client and handles it by the message type.  While the length of the message is less than the message length data is read from the socket and added to a message variable.   A check is done as to where the end of message flag is and adds the overflow into the buffer and then passes the message type and packed message to be processed by the server.

The client runs in a thread and handles all communication between the client and the server.  Interpreting messages received from the server and packing messages prior to sending them to the server.

The server controller runs server side to handle updates from the client and the client server runs client side to handle events from the user interface to be sent to the server as well as to update the view based on messages received from the server.

Figure 1 and 2 show UML diagrams for the key components of the application I worked on, the server and the client respectively.

Tron Server UML Diagram
Figure 1: Tron Server UML Diagram
Tron Client UML Diagram
Figure 2: Tron Client UML Diagram