1999Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: processors -->
<!--X-From-R13: [vx Qynexr <zvxpyexNvoz.arg> -->
<!--X-Date: Sun, 31 Jan 1999 10:50:29 &#45;0800 -->
<!--X-Message-Id: 36B4B5A0.6CB810C4#ibm,net -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: Pine.BSF.4.05.9901301831390.16840&#45;100000#shell9,ba.best.com -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Re: processors</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:mikclrk#ibm,net">
</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="msg00335.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00337.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00331.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00340.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00336">Author</A>
&nbsp;|&nbsp;<A HREF="#00336">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00336">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: processors</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] Re: processors</LI>
<LI><em>From</em>: Mik Clarke &lt;<A HREF="mailto:mikclrk#ibm,net">mikclrk#ibm,net</A>&gt;</LI>
<LI><em>Date</em>: Sun, 31 Jan 1999 19:57:20 +0000</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>
diablo#best,com wrote:
&gt; I am guessing the problem is processor-related becuase I was able to solve
&gt; most of the problem by reducing the number of calls per second our main
&gt; mobile ai routine gets. This fixed the problem we were having, which was
&gt; that our tasks (timed events) were taking WAY too long to go off. A 3
&gt; second task would take 20 seconds, but this only happened with a heavy
&gt; player load. Our tasks are held in a table indexed to some number (some
&gt; sort of ticker in linux? I don't know the proper names for anything). That
&gt; table is polled every time the game searches for player input (it cycles
&gt; through all our player lines constantly), and if a task is found to be
&gt; either overdue or ready to go off, it goes off. The problem comes when
&gt; those tasks start taking too long. This of course causes a cascading
&gt; effect as more and more tasks build up.

Sounds like a combination of CPU and design/algorythms.  Having hundreds
of calls for mob AI is ok, as long as the calls are short ones.  You can
fit in 100x9ms calls or 10x90ms calls and have breathing space.  Fixing
a CPU and fixing the code both make the call length shorter.  By the
sounds of it, you may have one or two processes that are taking
exceptionally long (maybe you could add code to time each call). 
Finding and fixing those is probably a good idea.  I'd suggest you start
looking for things in the area of mob navigation - one of those horrible
algorythms that searches the whole mud for object/mob x getting called
four or five times a second will kill almost anyones performance (and
its performance gets worse as the mud gets bigger).
 
&gt; Generally, the way the author of our language/engine explained it to us is
&gt; that the engine and language are not Object Oriented in order to be
&gt; faster, and in order to allow for more proactivity (as opposed to
&gt; reactivity). We will try reduce the drain that things like mobile ai put
&gt; on the processor, but it's a pretty heavy task, complete with string
&gt; manipulation and interpreting a mini-programming language we have inside
&gt; the game.

Ummm. Yuk. OO doesn't mean slower and it doesn't mean stupider.  What it
does mean is that the programmer has to be more aware of the hidden
implications of what they are doing. A good programmer can get OO just
as fast as non (and with source code that's a lot more maintainable). 
You want to absolutely minimise the string manipulation, expecially any
analyses of actions or speach (ala the classic ROM MobProgs).  Numbers
are a lot cheaper.  That's why I'm recoding to an event subsystem.  A
lot of work to make the code issue the events, but comparisons and
checks on them are very fast (maybe 10 instructions vs 1000).  Consider
precompiling (or at least tokenizing) your internal language.  Also look
out for looping mobs - you may get 3 or 4 mob loops, which burn tons of
CPU even when no-one is there to watch them.
 
&gt; Could someone like yourself, or someone similarly erudite about such
&gt; matters speed things up by recoding? Probably, but there's a lot of code,
&gt; and probably a _lot_ that needs doing.

Yep, and every little bit helps. As JCL says, it find out which bit is
the most important that's the tricky bit.

Mik
-- 
<A  HREF="http://www.geocities.com/SoHo/Cafe/2260">http://www.geocities.com/SoHo/Cafe/2260</A>


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00331" HREF="msg00331.html">[MUD-Dev] Re: processors</A></STRONG>
<UL><LI><EM>From:</EM> &lt;diablo#best,com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00335.html">[MUD-Dev] Re: processors</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00337.html">[MUD-Dev] Re: combat</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00331.html">[MUD-Dev] Re: processors</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00340.html">[MUD-Dev] Re: processors</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00336"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00336"><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>[MUD-Dev] Re: processors</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00319" HREF="msg00319.html">[MUD-Dev] Re: processors</A></strong>, 
Laurel Fan <a href="mailto:lf25+@andrew.cmu.edu">lf25+@andrew.cmu.edu</a>, Thu 28 Jan 1999, 20:35 GMT
<UL>
<LI><strong><A NAME="00323" HREF="msg00323.html">[MUD-Dev] Re: processors</A></strong>, 
Mik Clarke <a href="mailto:mikclrk#ibm,net">mikclrk#ibm,net</a>, Sat 30 Jan 1999, 12:26 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00329" HREF="msg00329.html">[MUD-Dev] Re: processors</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Sun 31 Jan 1999, 02:18 GMT
<UL>
<LI><strong><A NAME="00331" HREF="msg00331.html">[MUD-Dev] Re: processors</A></strong>, 
diablo <a href="mailto:diablo#best,com">diablo#best,com</a>, Sun 31 Jan 1999, 03:00 GMT
<UL>
<LI><strong><A NAME="00336" HREF="msg00336.html">[MUD-Dev] Re: processors</A></strong>, 
Mik Clarke <a href="mailto:mikclrk#ibm,net">mikclrk#ibm,net</a>, Sun 31 Jan 1999, 18:50 GMT
</LI>
<LI><strong><A NAME="00340" HREF="msg00340.html">[MUD-Dev] Re: processors</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Mon 01 Feb 1999, 06:22 GMT
<UL>
<LI><strong><A NAME="00341" HREF="msg00341.html">[MUD-Dev] Re: processors</A></strong>, 
Marc Hernandez <a href="mailto:marc#ias,jb.com">marc#ias,jb.com</a>, Mon 01 Feb 1999, 07:08 GMT
</LI>
<LI><strong><A NAME="00344" HREF="msg00344.html">[MUD-Dev] Re: processors</A></strong>, 
Adam Wiggins <a href="mailto:adam#angel,com">adam#angel,com</a>, Mon 01 Feb 1999, 18:53 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00342" HREF="msg00342.html">[MUD-Dev] Re: processors</A></strong>, 
Petri Virkkula <a href="mailto:pvirkkul#iki,fi">pvirkkul#iki,fi</a>, Mon 01 Feb 1999, 07:36 GMT
</LI>
</UL>
</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>