a tale of two heroes: problem generating video games 2008 comps presentation in mathematics by...

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

Upload: reginald-underwood

Post on 26-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

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

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.

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.

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

GUIGUI: Graphical User Interface

AlgorithmAlgorithm: Set of instructions for figuring something out.

NPCNPC: Non-playable character

Computer Science Definitions

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 ChallengesSolvableNon-trivial

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.

The Program: Game 1

What the program doesRandomly generates the characters’ speeds.

Finds the fastest way across.

Makes sure the instance is non-trivial.

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.

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.

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

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

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

AB

AB

AB

AB

AB

AB

AB A

AB A

AB A

AB B

AB B

AB B

AB A AC

AB A AD

AB A CD

AB B

AB B

AB B

AB A AC A

AB A AD A

AB A CD B

AB B

AB B

AB B

AB A AC A AD

AB A AD A AC

AB A CD B AB

AB B

AB B

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 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

Analysis: Game 1

2A + B + C + D

A + 3B + D

A + 2B + C + D

Analysis: Game 1

2A + B + C + D

A + 3B + D

Analysis: Game 1

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

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

(A + C) VS. (2B)

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

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?

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 instancesMore charactersMore possible questions

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

Thank You…

Mathematics DepartmentProfessor Ramin NaimiProfessor Rodney Hoffman

Go Class of 2008!Go Class of 2008!