Super Mario Bros. Is Harder/Easier than We Thought FUN 2016 Erik - - PowerPoint PPT Presentation

super mario bros is harder easier than we thought
SMART_READER_LITE
LIVE PREVIEW

Super Mario Bros. Is Harder/Easier than We Thought FUN 2016 Erik - - PowerPoint PPT Presentation

Super Mario Bros. Is Harder/Easier than We Thought FUN 2016 Erik D. Demaine, Giovanni Viglietta, Aaron Williams La Maddalena June 9, 2016 Super Mario Bros. Is Harder/Easier than We Thought State of the art: FUN 2014 "Classic Nintendo


slide-1
SLIDE 1

Super Mario Bros. Is Harder/Easier than We Thought

FUN 2016 Erik D. Demaine, Giovanni Viglietta, Aaron Williams La Maddalena – June 9, 2016

Super Mario Bros. Is Harder/Easier than We Thought

slide-2
SLIDE 2

State of the art: FUN 2014

"Classic Nintendo games are (computationally) hard" [Aloupis-Demaine-Guo-Viglietta]

Super Mario Bros. Is Harder/Easier than We Thought

slide-3
SLIDE 3

State of the art: FUN 2014

Downsides:

Only NP-hardness of SMB was proved (PSPACE-completeness was left open)

"Classic Nintendo games are (computationally) hard" [Aloupis-Demaine-Guo-Viglietta]

Super Mario Bros. Is Harder/Easier than We Thought

slide-4
SLIDE 4

State of the art: FUN 2014

Downsides:

Only NP-hardness of SMB was proved (PSPACE-completeness was left open) Levels were arbitrarily high (in SMB they have a fixed height)

"Classic Nintendo games are (computationally) hard" [Aloupis-Demaine-Guo-Viglietta]

Super Mario Bros. Is Harder/Easier than We Thought

slide-5
SLIDE 5

State of the art: FUN 2014

Downsides:

Only NP-hardness of SMB was proved (PSPACE-completeness was left open) Levels were arbitrarily high (in SMB they have a fixed height) Off-screen objects were not reset (in SMB the "active screen" has fixed size)

"Classic Nintendo games are (computationally) hard" [Aloupis-Demaine-Guo-Viglietta]

Super Mario Bros. Is Harder/Easier than We Thought

slide-6
SLIDE 6

State of the art: FUN 2014

Downsides:

Only NP-hardness of SMB was proved (PSPACE-completeness was left open) Levels were arbitrarily high (in SMB they have a fixed height) Off-screen objects were not reset (in SMB the "active screen" has fixed size) Mario was allowed to go back and forth (in SMB the screen can only move rightward)

"Classic Nintendo games are (computationally) hard" [Aloupis-Demaine-Guo-Viglietta]

Super Mario Bros. Is Harder/Easier than We Thought

slide-7
SLIDE 7

State of the art: FUN 2014

Downsides:

Only NP-hardness of SMB was proved (PSPACE-completeness was left open) Levels were arbitrarily high (in SMB they have a fixed height) Off-screen objects were not reset (in SMB the "active screen" has fixed size) Mario was allowed to go back and forth (in SMB the screen can only move rightward) Lots of game elements were used (we would like to be more parsimonious)

"Classic Nintendo games are (computationally) hard" [Aloupis-Demaine-Guo-Viglietta]

Super Mario Bros. Is Harder/Easier than We Thought

slide-8
SLIDE 8

State of the art: FUN 2014

Downsides:

Only NP-hardness of SMB was proved (PSPACE-completeness was left open) Levels were arbitrarily high (in SMB they have a fixed height) Off-screen objects were not reset (in SMB the "active screen" has fixed size) Mario was allowed to go back and forth (in SMB the screen can only move rightward) Lots of game elements were used (we would like to be more parsimonious)

"Classic Nintendo games are (computationally) hard" [Aloupis-Demaine-Guo-Viglietta]

Super Mario Bros. Is Harder/Easier than We Thought

slide-9
SLIDE 9

State of the art: FUN 2014

