Initial Design Idea
Austin Lam and Ashley Boylan plan to make the popular board game named Trouble. We thought this would be a good 3D model to create because of the challenge to make it. It will require us to use for loops and modules to reproduce parts of the board. In addition, it would be fun to make a game to incorporate more players, so you can play with more friends. Austin is a Computer Science major, and Ashley has minimal coding experience besides one coding class she took at JMU. Austin will learn to incorporate mathematical equations to be change the board per players and spots per shape. This will be learned through finding the geometry equations online to see if they successfully work in the code. Ashley will learn how to code to be able to help create the 3D board game. She will learn through watching YouTube videos and through Austin’s help. She is a mathematics major, so she can contribute to the math side of coding to construct the board game.
Below is a picture of the game board we are trying to make.
Picture credits from this website
The above picture of the code is an original draft of our code. The original code made the board using the formula side = 2*r*sin(180/n) where r was the radius (“boardDiameter”) and n is the number of players (“numPlayers”). For “module path(numSpots, sideLength),” it originally calculated the pegs per side of the board based off the number of players. Thus, the pegs would outline the perimeter of the board – as pictured above but not yet translated to the length of the square board. However, it’s now going to be changed to the pegs starting in the corners to generate the outside path instead. The “module spot()” outputs the pegs for the board because we are taking away a small circle from a bigger circle.
The second change for the game is going to be incorporating the start and end positions, so we need to create the code to generate the inside path leading to the middle of the board – which is not incorporated in the screenshot above since we did not write it yet.
Above is the new code with the revisions of the path for the pegs now calculated from the corners of the game board with the other two corners missing for the square. And, it also produces the path towards the center of the board to win the game.
First Draft Print
The draft came out a success. The main purpose of our draft was to briefly check the alignment of the pegs/spots for the pathway along the game board. Each spot came out evenly spaced from one another as we have programmed. We learned that we can now encapsulate the corner of the board for each player and all we have to do is call the same method and rotate it depending on a set of variables the user inputs to shape the overall board. We may need to change the board set up for the home pegs as if the number of pieces increases, it may run off the board. We also need to implement the rotations according to the board shape and size and may need to print the game at a larger scale to ensure it holds pieces.
The user can modify four parameters: the diameter of the board, the number of spots per corner, the number of pieces the players have to move, and the size of the spots to hold the pieces. The code above sets the parameters for each of those 4 things that the user can modify. The user can select to have between 3-5 pieces and spots to be between 2-5 in diameter. Because the board must be able to hold all the spots, the size of the board must be at least 2 times larger than the number of spots times their diameter. In addition, the number of spots on each corner of the board has to be an odd value to balance the board.
The parameters for this first board were 5 pieces, 7 spots per corner, 150 board diameter, and 14 spot diameter.
For the parameters, this board had 3 pieces, 5 spots per corner, 150 board diameter, and 14 spot diameter. This board has less spots per corner and pieces. The way you modify this is by changing the numbers for the parameters.
The parameters for this board were 4 pieces, 7 spots per corner, 200 board diameter, and 14 spot diameter. This board size is larger than the previous one. Additionally, it has 4 pieces instead of 3 and has more spots per corner.
Here’s the game board with the pieces.
It took a lot of trial and error to get our board to print successfully. We ran into problems along the way with spacing the spots evenly, getting there to be height for the base, and trying to print the height of the spots. We were able to fix the spacing of the spots and the height of the base of the board by changing the code. In the end, the game board was able to print the pegs when the size of the board was large. It was not printing well when the size was 80mm. However, it printed well with a larger board size.