1997Q4/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Task Parsing -->
<!--X-From-R13: Egrcura Lrcc <mbenaNravq.pbz> -->
<!--X-Date: Sat, 27 Dec 1997 20:12:17 +0000 -->
<!--X-Message-Id: 34A56121.6036DDC6#enid,com -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Task Parsing</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:zoran#enid,com">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00982.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00987.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00996.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00997.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00983">Author</A>
&nbsp;|&nbsp;<A HREF="#00983">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00983">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Task Parsing</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: MUD- Dev &lt;<A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A>&gt;</LI>
<LI><em>Subject</em>: Task Parsing</LI>
<LI><em>From</em>: Stephen Zepp &lt;<A HREF="mailto:zoran#enid,com">zoran#enid,com</A>&gt;</LI>
<LI><em>Date</em>: Sat, 27 Dec 1997 14:12:17 -0600</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Jon A. Lambert said,

How do AI nodes work?  That's one topic I haven't a clue on.  The only
poster I'm aware of who seems to have a good handle on this is Nathan.
After exploring some of the AI/ANN web sites, I think I understand why
why there hasn't been much in-depth discussion of the topic.  

Disclaimer:  This is probably not the book answer.  This is one hobbyist coder's attempt to do cool things with estates.

I sort of misspoke.  At the moment, I'm actually working on the task handler portion, which is not a true ai, as the
actor doesn't actually make any goal oriented decisions.

However, here is what I'm working on: :)
	I have an estate management system which let's players attract populations, hire workgroups, build buildings, and