Downsides:

Only NP-hardness of SMB was proved (PSPACE-completeness was left open) Levels were arbitrarily high (in SMB they have a fixed height) Off-screen objects were not reset (in SMB the "active screen" has fixed size) Mario was allowed to go back and forth (in SMB the screen can only move rightward) Lots of game elements were used (we would like to be more parsimonious) Levels were not entirely glitch-proof (in SMB there are glitches that make the old crossover gadget ineffective)

"Classic Nintendo games are (computationally) hard" [Aloupis-Demaine-Guo-Viglietta]

Super Mario Bros. Is Harder/Easier than We Thought

slide-10
SLIDE 10

Our results

Rescuing the princess is in P if the standard rules of SMB apply Rescuing the princess is weakly NP-hard if the level format allows run-length encoding, even if

levels have height 2

  • nly coins and pipes are used
  • nly buttons

and are used

Reaching the flagpole in a level without losing lives is PSPACE-complete if objects off-screen are not reset

(All constructions are glitch-proof)

Super Mario Bros. Is Harder/Easier than We Thought

slide-11
SLIDE 11

Reaching the flagpole is in P

Sketch of the proof:

Super Mario Bros. Is Harder/Easier than We Thought

slide-12
SLIDE 12

Reaching the flagpole is in P

Sketch of the proof: The “active screen” has fixed size; it can contain at most 5 sprites (plus Mario) and everything off-screen is reset

Super Mario Bros. Is Harder/Easier than We Thought

slide-13
SLIDE 13

Reaching the flagpole is in P

Sketch of the proof: The “active screen” has fixed size; it can contain at most 5 sprites (plus Mario) and everything off-screen is reset Pseudorandom numbers are generated at every frame, starting from a fixed initial seed

Super Mario Bros. Is Harder/Easier than We Thought

slide-14
SLIDE 14

Reaching the flagpole is in P

Sketch of the proof: The “active screen” has fixed size; it can contain at most 5 sprites (plus Mario) and everything off-screen is reset Pseudorandom numbers are generated at every frame, starting from a fixed initial seed Mario can instantly move to different locations through pipes

Super Mario Bros. Is Harder/Easier than We Thought

slide-15
SLIDE 15

Reaching the flagpole is in P

Sketch of the proof: The “active screen” has fixed size; it can contain at most 5 sprites (plus Mario) and everything off-screen is reset Pseudorandom numbers are generated at every frame, starting from a fixed initial seed Mario can instantly move to different locations through pipes “Loop Command” objects send Mario back by 4 screens if a certain path is not followed

Super Mario Bros. Is Harder/Easier than We Thought

slide-16
SLIDE 16

Reaching the flagpole is in P

Sketch of the proof: The “active screen” has fixed size; it can contain at most 5 sprites (plus Mario) and everything off-screen is reset Pseudorandom numbers are generated at every frame, starting from a fixed initial seed Mario can instantly move to different locations through pipes “Loop Command” objects send Mario back by 4 screens if a certain path is not followed = ⇒ Solving a level is reduced to exploring a polynomial-size “configuration graph”

Super Mario Bros. Is Harder/Easier than We Thought

slide-17
SLIDE 17

Rescuing the princess is in P

Rescuing the princess involves solving several levels, and losing some lives in the process may be unavoidable

Super Mario Bros. Is Harder/Easier than We Thought

slide-18
SLIDE 18

Rescuing the princess is in P

Rescuing the princess involves solving several levels, and losing some lives in the process may be unavoidable Each level has a checkpoint

checkpoint

  • 1 life
  • 1 life

Super Mario Bros. Is Harder/Easier than We Thought

slide-19
SLIDE 19

Rescuing the princess is in P

Rescuing the princess involves solving several levels, and losing some lives in the process may be unavoidable Each level has a checkpoint Collecting coins grants extra lives: x 100 =

Super Mario Bros. Is Harder/Easier than We Thought

slide-20
SLIDE 20

Rescuing the princess is in P

