A Tale of Two Heroes Problem Generating Video

A Tale of Two Heroes: Problem Generating Video Games 2008 Comps Presentation in Mathematics by Rafael Alejandro Sanchez

Outline Definitions Mathematical terms Computer Science terms Problems General explanations Specifics Bridge-Crossing Knights & Knaves The Program Indiana Jones Game King Arthur Game Demonstration Analysis Possible further work

Math Definitions Problem: Problem A class of related questions, not something you can necessarily solve. Instance of a problem: problem specific problem that can be given to someone to solve.

Math Definitions Solvable: Solvable enough information is given so that the instance of a problem can actually be solved. Trivial: Trivial the solution to the instance is obvious.

Computer Science Definitions Hard-coded: Hard-coded written very specifically, can be more difficult to edit. Soft-coded: Soft-coded written to be edited more easily, can be longer.

Computer Science Definitions GUI: GUI Graphical User Interface Algorithm: Algorithm Set of instructions for figuring something out. NPC: NPC Non-playable character

Bridge-Crossing Problem The Problem in General Group of people need to cross a bridge as fast as possible within certain constraints. End when everyone is on the other side.

Bridge-Crossing Problem Details Two people cross, one comes back. Each person walks at a different speed. When two people walk together, they walk at the speed of the slower person.

Knights & Knaves Problem The Problem in General Everyone is either a Knight or a Knave. Knights always tell the truth. Knaves always lie.

Knights & Knaves Problem Details You must figure out who the knights are. You have 5 questions. You may ask each question once.

The Program: Overview Generates instances of these two problems. Some Programming Challenges Solvable Non-trivial

The Program: Game 1 Bridge-Crossing Problem Your role: Indiana Jones and his crew. Your task: get everyone across the bridge by choosing who crosses at each point. What you’re given: each character’s speed.

The Program: Game 1 What the program does Randomly generates the characters’ speeds. Finds the fastest way across. Makes sure the instance is non-trivial.

The Program: Game 2 Knights & Knaves Problem Your role: King Arthur. You task: find out who the knights are. What you’re given: five questions. You may ask each once to one character.

The Program: Game 2 What the program does Randomly generates the characters’ identities as a knight or knave. Selects five questions. Creates working characters that you can talk to.


Analysis: Game 1 Your characters cross five times. 4 choose 2 = 6 = 4!/(2!2!) 2 choose 1 = 2 3 choose 2 = 3 3 choose 1 = 3 2 choose 2 = 1 6 x 2 x 3 x 1 = 108

Analysis: Game 1 6 x 2 x 3 x 1 = 108 No choice on the last crossing On the second-to-last crossing, it’s always best to choose the fastest person. 6 x 2 x 3 x 1 = 36

Analysis: Game 1 6 x 2 x 3 x 1 = 36 A <= B <= C <= D Given first choice, 1 x 2 x 3 x 1 = 6

AB AB AB

AB A AB B

AB A AC AB A AD AB A CD AB B

AB A AC A AB A AD A AB A CD B AB B

AB A AC A AD AB A AD A AC AB A CD B AB AB B

AB A AC A AD AB A AD A AC AB A CD B AB AB B BC AB B BD AB B CD

AB A AC A AD AB A AD A AC AB A CD B AB AB B BC A AB B BD A AB B CD A

AB A AC A AD AB A AD A AC AB A CD B AB AB B BC A AD AB B BD A AC AB B CD A AB

AB A AC A AD 2 A + B + C + D AB A AD A AC 2 A + B + C + D AB A CD B AB A + 3 B AB B BC A AD A + 2 B + C + D AB B BD A AC A + 2 B + C + D AB B CD A AB A + 3 B +D +D

Analysis: Game 1 2 A + B + C + D A + 3 B +D A + 2 B + C + D

Analysis: Game 1 2 A + B + C + D A + 3 B +D

Analysis: Game 1 2 A + B + C + D –A –B –D A +C (A + C) VS. (2 B) A + 3 B –A –B 2 B +D –D

A+C AB A AC A AD 2 A + B + C + D AB A AD A AC 2 A + B + C + D AB A CD B AB A + 3 B AB B BC A AD A + 2 B + C + D AB B BD A AC A + 2 B + C + D AB B CD A AB A + 3 B 2 B +D +D

Analysis: Game 2 Forms of the questions given Does X claim to be a knight? Is there an odd/even amount of knights/knaves? Are there more/less than three knights/knaves? Is Y a knight? Is Z a knave?

Analysis: Game 2 What can you find out with your questions? Identity of one character. Amount of knights Identities of two particular characters.

Possible Further Work Expansion of possible instances More characters More possible questions Other Modifications Use different algorithms Improve GUI

Works Cited Andreas Söderlund. "Fuzzy logic in your game. " BYONDscape: The Journal of New Worlds. 2004. 2 Oct. 2007 <http: //www. byondscape. com/ascape. dmb/Gazoot. 2004 -0315/>. Lewis, John and Joseph Chase. “Java software structures; designing and using data structures. ” Scitech Book News. Jun 2004. Vol. 28, Iss. 2. Liskov, Barbara and John Guttang. Program Development in Java. Boston: Addison-Wesley, 2001. Sun Microsystems, Inc. “Java 2 Platform Standard Ed. 5. 0. ” 2 Oct. 2007 <http: //java. sun. com/j 2 se/1. 5. 0/docs/api/>. Zeitz, Paul. The Art and Craft of Problem Solving. Hoboken, NJ: John Wiley & Sons, 1999.

Thank You… Mathematics Department Professor Ramin Naimi Professor Rodney Hoffman Go Class of 2008!
- Slides: 37