{"action":"closed","issue":{"url":"https://api.github.com/repos/sethten/screeps/issues/1","repository_url":"https://api.github.com/repos/sethten/screeps","labels_url":"https://api.github.com/repos/sethten/screeps/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/sethten/screeps/issues/1/comments","events_url":"https://api.github.com/repos/sethten/screeps/issues/1/events","html_url":"https://github.com/sethten/screeps/issues/1","id":177695599,"number":1,"title":"New creeps will not spawn","user":{"login":"sethten","id":5026621,"avatar_url":"https://avatars.githubusercontent.com/u/5026621?v=3","gravatar_id":"","url":"https://api.github.com/users/sethten","html_url":"https://github.com/sethten","followers_url":"https://api.github.com/users/sethten/followers","following_url":"https://api.github.com/users/sethten/following{/other_user}","gists_url":"https://api.github.com/users/sethten/gists{/gist_id}","starred_url":"https://api.github.com/users/sethten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethten/subscriptions","organizations_url":"https://api.github.com/users/sethten/orgs","repos_url":"https://api.github.com/users/sethten/repos","events_url":"https://api.github.com/users/sethten/events{/privacy}","received_events_url":"https://api.github.com/users/sethten/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-19T02:47:04Z","updated_at":"2016-09-21T01:03:25Z","closed_at":"2016-09-21T01:03:25Z","body":"The logic behind this issue is [here](https://github.com/sethten/screeps/blob/11b979ce484a5ac01ad19aea998480936d59eb30/main.js#L29).\r\nCurrently it tries to create a creep with a name of \"Snowflake\" with the next number. Let's say we have Snowflake{1,2,3}, everyone is happy. In a number of ticks Snowflake1's time to live drops to 0 and it decays. Now there is only Snowflake2 and Snowflake3. `needMoreSnowflakes` turns true and the if statement's body is executed. What name will it use?\r\n`'Snowflake' + (Object.keys(Game.creeps).length + 1)`\r\n`'Snowflake' + (2 + 1)`\r\n`'Snowflake3'`\r\nBut wait, there already is a Snowflake3! The `[createCreep](http://support.screeps.com/hc/en-us/articles/205990342-StructureSpawn#createCreep)` fails with `ERR_NAME_EXISTS`. If they were spawned in name order and Snowflake2 dies next then Snowflake3 will be the only living creep. When it dies the name Snowflake3 is finally available, and if Arendelle has at least 250 energy it will spawn Snowflake3. It should have >=250 energy to avoid extinction. However, progress will halt until Snowflake3 dies, and when it respawns it will not spawn its siblings.\r\nThe most simple solution would be to omit the name parameter and let Screeps pick one randomly. We want our snowflakes, though :3"}}
{"actor":{"display_login":"sethten"}}