Rescuing the princess involves solving several levels, and losing some lives in the process may be unavoidable Each level has a checkpoint Collecting coins grants extra lives: x 100 =

Note: repeatedly collecting more than 100 coins and losing a life grants Mario arbitrarily many lives

Super Mario Bros. Is Harder/Easier than We Thought

slide-21
SLIDE 21

Rescuing the princess is in P

Rescuing the princess involves solving several levels, and losing some lives in the process may be unavoidable Each level has a checkpoint Collecting coins grants extra lives: x 100 =

Note: repeatedly collecting more than 100 coins and losing a life grants Mario arbitrarily many lives

= ⇒ Solving a sequence of levels is reduced to exploring a polynomial-size “macro-graph”

Super Mario Bros. Is Harder/Easier than We Thought

slide-22
SLIDE 22

Run-length encoding

In SMB’s level format, a row of up to 16 equal objects can be encoded as a single object: the fragment can be encoded as

x 8 x 10

Super Mario Bros. Is Harder/Easier than We Thought

slide-23
SLIDE 23

Run-length encoding

In SMB’s level format, a row of up to 16 equal objects can be encoded as a single object: the fragment can be encoded as

x 8 x 10

Let us generalize this concept to arbitrarily long rows

Super Mario Bros. Is Harder/Easier than We Thought

slide-24
SLIDE 24

NP-hardness: reduction from Knapsack

Knapsack problem. Given a set of n items with values v1, . . . , vn and weights w1, . . . , wn, is there a subset with total value at least V and total weight at most W ?

Super Mario Bros. Is Harder/Easier than We Thought

slide-25
SLIDE 25

NP-hardness: reduction from Knapsack

Knapsack problem. Given a set of n items with values v1, . . . , vn and weights w1, . . . , wn, is there a subset with total value at least V and total weight at most W ?

  • Reduction. Construct a SMB game with the following levels:

a choice level in which Mario can collect 100 · V coins if and

  • nly if the given Knapsack instance is solvable in W seconds

Super Mario Bros. Is Harder/Easier than We Thought

slide-26
SLIDE 26

NP-hardness: reduction from Knapsack

Knapsack problem. Given a set of n items with values v1, . . . , vn and weights w1, . . . , wn, is there a subset with total value at least V and total weight at most W ?

  • Reduction. Construct a SMB game with the following levels:

a choice level in which Mario can collect 100 · V coins if and

  • nly if the given Knapsack instance is solvable in W seconds

V + 2 kill levels in which Mario has to lose a life (note: Mario starts the game with 3 lives)

Super Mario Bros. Is Harder/Easier than We Thought

slide-27
SLIDE 27

NP-hardness: reduction from Knapsack

Knapsack problem. Given a set of n items with values v1, . . . , vn and weights w1, . . . , wn, is there a subset with total value at least V and total weight at most W ?

  • Reduction. Construct a SMB game with the following levels:

a choice level in which Mario can collect 100 · V coins if and

  • nly if the given Knapsack instance is solvable in W seconds

V + 2 kill levels in which Mario has to lose a life (note: Mario starts the game with 3 lives) The Knapsack problem is weakly NP-complete ⇓ SMB with run-length encoding is weakly NP-hard

Super Mario Bros. Is Harder/Easier than We Thought

slide-28
SLIDE 28

NP-hardness: reduction from Knapsack

Choice level:

… … …

skip item 1 select item 1

… …

checkpoint (time 100)

… … … …

skip item 2 select item 2 time 100

… Super Mario Bros. Is Harder/Easier than We Thought

slide-29
SLIDE 29

NP-hardness: reduction from Knapsack

Choice level:

… … …

skip item 1 select item 1

… …

checkpoint (time 100)

… … … …

skip item 2 select item 2 time 100

Kill level:

time 150 checkpoint (time 200)

time 150

… Super Mario Bros. Is Harder/Easier than We Thought

slide-30
SLIDE 30

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen

Super Mario Bros. Is Harder/Easier than We Thought

