Recommend
2 
 Thumb up
 Hide
9 Posts

BGG» Forums » Board Game Design » Board Game Design

Subject: Algorithm to randomize combinations? rss

Your Tags: Add tags
Popular Tags: [View All]
Michael Purser
United States
Salt Lake City
Utah
flag msg tools
Avatar
Microbadge: Copper Board Game CollectorMicrobadge: Android: Netrunner fanMicrobadge: Math TraderMicrobadge: Dungeon Lords fanMicrobadge: Kingdom Death Original Survivor fan
Here is the deal. I am working on a game called Genius For Hire, which is a steampunk flavored card game in which players are working for a mechanical temp agency. Contracts come in for odd jobs (locomotive repair, warehouse inventory, etc). Players then construct machines from various components to fulfill the requirements of each contract before the contract deadline.

Each contract has a number of components that are required to satisfy the contract. Hazardous materials removal might require a sensor and mechanical arms. Each contract also has devices that cannot be present on a machine used to complete the jobs. That same hazardous material removal job might not permit a calculator (too delicate, it would be ruined). Players can activate any number of machines to fulfill the contract as long as they contain ALL the required components and NONE of the forbidden devices between them.

There are three levels of contract. 1pt contracts require 2 devices and forbid 1. 2pt contracts require 3 devices each and disallow 2. 3pt contracts require 4 devices and disallow 3. There are 10 contracts in the deck at each level. There are 10 different kinds of components.

Here is the dilemma: I want each of the 10 devices to be used an equal number of times at each contract level. So at the 1pt level, each device will be REQUIRED twice and FORBIDDEN once. I want to make sure that the items are also diverse, so that I don't have contracts that are too similar. Is there a program or algorithm that I could use to ensure a diverse randomization across all the contracts? Or do I have to figure it all out manually?
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Paul Simmons
Australia
flag msg tools
designer
Avatar
Microbadge: Role-playerMicrobadge: Free Print & Play Game DesignerMicrobadge: Settlers of Catan fanMicrobadge: Australia - The Lucky CountryMicrobadge: WABA Supporter
It definitely can be done electronically, however I would have a tendency to do it manually (via a spreadsheet) so that I can build the story for the contract. That way you will greater control of the balance and reasoning for the restriction.
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Paul Dale
Australia
Moggill
Queensland
flag msg tools
designer
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
badge
When will the die stop rolling? What face finishes showing?
Avatar
Microbadge: I made my own gaming tableMicrobadge: I love translucent diceMicrobadge: Dice Hate MeMicrobadge: Hang in thereMicrobadge: All my characters die too quickly!
You want to look up block design (part of experimental design in statistics).

There are many many kinds of design. You're looking for a balanced design if my memory is working correct.


- Pauli
4 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Vince
United Kingdom
flag msg tools
designer
Microbadge: Free Print & Play Game DesignerMicrobadge: 5 Year Geek VeteranMicrobadge: FIMO custom components creator
This couldn't be easier, since you have as many values (or devices) to distribute as sets (cards) to distribute them to.

Each card will be a row in a table.

Take a list of all possible values as your first column, and make a copy of the list.

For each value in the first column, select a random value from the copied list, place it in the second column, and knock it out of the copy. If you want to ensure no duplicates within a row, omit values which already exist in the row from the selection process.

Repeat until you have enough columns.

Add disallowed values in the same way.
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Matt Davis
United States
New Concord
Ohio
flag msg tools
Avatar
Microbadge: I love all games!Microbadge: Rickcon 2012 AttendeeMicrobadge: RainbowMicrobadge: Disc Golf fanMicrobadge: Golden Meeple
paulidale wrote:
You want to look up block design (part of experimental design in statistics).

There are many many kinds of design. You're looking for a balanced design if my memory is working correct.


- Pauli
Technically, Balanced and Incomplete, from the sounds of it, but....

http://en.wikipedia.org/wiki/Block_design

Honestly, Wolfram Alpha might be able to do this for you if you can figure out how to ask it properly.... Edit: After some checking, I'm not so sure about this. Never mind then.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Daniel Holz
Scotland
Edinburgh
flag msg tools
Microbadge: Stanislaw Lem fanMicrobadge: Sherlock Holmes fan
Say you are creating the combinations for the 1pt contracts.

1. create a random cyclic graph over 10 nodes
2. repeat for each node in the graph:
2.1 walk the graph 2 steps to determine the required devices
2.2 walk the graph one additional node to determine the forbidden device

i.e with the simplist 'random' graph

1 ==> 2 ==> 3 ==> 4
^ |
| v
10 5
^ |
| v
9 <== 8 <== 7 <== 6

start from 1: first two steps determine that devices 1 & 2 are required, next step determines device 3 is forbidden.
start from 2: first two steps determine that devices 2 & 3 are required, next step determines device 4 is forbidden.
... etc. ..
start from 10: first two steps determine that devices 10 & 1 are required, next step determines device 2 is forbidden.

You can use the same technique for the 2pt & 3pt contracts, simply by extending the number of steps walked
from (2 required, 1 forbidden) to (3 required, 2 forbidden) & (4 required, 3 forbidden).

To diversify the appearnce contracts, you should use a different cyclic graph for the 1pt, 2pt, & 3pt contracts, and shuffle the listing of the devices on each contract. You can of course create the graphs quite simply by hand by writing down the devices and connecting them two at a time with a line.
7 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Michael Purser
United States
Salt Lake City
Utah
flag msg tools
Avatar
Microbadge: Copper Board Game CollectorMicrobadge: Android: Netrunner fanMicrobadge: Math TraderMicrobadge: Dungeon Lords fanMicrobadge: Kingdom Death Original Survivor fan
Thanks guys, you are made of win. Just the sort of thing I needed. I am a PR guy, not a mathematician. Helps to have a truckload of math-guys on hand when situations like this come up.
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
DC
United States
Grand Rapids
Michigan
flag msg tools
badge
Avatar
Microbadge: BGG is a communityMicrobadge: RespectMicrobadge: LGBTQ ally
Wow. The one day I don't read BGG until the evening, I find an already-answered thread covering exactly what I study professionally!

BGG is crazy amazing. I'm not even the only design theorist here.
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Sim Guy
United States
Albuquerque
New Mexico
flag msg tools
badge
Avatar
Microbadge: GrognardMicrobadge: I Play All GamesMicrobadge: Citizenship Recognition - Level II - If I have seen further, it's only by standing on the apex of other's dice.Microbadge: 1 Player Guild - Together We Game AloneMicrobadge: Wargamer of 50+ years
dcclark wrote:
Wow. The one day I don't read BGG until the evening, I find an already-answered thread covering exactly what I study professionally!
Me three - talk about mathematicus interruptus.

dcclark wrote:
BGG is crazy amazing. I'm not even the only design theorist here.
BGG, We put the Geek in Boardgames cool
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls