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

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

Dec 26, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: A Tale of Two Heroes: Problem Generating Video Games 2008 Comps Presentation in Mathematics by Rafael Alejandro Sanchez.

A Tale of Two Heroes:Problem Generating Video

Games

2008 Comps Presentation in Mathematics by

Rafael Alejandro Sanchez

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

Outline

DefinitionsMathematical termsComputer Science terms

ProblemsGeneral explanationsSpecifics

Bridge-CrossingKnights & Knaves

The ProgramIndiana Jones GameKing Arthur GameDemonstrationAnalysis

Possible further work

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

Math Definitions

ProblemProblem: A class of related questions, not something you can necessarily solve.

Instance of a problemInstance of a problem: specific problem that can be given to someone to solve.

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

Math Definitions

SolvableSolvable: enough information is given so that the instance of a problem can actually be solved.

TrivialTrivial: the solution to the instance is obvious.

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

Hard-codedHard-coded: written very specifically, can be more difficult to edit.

Soft-codedSoft-coded: written to be edited more easily, can be longer.

Computer Science Definitions

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

GUIGUI: Graphical User Interface

AlgorithmAlgorithm: Set of instructions for figuring something out.

NPCNPC: Non-playable character

Computer Science Definitions

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

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.

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

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.

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

Knights & Knaves Problem

The Problem in General

Everyone is either a Knight or a Knave.

Knights always tell the truth.

Knaves always lie.

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

Knights & Knaves Problem

Details

You must figure out who the knights are.

You have 5 questions.

You may ask each question once.

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

The Program: Overview

Generates instances of these two problems.

Some Programming ChallengesSolvableNon-trivial

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

The Program: Game 1

Bridge-Crossing ProblemYour 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.

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

The Program: Game 1

What the program doesRandomly generates the characters’ speeds.

Finds the fastest way across.

Makes sure the instance is non-trivial.

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

The Program: Game 2

Knights & Knaves ProblemYour 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.

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

The Program: Game 2

What the program doesRandomly generates the characters’ identities as a knight or knave.

Selects five questions.

Creates working characters that you can talk to.

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

Analysis: Game 1

Your characters cross five times.4 choose 2 = 6 = 4!/(2!2!)2 choose 1 = 23 choose 2 = 33 choose 1 = 32 choose 2 = 1

6 x 2 x 3 x 3 x 1 = 108

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

Analysis: Game 1

6 x 2 x 3 x 3 x 1 = 108

No choice on the last crossingOn the second-to-last crossing, it’s always best to choose the fastest person.

6 x 2 x 3 x 1 x 1 = 36

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

Analysis: Game 1

6 x 2 x 3 x 1 x 1 = 36

A <= B <= C <= D

Given first choice, 1 x 2 x 3 x 1 x 1 = 6

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

AB

AB

AB

AB

AB

AB

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

AB A

AB A

AB A

AB B

AB B

AB B

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

AB A AC

AB A AD

AB A CD

AB B

AB B

AB B

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

AB A AC A

AB A AD A

AB A CD B

AB B

AB B

AB B

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

AB A AC A AD

AB A AD A AC

AB A CD B AB

AB B

AB B

AB B

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

AB A AC A AD

AB A AD A AC

AB A CD B AB

AB B BC

AB B BD

AB B CD

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

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

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

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

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

AB A AC A AD 2A + B + C + D

AB A AD A AC 2A + B + C + D

AB A CD B AB A + 3B + D

AB B BC A AD A + 2B + C + D

AB B BD A AC A + 2B + C + D

AB B CD A AB A + 3B + D

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

Analysis: Game 1

2A + B + C + D

A + 3B + D

A + 2B + C + D

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

Analysis: Game 1

2A + B + C + D

A + 3B + D

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

Analysis: Game 1

2A + B + C + D – A – B – D A + C

A + 3B + D – A – B – D 2B

(A + C) VS. (2B)

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

AB A AC A AD 2A + B + C + D

AB A AD A AC 2A + B + C + D

AB A CD B AB A + 3B + D

AB B BC A AD A + 2B + C + D

AB B BD A AC A + 2B + C + D

AB B CD A AB A + 3B + D

A + C

2B

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

Analysis: Game 2

Forms of the questions givenDoes 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?

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

Analysis: Game 2

What can you find out with your questions?

Identity of one character.

Amount of knights

Identities of two particular characters.

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

Possible Further Work

Expansion of possible instancesMore charactersMore possible questions

Other ModificationsUse different algorithmsImprove GUI

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

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/j2se/1.5.0/docs/api/>.Zeitz, Paul. The Art and Craft of Problem Solving. Hoboken, NJ: John Wiley & Sons, 1999.

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

Thank You…

Mathematics DepartmentProfessor Ramin NaimiProfessor Rodney Hoffman

Go Class of 2008!Go Class of 2008!