slide-31
SLIDE 31

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-32
SLIDE 32

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-33
SLIDE 33

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-34
SLIDE 34

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-35
SLIDE 35

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-36
SLIDE 36

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-37
SLIDE 37

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-38
SLIDE 38

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-39
SLIDE 39

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-40
SLIDE 40

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-41
SLIDE 41

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-42
SLIDE 42

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-43
SLIDE 43

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-44
SLIDE 44

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-45
SLIDE 45

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-46
SLIDE 46

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-47
SLIDE 47

PSPACE-hardness gadgets

Start & Finish Crossover, usable multiple times Door: can be opened, closed, and traversed if and only if it is

  • pen
  • pen

traverse close

Super Mario Bros. Is Harder/Easier than We Thought

slide-48
SLIDE 48

Crossover gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-49
SLIDE 49

Crossover gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-50
SLIDE 50

Door gadget

traverse

  • pen

close close traverse

Super Mario Bros. Is Harder/Easier than We Thought

slide-51
SLIDE 51

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-52
SLIDE 52

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-53
SLIDE 53

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-54
SLIDE 54

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-55
SLIDE 55

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-56
SLIDE 56

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-57
SLIDE 57

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-58
SLIDE 58

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-59
SLIDE 59

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-60
SLIDE 60

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-61
SLIDE 61

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-62
SLIDE 62

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-63
SLIDE 63

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-64
SLIDE 64

Door gadget

Super Mario Bros. Is Harder/Easier than We Thought

slide-65
SLIDE 65

Glitches: walk through walls and walljump

Jump toward a wall and steer in the opposite direction

Super Mario Bros. Is Harder/Easier than We Thought

slide-66
SLIDE 66

Glitches: walk through walls and walljump

Jump toward a wall and steer in the opposite direction If done properly, the wall sucks Mario in instead of pushing him out

Super Mario Bros. Is Harder/Easier than We Thought

slide-67
SLIDE 67

Glitches: walk through walls and walljump

Jump toward a wall and steer in the opposite direction If done properly, the wall sucks Mario in instead of pushing him out This allows Mario to walk through certain walls or do a “walljump”

Super Mario Bros. Is Harder/Easier than We Thought

slide-68
SLIDE 68

Glitches: walk through walls and walljump

  • Solution. Avoid the two following configurations:

Super Mario Bros. Is Harder/Easier than We Thought

slide-69
SLIDE 69

Glitches: walk through walls and walljump

… … …

skip item 1 select item 1

… …

checkpoint (time 100)

… … … …

skip item 2 select item 2 time 100

Reduction from Knapsack: OK!

Super Mario Bros. Is Harder/Easier than We Thought

slide-70
SLIDE 70

Glitches: walk through walls and walljump

Crossover gadget: OK!

Super Mario Bros. Is Harder/Easier than We Thought

slide-71
SLIDE 71

Glitches: walk through walls and walljump

Door gadget: OK!

Super Mario Bros. Is Harder/Easier than We Thought

slide-72
SLIDE 72

Glitches: walk through walls and walljump

If there is a monster on top of a brick block, Mario can jump through it by quickly hitting it twice from below

Super Mario Bros. Is Harder/Easier than We Thought

slide-73
SLIDE 73

Glitches: walk through walls and walljump

If there is a monster on top of a brick block, Mario can jump through it by quickly hitting it twice from below

Super Mario Bros. Is Harder/Easier than We Thought

slide-74
SLIDE 74

Glitches: walk through walls and walljump

If there is a monster on top of a brick block, Mario can jump through it by quickly hitting it twice from below

Super Mario Bros. Is Harder/Easier than We Thought

slide-75
SLIDE 75

Glitches: walk through walls and walljump

If there is a monster on top of a brick block, Mario can jump through it by quickly hitting it twice from below

Super Mario Bros. Is Harder/Easier than We Thought

slide-76
SLIDE 76

Glitches: walk through walls and walljump

  • Solution. Attach firebars to brick blocks

Super Mario Bros. Is Harder/Easier than We Thought

slide-77
SLIDE 77

Super Mario Bros. Is Harder/Easier than We Thought