1999Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] optimizing code -->
<!--X-From-R13: <qvnoybNorfg.pbz> -->
<!--X-Date: Mon, 8 Feb 1999 22:31:41 &#45;0800 -->
<!--X-Message-Id: Pine.BSF.4.05.9902082220460.11409&#45;100000#shell9,ba.best.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199902090559.WAA01232@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] optimizing code</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:diablo#best,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="msg00372.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00374.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00371.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00374.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00373">Author</A>
&nbsp;|&nbsp;<A HREF="#00373">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00373">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] optimizing code</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: [MUD-Dev] optimizing code</LI>
<LI><em>From</em>: &lt;<A HREF="mailto:diablo#best,com">diablo#best,com</A>&gt;</LI>
<LI><em>Date</em>: Mon, 8 Feb 1999 22:31:30 -0800 (PST)</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
This is in reply largely to a recent post by Mr. Gray. In it, he mentioned
that a significant part of his processor overhead was due to his 150
mobiles all moving about every 2 seconds.

Mobile ai is the biggest pain in my neck, and I'd love to hear ideas on
how to improve them generally while retaining most or all of the
functionality.

Essentially, our mobiles have two "timers" attached to them. One covers
attacking and one covers most other things. Every half-second, the code
decrements each timer on every mobile. If the timer is up, it checks to
see if the mobile should be doing something (either attacking someone or
doing whatever else). Now, our actual routines are not that complicated.
Quite a few mobiles (mountain lions, elk, rabbits, thugs in the sewers,
etc) wander around randomly, but other than that, mobiles that are not
directly involved with a player (and aren't wounded or whatnot) don't do
much.

I cannot really think of a better way to do this in principle and I'm
wondering if any of you can. I use a custom language and compiler, so keep
that in mind when offering language-specific suggestions. I'm sure some of
you clever coders out there have much better ways of doing things, and I'm
sure many of us could benefit from your knowledge. Thanks!

--matt




</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="00374" HREF="msg00374.html">[MUD-Dev] Re: optimizing code</A></strong>
<ul compact><li><em>From:</em> Hans-Henrik Staerfeldt &lt;hhs#cbs,dtu.dk&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00371" HREF="msg00371.html">[MUD-Dev] code profiling</A></STRONG>
<UL><LI><EM>From:</EM> Chris Gray &lt;cg#ami-cg,GraySage.Edmonton.AB.CA&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00372.html">[MUD-Dev] Re: Question on c++ switch optimization, and parsers in general.</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00374.html">[MUD-Dev] Re: optimizing code</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00371.html">[MUD-Dev] code profiling</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00374.html">[MUD-Dev] Re: optimizing code</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00373"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00373"><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><A NAME="00376" HREF="msg00376.html">[MUD-Dev] World-file parsing and RTTI?</A></strong>, 
The Arrow <a href="mailto:arrow#trelleborg,mail.telia.com">arrow#trelleborg,mail.telia.com</a>, Wed 10 Feb 1999, 18:45 GMT
<UL>
<LI><strong><A NAME="00377" HREF="msg00377.html">[MUD-Dev] Re: World-file parsing and RTTI?</A></strong>, 
Mark Gritter <a href="mailto:mark#erdos,Stanford.EDU">mark#erdos,Stanford.EDU</a>, Wed 10 Feb 1999, 22:55 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00375" HREF="msg00375.html">[MUD-Dev] Re: optimizing code</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Wed 10 Feb 1999, 02:41 GMT
<LI><strong><A NAME="00371" HREF="msg00371.html">[MUD-Dev] code profiling</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Tue 09 Feb 1999, 06:00 GMT
<UL>
<LI><strong><A NAME="00373" HREF="msg00373.html">[MUD-Dev] optimizing code</A></strong>, 
diablo <a href="mailto:diablo#best,com">diablo#best,com</a>, Tue 09 Feb 1999, 06:31 GMT
<UL>
<LI><strong><A NAME="00374" HREF="msg00374.html">[MUD-Dev] Re: optimizing code</A></strong>, 
Hans-Henrik Staerfeldt <a href="mailto:hhs#cbs,dtu.dk">hhs#cbs,dtu.dk</a>, Tue 09 Feb 1999, 14:58 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00366" HREF="msg00366.html">[MUD-Dev] Re: Question on c++ switch optimization, and parsers in general.</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Tue 09 Feb 1999, 03:31 GMT
<UL>
<LI><strong><A NAME="00369" HREF="msg00369.html">[MUD-Dev] Re: Question on c++ switch optimization, and parsers in general.</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Tue 09 Feb 1999, 04:34 GMT
<UL>
<LI><strong><A NAME="00372" HREF="msg00372.html">[MUD-Dev] Re: Question on c++ switch optimization, and parsers in general.</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Tue 09 Feb 1999, 06:01 GMT
</LI>
</UL>
</LI>
</UL>
</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>