{"action":"created","issue":{"url":"https://api.github.com/repos/aura-project/aura/issues/189","repository_url":"https://api.github.com/repos/aura-project/aura","labels_url":"https://api.github.com/repos/aura-project/aura/issues/189/labels{/name}","comments_url":"https://api.github.com/repos/aura-project/aura/issues/189/comments","events_url":"https://api.github.com/repos/aura-project/aura/issues/189/events","html_url":"https://github.com/aura-project/aura/issues/189","id":124615524,"number":189,"title":"AI logic change","user":{"login":"exectails","id":5593920,"avatar_url":"https://avatars.githubusercontent.com/u/5593920?v=3","gravatar_id":"","url":"https://api.github.com/users/exectails","html_url":"https://github.com/exectails","followers_url":"https://api.github.com/users/exectails/followers","following_url":"https://api.github.com/users/exectails/following{/other_user}","gists_url":"https://api.github.com/users/exectails/gists{/gist_id}","starred_url":"https://api.github.com/users/exectails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exectails/subscriptions","organizations_url":"https://api.github.com/users/exectails/orgs","repos_url":"https://api.github.com/users/exectails/repos","events_url":"https://api.github.com/users/exectails/events{/privacy}","received_events_url":"https://api.github.com/users/exectails/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aura-project/aura/labels/backlog","name":"backlog","color":"508abf"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-01-02T22:45:54Z","updated_at":"2016-07-11T09:25:39Z","closed_at":"2016-07-11T09:25:39Z","body":"I'm not sure whether to do this before or after the planned rewrite, but it will be a necessary change either way.\r\n\r\nRight now we call into the AI, to notify it about it having been attacked. Inside that method we switch the current state, depending on what happened, resetting, or running reaction events. Another method is used to tell the AI that its creature used a skill, so `CompleteSkill` is called. But that's not all we need.\r\n\r\nAdditionally, to mimic official behavior, we need at least 2 more. One for informing the AI that a nearby creature was attacked, for AIs that hate when you attack a certain other race, and one for when the AI knocks someone back, so it cancels its attack and doesn't continue attacking the downed target (#183).\r\n\r\nThis really isn't viable, especially since these methods also have to be synchronized with the AI, so you don't suddenly set something while the AI is active. But I think there's a simple solution.\r\n\r\nInstead of telling the AI exactly what happened, it could just figure it out for itself. Just like the combat action is sent to all nearby clients, so they can display it, they can be passed to all nearby AIs, which then handle the information. \"Did I use a skill?\", \"Did a nearby friend get attacked?\", \"Did I knock back someone?\", these questions are no problem, if the AI simply has access to the combat actions.\r\n\r\nSince multiple things could happen between two AI heartbeats, we'd need a queue of `CombatActionPack`s, which are parsed and handled on the next heartbeat. They would simply read the information and act upon it.\r\n\r\nSince the AI will never do anything outside of its hearbeat, this shouldn't change their behavior in any way, just that we have finally all information available, and thanks to that can do more. Without adding methods left and right, to tell the AI all kinds of things."},"comment":{"url":"https://api.github.com/repos/aura-project/aura/issues/comments/231684473","html_url":"https://github.com/aura-project/aura/issues/189#issuecomment-231684473","issue_url":"https://api.github.com/repos/aura-project/aura/issues/189","id":231684473,"user":{"login":"exectails","id":5593920,"avatar_url":"https://avatars.githubusercontent.com/u/5593920?v=3","gravatar_id":"","url":"https://api.github.com/users/exectails","html_url":"https://github.com/exectails","followers_url":"https://api.github.com/users/exectails/followers","following_url":"https://api.github.com/users/exectails/following{/other_user}","gists_url":"https://api.github.com/users/exectails/gists{/gist_id}","starred_url":"https://api.github.com/users/exectails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exectails/subscriptions","organizations_url":"https://api.github.com/users/exectails/orgs","repos_url":"https://api.github.com/users/exectails/repos","events_url":"https://api.github.com/users/exectails/events{/privacy}","received_events_url":"https://api.github.com/users/exectails/received_events","type":"User","site_admin":false},"created_at":"2016-07-11T09:25:39Z","updated_at":"2016-07-11T09:25:39Z","body":"Closing, as this will be part of #171."}}
{"actor":{"display_login":"exectails"}}