{"action":"created","issue":{"url":"https://api.github.com/repos/Chris3606/GoRogue/issues/56","repository_url":"https://api.github.com/repos/Chris3606/GoRogue","labels_url":"https://api.github.com/repos/Chris3606/GoRogue/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/Chris3606/GoRogue/issues/56/comments","events_url":"https://api.github.com/repos/Chris3606/GoRogue/issues/56/events","html_url":"https://github.com/Chris3606/GoRogue/issues/56","id":350935183,"node_id":"MDU6SXNzdWUzNTA5MzUxODM=","number":56,"title":"CellularAutomataGenerator.Generate Generates Fully Solid Maps Sometimes","user":{"login":"nightblade9","id":31222662,"node_id":"MDQ6VXNlcjMxMjIyNjYy","avatar_url":"https://avatars1.githubusercontent.com/u/31222662?v=4","gravatar_id":"","url":"https://api.github.com/users/nightblade9","html_url":"https://github.com/nightblade9","followers_url":"https://api.github.com/users/nightblade9/followers","following_url":"https://api.github.com/users/nightblade9/following{/other_user}","gists_url":"https://api.github.com/users/nightblade9/gists{/gist_id}","starred_url":"https://api.github.com/users/nightblade9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nightblade9/subscriptions","organizations_url":"https://api.github.com/users/nightblade9/orgs","repos_url":"https://api.github.com/users/nightblade9/repos","events_url":"https://api.github.com/users/nightblade9/events{/privacy}","received_events_url":"https://api.github.com/users/nightblade9/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-08-15T19:28:35Z","updated_at":"2018-08-16T23:59:24Z","closed_at":"2018-08-16T17:20:15Z","author_association":"NONE","body":"I [wrote a unit-test](https://github.com/nightblade9/escape-to-earth/blob/master/EscapeToEarth.UnitTests/Generators/MapGeneratorTests.cs) for my map generation code. At a high-level, my map generation executes the following steps:\r\n\r\n- Call `CellularAutomataGenerator.Generate(w, h)`\r\n- Call `RandomPosition(true)` on the result and place the player there\r\n- Call `RandomPosition(true)` again until we get a spot far enough away from the player, and place stairs there\r\n\r\nFor this, I need a map that is sufficiently large; but the problem is, to verify that I have a walkable path from the player to the stairs, I need to pathfind. I've implemented a basic depth-first search.\r\n\r\nThe runtime is deplorable. To manage this, I try to keep the map as small as possible.\r\n\r\nI noticed that, with maps of sufficiently small size, `CellularAutomataGenerator.Generate` returns an array where every value is false. This happens frequently on maps that are `10x10` and around once every 5-6 times in a map that's `15x15`.  In other cases, a `15x15` map generates with only five-ish walkable tiles.\r\n\r\nIs this a bug, or a limitation? Is there a minimum size I can/should use?"},"comment":{"url":"https://api.github.com/repos/Chris3606/GoRogue/issues/comments/413718819","html_url":"https://github.com/Chris3606/GoRogue/issues/56#issuecomment-413718819","issue_url":"https://api.github.com/repos/Chris3606/GoRogue/issues/56","id":413718819,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzcxODgxOQ==","user":{"login":"Chris3606","id":6090062,"node_id":"MDQ6VXNlcjYwOTAwNjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6090062?v=4","gravatar_id":"","url":"https://api.github.com/users/Chris3606","html_url":"https://github.com/Chris3606","followers_url":"https://api.github.com/users/Chris3606/followers","following_url":"https://api.github.com/users/Chris3606/following{/other_user}","gists_url":"https://api.github.com/users/Chris3606/gists{/gist_id}","starred_url":"https://api.github.com/users/Chris3606/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chris3606/subscriptions","organizations_url":"https://api.github.com/users/Chris3606/orgs","repos_url":"https://api.github.com/users/Chris3606/repos","events_url":"https://api.github.com/users/Chris3606/events{/privacy}","received_events_url":"https://api.github.com/users/Chris3606/received_events","type":"User","site_admin":false},"created_at":"2018-08-16T23:59:24Z","updated_at":"2018-08-16T23:59:24Z","author_association":"OWNER","body":"Ideally I would like to enforce a minimum size in code as you suggest -- my issue is determining what that minimum size would be in a use-case agnostic way.  The issue is that the minimum size is\r\n- dependent on the parameters given to the map function\r\n- not consistent, since RNG is involved.\r\n\r\nGiven a set of parameters, if generating a 15x15 map generates a useful map once, it doesn't mean it would the next time, or even a majority of the time -- the inverse also applies.  Thus, as you stated, it would be hard for me as a developer to determine the minimum size, because I'm determining, at best, what an acceptable chance of success is.  Furthermore, I think the amount of space that is \"acceptable\" probably depends on the use case, so it is best to leave it up to the user.  So, unfortunately, I think the best I could do is note a minimum size, or at least how the function parameters scale to a small map, in the documentation."}}
{"actor":{"display_login":"Chris3606"}}