Xref: utzoo rec.games.hack:4883 comp.sys.mac.programmer:8404
Path: utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!csd4.csd.uwm.edu!mailrus!iuvax!ndcheg!ndmath!milo
From: milo@ndmath.UUCP (Greg Corson)
Newsgroups: rec.games.hack,comp.sys.mac.programmer
Subject: Re: Any word on NetHack 3.0 for Mac?
Message-ID: <1537@ndmath.UUCP>
Date: 19 Aug 89 15:16:39 GMT
References: <1989Aug18.210038.5272@fxgrp.fx.com>
Organization: Math. Dept., Univ. of Notre Dame
Lines: 45

From article <1989Aug18.210038.5272@fxgrp.fx.com>, by wiedmann@plover.fx.com (Christian Wiedmann):
>>slow.  My main gripe with NetHack on the Mac is the speed of output.  There
>>is no reason why a 9600 baud terminal should output faster than the screen.
> 
> I've written some output routines on the Mac (unfortunately they probably
> wouldn't be useful for this purpose), and I can tell you that it's hard to
> get any reasonable performance out of the Mac. I'd be impressed by a terminal
> emulator which could run at 9600 baud throughput.

It's not terriblly difficult to get 9600 baud throughput on the Mac, 
particularly if you are writing something that doesn't do serial I/O.  I've
put together terminal programs that run at between 19200 and 9600 baud 
throughput with minimal or no handshaking.  Those programs used some 
optimized font drawing routines, but you can get better performance without
going quite that far.  Some tips include:

1. Minimize the number of quickdraw calls, drawing one character at a time is
   much slower than drawing a bunch of characters with ONE call.

2. Keep an image of the characters on-screen in an array somewhere, for 
   update event processing.

3. Don't try to do "optimized updates" like Unix "curses" does.  On the Mac
   it's probably faster to blow up a whole new screen than to take the time
   to figure what characters have changed and update just them.

4. Don't clear the screen unless you have to...I believe, if you use
   srcCopy (I think that's it) drawing mode the new text characters will
   automatically overlay the old ones.

For what it's worth, a port of NetHack to the Mac would probably be a lot 
quicker and more fun to play if better use of the mac menus were used.
An obvious thing to put in menus would be the inventory, with each type of
item under a different menu header.  This shouldn't be too hard to do...

Also, another way to speed things up might be to use a pop-up window or a 
seperate area of the window for some of NetHack's messages to the user.  That
way the screen wouldn't have to be updated quite so often.

Greg Corson
19141 Summers Drive
South Bend, IN 46637
(219) 277-5306 
{pur-ee,rutgers,uunet}!iuvax!ndmath!milo