{"id":97,"date":"2006-06-28T14:22:29","date_gmt":"2006-06-28T12:22:29","guid":{"rendered":"http:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/?p=97"},"modified":"2006-06-28T16:32:11","modified_gmt":"2006-06-28T14:32:11","slug":"from-goal-to-behaviour","status":"publish","type":"post","link":"https:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/?p=97","title":{"rendered":"From goal to behaviour"},"content":{"rendered":"<p>Originally we had planned to re-use the Action List system that we had developed for <a href=\"http:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/?p=19\">8<\/a> but reading <a href=\"http:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/?p=101\">Elizabeth Gordon&#8217;s article<\/a> about behaviours as lists of rules has made us reconsider.<\/p>\n<p>Objects offer opportunities to an actor. Each opportunity consists of a sequence of actions required to achieve the goal of the opportunity. For example the opportunity &#8220;Drink&#8221; translates to &#8220;go to the table, pick up the glass, drink, put down the glass, sigh&#8221;. We will call such a sequence a <strong>behaviour<\/strong>.<\/p>\n<p><em>The behaviour -or action sequence- could be stored with the object. Or the object could refer to a generic behaviour stored indepedently -so that the behaviour could be shared by multiple objects.<\/em><\/p>\n<p>The original idea was to simply store a behaviour as a list of actions. This list would be copied to an actor&#8217;s Action List when the opportunity is chosen as a goal. Then the actor would do each action on the list and remove it when it&#8217;s done. When the Action List is empty, the actor does idle behaviour until a new goal is selected.<\/p>\n<p><em>This is a slight simplification for the sake of argument. In reality, a new goals can be chosen at any time, possibly interrupting and replacing the current sequence.<\/em><\/p>\n<p>Miss Gordon&#8217;s idea could be applied to Drama Princess as follows.<\/p>\n<p>Rather than a simple list of actions, the actions would be arranged in an <strong>if-then-else<\/strong> series with the final goal at the top of the list and the first thing to do at the bottom. And rather than copying this sequence, the actor would simply remember the location of the behaviour and read it directly from there.<\/p>\n<p>Rather than a simple action, each line of the list would include a <strong>condition<\/strong> for this action to happen. So in our previous example, the behaviour would read like &#8220;if you have put down the glass then sigh, else if you have drunk then put down the glass, else if you have a glass in your hand then drink, else if you&#8217;re close to the table then pick up the glass, else if you can see the table then walk to the table, else give up or refuse.&#8221;<br \/>\nThe conditions could be more complex, like &#8220;if you&#8217;re close to the table and the class is not dirty&#8221; or &#8220;if you can see the table and it&#8217;s not too far&#8221;, etcetera. For Drama Princess, it will be important that these conditions can be described in an <strong>objective<\/strong> way. &#8220;Too far&#8221; might be different for each character so we cannot hard-code a number of meters in the condition.<\/p>\n<p>Rather than keeping track of when an action has been completed in order to proceed to the next line in the Action List, the actor would simply call the complete behaviour all the time and automatically move up the list when an action is complete (i.e. when a condition evaluates as true). The end-to-start order means that the actor wouldn&#8217;t even <em>try<\/em> to walk to the table if it already has a glass in its hand, e.g.<\/p>\n<p>Such a system simplifies Drama Princess in two ways.<\/p>\n<ul>\n<li>It removes the requirement of copying the action sequence. In fact it removes the requirement of an actor <em>having<\/em> an Action List altogether.<\/li>\n<li>And it removes seperate checking for subgoals achievement since this is built into the format of the list of rules.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Originally we had planned to re-use the Action List system that we had developed for 8 but reading Elizabeth Gordon&#8217;s article about behaviours as lists of rules has made us reconsider. Objects offer opportunities to an actor. Each opportunity consists of a sequence of actions required to achieve the goal of the opportunity. For example [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-97","post","type-post","status-publish","format-standard","hentry","category-development"],"_links":{"self":[{"href":"https:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/index.php?rest_route=\/wp\/v2\/posts\/97","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=97"}],"version-history":[{"count":0,"href":"https:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tale-of-tales.com\/DramaPrincess\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}