{
  "pull_request": {
    "html_url": null,
    "patch_url": null,
    "diff_url": null
  },
  "closed_at": "2012-06-22T20:36:01Z",
  "milestone": null,
  "body": "Generating random mazes for pacman will require a different heuristic than the conventional ones applied for regular maze generators.  It will at least require a modified heuristic to prevent the ghosts from getting trapped when pursuing targets.\r\n\r\nThese links may help with fundamentals\r\n\r\n- http://www.reddit.com/r/programming/comments/l1o4j/procedural_map_generation_with_answerset/\r\n- http://www.reddit.com/r/programming/comments/kvtrp/algorithm_is_not_a_fourletter_word/",
  "user": {
    "login": "shaunew",
    "avatar_url": "https://secure.gravatar.com/avatar/0bdd2d6d5051b610660baf5c22016639?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
    "gravatar_id": "0bdd2d6d5051b610660baf5c22016639",
    "id": 116838,
    "url": "https://api.github.com/users/shaunew"
  },
  "closed_by": {
    "login": "shaunew",
    "avatar_url": "https://secure.gravatar.com/avatar/0bdd2d6d5051b610660baf5c22016639?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
    "gravatar_id": "0bdd2d6d5051b610660baf5c22016639",
    "id": 116838,
    "url": "https://api.github.com/users/shaunew"
  },
  "created_at": "2012-03-05T05:54:46Z",
  "comments": 9,
  "assignee": null,
  "title": "Random Maze Generator",
  "html_url": "https://github.com/shaunew/Pac-Man/issues/33",
  "number": 33,
  "state": "closed",
  "updated_at": "2012-06-22T20:36:01Z",
  "id": 3501923,
  "labels": [

  ],
  "url": "https://api.github.com/repos/shaunew/Pac-Man/issues/33"
}
[
  {
    "created_at": "2012-03-06T21:56:48Z",
    "updated_at": "2012-03-08T04:41:34Z",
    "body": "Rules:\r\n- paths are one tile thick with no dead ends\r\n- the first and last rows contain all wall tiles\r\n- the first column contains all wall tiles with the exception of 1 or 2 tiles for tunnels\r\n- a wall must be at least two tiles thick\r\n- the map is horizontally symmetric, so we only write to the first 15 columns\r\n\r\nThe map starts with the ghost house in the standard position.  The algorithm continues by progressively adding wall pieces to the map.\r\n\r\nTo place a wall, we start by computing a list of possible starting locations of a wall.  \r\n\r\nA 4x4 block of empty space is a possible starting location for a new wall:\r\n\r\n    ??????     ??????\r\n    ?....?     ?....?\r\n    ?....?     ?.||.?\r\n    ?....?  >  ?.||.?\r\n    ?....?     ?....?\r\n    ??????     ??????\r\n\r\nAn additional constraint on the starting position could be that one of the boundary tiles (marked by the question marks) must be a wall tile.  This can prevent  creating impossible gaps.\r\n\r\nWe place a 2x2 wall at a random valid location.  \r\n\r\nAfter placing the first piece of the wall, we must consider the surrounding areas that a new piece cannot be placed.  Some wall must grow to fill this gap.  Some condition must be used for deciding which wall must grow to fill it, and it will probably have to do with desired wall shapes.  The boundary wall of the map must also be considered a wall.\r\n\r\nOnce this mandatory growing is done, some condition must be checked to determine if the piece should grow further.  If so, we follow the growth with another mandatory growing to fill in any gaps that require filling.\r\n\r\nOnce the piece-growing is done, we proceed to add another piece if possible.  If not, the map is done.\r\n",
    "user": {
      "login": "shaunew",
      "id": 116838,
      "url": "https://api.github.com/users/shaunew",
      "gravatar_id": "0bdd2d6d5051b610660baf5c22016639",
      "avatar_url": "https://secure.gravatar.com/avatar/0bdd2d6d5051b610660baf5c22016639?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
    },
    "id": 4357019,
    "url": "https://api.github.com/repos/shaunew/Pac-Man/issues/comments/4357019"
  },
  {
    "created_at": "2012-03-09T20:02:39Z",
    "updated_at": "2012-03-09T20:02:39Z",
    "body": "Initial generated map tests aren't looking good.  Should go back to the drawing board to really figure out a better way.  I think the problem with my gap-filling heuristic is that it creates an unpleasant appearance of inconsistent piece sizes and sharp turns.\r\n\r\nPerhaps I should try defining rules for what makes a valid and interesting map and generate it with an answer set solver, such as potassco (i.e. clingo).  This may have to be done external to javascript, unless there are ways to port it.",
    "user": {
      "login": "shaunew",
      "id": 116838,
      "url": "https://api.github.com/users/shaunew",
      "gravatar_id": "0bdd2d6d5051b610660baf5c22016639",
      "avatar_url": "https://secure.gravatar.com/avatar/0bdd2d6d5051b610660baf5c22016639?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
    },
    "id": 4423538,
    "url": "https://api.github.com/repos/shaunew/Pac-Man/issues/comments/4423538"
  },
  {
    "created_at": "2012-03-09T21:59:12Z",
    "updated_at": "2012-03-12T11:43:36Z",
    "body": "A pacman map generator attempt: http://www.allegro.cc/forums/thread/590486\r\n\r\ninteresting idea about looking at manipulating the environment to manipulate an object: https://en.wikipedia.org/wiki/User%3aDragentsheets/Antiobjects\r\n",
    "user": {
      "login": "shaunew",
      "id": 116838,
      "url": "https://api.github.com/users/shaunew",
      "gravatar_id": "0bdd2d6d5051b610660baf5c22016639",
      "avatar_url": "https://secure.gravatar.com/avatar/0bdd2d6d5051b610660baf5c22016639?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
    },
    "id": 4425525,
    "url": "https://api.github.com/repos/shaunew/Pac-Man/issues/comments/4425525"
  },
  {
    "created_at": "2012-03-10T00:54:38Z",
    "updated_at": "2012-03-10T00:54:38Z",
    "body": "This pacman implementation here has a random maze that works well: http://www.masswerk.at/JavaPac/JS-PacMan2.html\r\n\r\nThe function is getRandomMaze() at http://www.masswerk.at/JavaPac/JS-pacman2_6.js",
    "user": {
      "login": "shaunew",
      "id": 116838,
      "url": "https://api.github.com/users/shaunew",
      "gravatar_id": "0bdd2d6d5051b610660baf5c22016639",
      "avatar_url": "https://secure.gravatar.com/avatar/0bdd2d6d5051b610660baf5c22016639?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
    },
    "id": 4427669,
    "url": "https://api.github.com/repos/shaunew/Pac-Man/issues/comments/4427669"
  },
  {
    "created_at": "2012-03-12T12:09:28Z",
    "updated_at": "2012-03-12T12:09:37Z",
    "body": "An article on using Clingo to generate maps: http://eis-blog.ucsc.edu/2011/10/map-generation-speedrun/\r\n\r\nA formal introduction to Answer Set Programming (ASP): http://mags.acm.org/communications/201112/?folio=92&CFID=57669445&CFTOKEN=76940163#pg94",
    "user": {
      "login": "shaunew",
      "id": 116838,
      "url": "https://api.github.com/users/shaunew",
      "gravatar_id": "0bdd2d6d5051b610660baf5c22016639",
      "avatar_url": "https://secure.gravatar.com/avatar/0bdd2d6d5051b610660baf5c22016639?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
    },
    "id": 4450438,
    "url": "https://api.github.com/repos/shaunew/Pac-Man/issues/comments/4450438"
  },
  {
    "created_at": "2012-03-22T17:10:43Z",
    "updated_at": "2012-03-22T17:10:43Z",
    "body": "Uploaded first attempt under /mapgen/answerset.  I read most of the paper on ASP, but I still don't have a good feel for it.  I was able to just specify what I **didn't** want to appear on the map, like dead ends, tight corners, fat paths, and skinny and fat walls.  It works, but it takes about 2 seconds to generate, so I'm not sure if I'm doing things the best way.\r\n\r\nI also need to figure out how to prevent disjoint paths, since every point in the path must be reachable from every other point in the path.  \r\n\r\nI may also need to start classifying certain sections of the map and limiting their number of appearances to create a more fun or playable map.\r\n\r\nThe blog post has been enormously helpful, so I may contact him for advice.",
    "user": {
      "login": "shaunew",
      "id": 116838,
      "url": "https://api.github.com/users/shaunew",
      "gravatar_id": "0bdd2d6d5051b610660baf5c22016639",
      "avatar_url": "https://secure.gravatar.com/avatar/0bdd2d6d5051b610660baf5c22016639?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
    },
    "id": 4643384,
    "url": "https://api.github.com/repos/shaunew/Pac-Man/issues/comments/4643384"
  },
  {
    "created_at": "2012-03-22T18:29:26Z",
    "updated_at": "2012-03-22T18:29:26Z",
    "body": "Choice rules are explained really well on the wikipedia page: http://en.wikipedia.org/wiki/Answer_set_programming\r\n\r\n'{a,b,c}.' means to choose an arbitrary subset.  Thus it will choose one from the following powerset at random:\r\n\r\n    { }\r\n    {a}\r\n    {b}\r\n    {c}\r\n    {a,b}\r\n    {b,c}\r\n    {a,c}\r\n    {a,b,c}\r\n\r\nIt also allows cardinality to be specified.  For instance '1{a,b,c}' will make sure that there is at least 1 atom in the chosen subset.  Further, '1{a,b,c}2' will make sure that there is at least 1 but not more than 2 atoms in the chosen subset.",
    "user": {
      "login": "shaunew",
      "id": 116838,
      "url": "https://api.github.com/users/shaunew",
      "gravatar_id": "0bdd2d6d5051b610660baf5c22016639",
      "avatar_url": "https://secure.gravatar.com/avatar/0bdd2d6d5051b610660baf5c22016639?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
    },
    "id": 4645198,
    "url": "https://api.github.com/repos/shaunew/Pac-Man/issues/comments/4645198"
  },
  {
    "created_at": "2012-06-20T13:07:23Z",
    "updated_at": "2012-06-20T13:07:23Z",
    "body": "I have an initial working version in the mapgen/tetris folder.  Will be playtesting soon and refining algorithm's layout decisions.  I also need to come up with an algorithm to determine where the pellets and energizers are located.",
    "user": {
      "login": "shaunew",
      "id": 116838,
      "url": "https://api.github.com/users/shaunew",
      "gravatar_id": "0bdd2d6d5051b610660baf5c22016639",
      "avatar_url": "https://secure.gravatar.com/avatar/0bdd2d6d5051b610660baf5c22016639?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
    },
    "id": 6453284,
    "url": "https://api.github.com/repos/shaunew/Pac-Man/issues/comments/6453284"
  },
  {
    "created_at": "2012-06-22T20:36:00Z",
    "updated_at": "2012-06-22T20:36:00Z",
    "body": "There is now a random maze generated at the start of each level of a game mode called 'Cookie-Man'.  I imagine I will keep tuning it, but it seems bug-free and generating decent maps.",
    "user": {
      "login": "shaunew",
      "id": 116838,
      "url": "https://api.github.com/users/shaunew",
      "gravatar_id": "0bdd2d6d5051b610660baf5c22016639",
      "avatar_url": "https://secure.gravatar.com/avatar/0bdd2d6d5051b610660baf5c22016639?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
    },
    "id": 6517613,
    "url": "https://api.github.com/repos/shaunew/Pac-Man/issues/comments/6517613"
  }
]
