{"action":"created","issue":{"url":"https://api.github.com/repos/paked/engi/issues/148","repository_url":"https://api.github.com/repos/paked/engi","labels_url":"https://api.github.com/repos/paked/engi/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/paked/engi/issues/148/comments","events_url":"https://api.github.com/repos/paked/engi/issues/148/events","html_url":"https://github.com/paked/engi/pull/148","id":139022887,"number":148,"title":"Detect unmet dependencies in entities at adding time to world","user":{"login":"faide","id":494577,"avatar_url":"https://avatars.githubusercontent.com/u/494577?v=3","gravatar_id":"","url":"https://api.github.com/users/faide","html_url":"https://github.com/faide","followers_url":"https://api.github.com/users/faide/followers","following_url":"https://api.github.com/users/faide/following{/other_user}","gists_url":"https://api.github.com/users/faide/gists{/gist_id}","starred_url":"https://api.github.com/users/faide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faide/subscriptions","organizations_url":"https://api.github.com/users/faide/orgs","repos_url":"https://api.github.com/users/faide/repos","events_url":"https://api.github.com/users/faide/events{/privacy}","received_events_url":"https://api.github.com/users/faide/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paked/engi/labels/feature","name":"feature","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/paked/engi/milestones/2","html_url":"https://github.com/paked/engi/milestones/Stability","labels_url":"https://api.github.com/repos/paked/engi/milestones/2/labels","id":1429384,"number":2,"title":"Stability","description":"Issues that will most-likely be addressed soon, because they make `engi` more stable. ","creator":{"login":"EtienneBruines","id":3962174,"avatar_url":"https://avatars.githubusercontent.com/u/3962174?v=3","gravatar_id":"","url":"https://api.github.com/users/EtienneBruines","html_url":"https://github.com/EtienneBruines","followers_url":"https://api.github.com/users/EtienneBruines/followers","following_url":"https://api.github.com/users/EtienneBruines/following{/other_user}","gists_url":"https://api.github.com/users/EtienneBruines/gists{/gist_id}","starred_url":"https://api.github.com/users/EtienneBruines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EtienneBruines/subscriptions","organizations_url":"https://api.github.com/users/EtienneBruines/orgs","repos_url":"https://api.github.com/users/EtienneBruines/repos","events_url":"https://api.github.com/users/EtienneBruines/events{/privacy}","received_events_url":"https://api.github.com/users/EtienneBruines/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":19,"state":"open","created_at":"2015-11-25T14:07:39Z","updated_at":"2016-03-08T11:05:54Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2016-03-07T16:25:58Z","updated_at":"2016-03-08T11:22:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/paked/engi/pulls/148","html_url":"https://github.com/paked/engi/pull/148","diff_url":"https://github.com/paked/engi/pull/148.diff","patch_url":"https://github.com/paked/engi/pull/148.patch"},"body":"Hi,\r\n\r\nHere is the beginning of a PR / Proposition to add some control / error checking on the entity requirements. ATM the PR only adds logging to warn the developer an entity is being added to a world that does not have the sufficient systems to support its operation.\r\n\r\nWe could add an error return to the  (*ecs.World).AddEntity signature and this would break all previous code relying on the old signature. Should we make this breaking change while we can or should we just keep the logging version?\r\n\r\nIntroducing this new feature I added a new private field (systemMap) to ecs.World for my own use and I also took advantage of it in (*ecs.World).HasSystem() implementation."},"comment":{"url":"https://api.github.com/repos/paked/engi/issues/comments/193736178","html_url":"https://github.com/paked/engi/pull/148#issuecomment-193736178","issue_url":"https://api.github.com/repos/paked/engi/issues/148","id":193736178,"user":{"login":"faide","id":494577,"avatar_url":"https://avatars.githubusercontent.com/u/494577?v=3","gravatar_id":"","url":"https://api.github.com/users/faide","html_url":"https://github.com/faide","followers_url":"https://api.github.com/users/faide/followers","following_url":"https://api.github.com/users/faide/following{/other_user}","gists_url":"https://api.github.com/users/faide/gists{/gist_id}","starred_url":"https://api.github.com/users/faide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faide/subscriptions","organizations_url":"https://api.github.com/users/faide/orgs","repos_url":"https://api.github.com/users/faide/repos","events_url":"https://api.github.com/users/faide/events{/privacy}","received_events_url":"https://api.github.com/users/faide/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T11:22:52Z","updated_at":"2016-03-08T11:22:52Z","body":"I am not in favour of panicking in this kind of situation. We are a library and should avoid panic situations as much as possible. The caller is responsible of handling any error if we choose to return an error.\r\nThe issue with panic is that it will happen at runtime and only when (and if) you add the specific entity that requires the missing system. And runtime crashes are really bad in any program and even more in games. If we look at the industry we see a lot of unfinished games with obvious bugs shipped to production. If such bugs led to runtime panic this would be even worse.\r\n\r\nNow we can argue knowingly shipping bugs to production is bad, but shipping crashing programs to production is even worse... In our case forgetting a system will lead to missing comportments in your game and thus somewhat \"visible\" bugs... but at least it won't crash (instantaneously).\r\n\r\nAnd as Etienne said I can imagine situations where I load entities from a data-table (cvs or whatever rulebook I choose) and the gameplay designer (a non coding person) can edit this rulebook and reference not-yet-added systems we just discussed together about. In this case I prefer to handle missing system errors gracefully as a way to remind me which system I need to implement and plug in my world rather than be forced to rush add a stub system to make my game testable by anyone in the team again."}}