expand their estate.  Workgroups can be assigned to harvest resources from the terrain around them, carry them to
buildings which process them into refined resources, or items ( lumbermill turns raw lumber into boards, smithy makes a
shortsword from 3 iron, or a breastplate from 5 iron 2 leather 1 cloth ), or use them to construct new buildings with
various effects.
	Currently, players ( or npcs, though that's the ai part that is still in design ) may assign a specific workgroup a
task such as:
  harvest lumber
  patrol from path1 to path2 to path3 to path1
  build fountain at location1

Currently what I'm tuning is the assignment task parser, which breaks a seemingly simple task like harvest lumber into:
  seek work find lumber process lumber deliver lumber repeat all

seek work:  sends to the workgroup back to their assigned workplace, to serve as a starting point.
find lumber:  checks their info nodes to see if they know of a specific place to find lumber ( a lumber resource site ).
If so, hunt that room, if not, enter a search pattern
process lumber:  work the resource site, and pick up the lumber when it is finally produced
deliver lumber: hunt their workplace, then either place all the lumber they have in storage ( storage building ) or drop
it, as appropriate
repeat all:  self explanatory

	To handle this expanded task string, the code calls a function that parses the various sub tasks into what I call ai
nodes, which construct the various state machine values for processing, such as:
"seek work" becomes:
 ai_node_goal_type AI_GOAL_SEEK_ROOM
 ai_node_target_type AI_TARGET_TYPE_ROOM
 ai_node_target (room_index_data *) target = ( known information about a 	lumber site from the ai info list of the actor
)
 ai_node_status AI_STATUS_WORKING

We then add that node to the actors ai-&gt;node_list, and continue on until the task string is empty.

From there, you parse the node on top of the ai_node list, run it through the task handler state machine ( which is
really just a huge set of nested switch statements ), and the workgroup is on it's way.

I'm currently working on message handling between actors ( wg A is attempting to build a wall, but needs 3 more stone. 
Currently, they inject a harvest stone task in front of the build wall task, and start working on that next iteration. 
What I want to do is to send a message back to the estate itself requesting stone, and the message handler will find
idling workgroups that haven't been reserved, and assign them that task.  This is where the goal setting/goal handling
portion is starting to come in, which to me is all the AI I really need at the moment.

In many ways, this could be handled within the Merc mob prog enhancement ( or whatever you have for "programming" mobs
), but it is a lot more generic, pulling most of the information one level up so that it can be used with any actor_type
( ACTOR_TYPE_ROOM, ACTOR_TYPE_ESTATE, ACTOR_TYPE_WORKGROUP are all valid, just need to alias their specfic data into the
state maching properly ).  I'm having some difficulties with re-ordering goal priorities, which are going to become more
important when this system is used from the npc standpoint.

	As an aside, this all resulted from wanting to have a resource based economy, and not having many builders for my game
persist ( they all give up, it's too much work :P )...the system is designed to take a terrain map, and allow the system
to build an explorable, operating "area" out of it, wether it be a city, cavern, ship, whatever.  All world objects are
created using this system, and while very rough, the economy runs off of it at the moment.  Trade, including barter and
regional exchange is in the works, along with pretty much anything that you would need to do as an estate manager.  It's
fun, too :)

Z

</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00997" HREF="msg00997.html">Re: [MUD-Dev] Task Parsing</A></strong>
<ul compact><li><em>From:</em> Greg Munt &lt;greg#uni-corn,demon.co.uk&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00982.html">Re: [MUD-Dev]  You, the game of philosophy.</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00987.html">Re: [MUD-Dev] Wild west (was Guilds &amp; Politics)</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00996.html">Task Parsing (repost for format)</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00997.html">Re: [MUD-Dev] Task Parsing</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00983"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00983"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>FAQ: Personalities</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<LI><strong><A NAME="01038" HREF="msg01038.html">FAQ: Personalities</A></strong>, 
Ling <a href="mailto:K.L.Lo-94#student,lboro.ac.uk">K.L.Lo-94#student,lboro.ac.uk</a>, Wed 31 Dec 1997, 00:35 GMT
<UL>
<LI><strong><A NAME="01041" HREF="msg01041.html">Re: FAQ: Personalities</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Wed 31 Dec 1997, 07:15 GMT
</LI>
</UL>
</LI>
</ul>
</ul>
</LI>
<LI><strong><A NAME="01010" HREF="msg01010.html">Re: [MUD-Dev] The impact of the web on muds</A></strong>, 
Travis Casey <a href="mailto:efindel#polaris,net">efindel#polaris,net</a>, Mon 29 Dec 1997, 21:06 GMT
<LI><strong><A NAME="00996" HREF="msg00996.html">Task Parsing (repost for format)</A></strong>, 
Stephen Zepp <a href="mailto:zoran#enid,com">zoran#enid,com</a>, Sun 28 Dec 1997, 19:35 GMT
<LI><strong><A NAME="00983" HREF="msg00983.html">Task Parsing</A></strong>, 
Stephen Zepp <a href="mailto:zoran#enid,com">zoran#enid,com</a>, Sat 27 Dec 1997, 20:12 GMT
<UL>
<LI><strong><A NAME="00997" HREF="msg00997.html">Re: [MUD-Dev] Task Parsing</A></strong>, 
Greg Munt <a href="mailto:greg#uni-corn,demon.co.uk">greg#uni-corn,demon.co.uk</a>, Sun 28 Dec 1997, 20:22 GMT
<UL>
<LI><strong><A NAME="00998" HREF="msg00998.html">Re: [MUD-Dev] Task Parsing</A></strong>, 
Stephen Zepp <a href="mailto:zoran#enid,com">zoran#enid,com</a>, Sun 28 Dec 1997, 20:47 GMT
</LI>
<LI><strong><A NAME="01040" HREF="msg01040.html">Re: [MUD-Dev] Task Parsing</A></strong>, 
Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Wed 31 Dec 1997, 04:33 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00979" HREF="msg00979.html">Mud Settings</A></strong>, 
Greg Munt <a href="mailto:greg#uni-corn,demon.co.uk">greg#uni-corn,demon.co.uk</a>, Sat 27 Dec 1997, 15:40 GMT
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>