Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Creating an interchangeable grid-based board game (c#)

Discussion in 'Game Design' started by DanMakabre, Feb 27, 2015.

  1. DanMakabre

    DanMakabre

    Joined:
    Feb 27, 2015
    Posts:
    3
    I'm doing a virtual board game for fun and I was wondering how I would go about designing the board. The first player decides how he/she wants the board set up. So they arrange the 6 pieces that make up the game onto a center piece which will provide as a ring road (shortcut) to all of the 6 board pieces. The grid will include the middle piece and all the grid squares on the board pieces themselves. Here's a rough sketch I did a minute ago of what they will look like.
    image.jpg
    How should I go about making the pieces objects that can be rearranged and that connect to the center piece and also to the adjacent board pieces with interlocking grid paths like the ones shown above.

    Thanks!
     
  2. Deon-Cadme

    Deon-Cadme

    Joined:
    Sep 10, 2013
    Posts:
    288
    Your problem is basically the answer to the question, you cannot have paths connecting randomly. You need to pre-define the connecting location on each side.

    It is possible to take this one step further with multiple connecting points on each side; If you have 3 possible connections on each side, you pick a random connection that you do not use and the two remaining ones must be used, then it is guaranteed that one of them always connect. The drawback with a system like this is that you may get two connections on that side or you might get a dead end. The benefit with system is that it will ensure that connecting point isn't always located at the same place and that it scales upwards... 5 connections, 2 ignored, 3 used and this 1,2 ratio can be tweaked in higher orders to cause even more interesting gameplay possibilities.
     
  3. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Have you considered hexagonal pieces? Settlers of Catan shows this works extremely well. Then, you have pieces with lots of exits, and pieces with only a few exits. And players can build outward from the center hexagon. You'll end up with a neat snake like structure that explodes with possibility. For example, imagine a real-time RTS kind of experience, where players are working to gather resources to build new tiles, and to place buildings on the tiles, and so on... Sounds fun already! Or, you have a simple table-top board game, like Settlers, where players compete for 'ownership' of the tiles and accumulate resources. Die rolls to move around, etc... Or, you could build a co-op strategic game where players are trying to work together to find something. Maybe there are 'end-nodes' like 'Diamond Mind' with requirements like, 'Only placeable on a chain of at least 4 tiles'. All of them sound fun to prototype.

    Gigi
     
    Last edited: Feb 27, 2015
    AndrewGrayGames likes this.
  4. DanMakabre

    DanMakabre

    Joined:
    Feb 27, 2015
    Posts:
    3
    Let me clarify. The 6 sections that make up the game can be placed in whichever order but their grid paths never change. So sometimes a section may have a grid path that connects with the one adjacent to it.
     
  5. khanstruct

    khanstruct

    Joined:
    Feb 11, 2011
    Posts:
    2,870
    Off the top of my head, I would say have each piece contain a boolean array; True if it has a path, False if it doesn't. Then check the appropriate array index of the two adjoining pieces to see if they are both True. If they are, you can cross, if not, then you can't.
     
    DanMakabre likes this.
  6. DanMakabre

    DanMakabre

    Joined:
    Feb 27, 2015
    Posts:
    3
    Lol yup I ended up doing exactly that
     
    khanstruct likes this.