home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!uwm.edu!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!sm86+
- From: sm86+@andrew.cmu.edu (Stefan Monnier)
- Newsgroups: comp.sys.atari.st.tech
- Subject: Re: "fast" sprites in C
- Message-ID: <UefNt=q00VorIjCEdL@andrew.cmu.edu>
- Date: 8 Sep 92 22:48:43 GMT
- Article-I.D.: andrew.UefNt=q00VorIjCEdL
- References: <61138@aurs01.UUCP>
- Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
- Lines: 60
- In-Reply-To: <61138@aurs01.UUCP>
-
- Excerpts from netnews.comp.sys.atari.st.tech: 8-Sep-92 "fast" sprites in
- C John M. Klassa@aurs01.UU (1651)
-
- > Hi All-
-
- > I've attempted, on a couple of occasions, to write silly little games
- > for my own amusement. What I always run into, though, is terrible,
- > terrible performance when I try to put objects on the screen and
- > animate them. My mind keeps going back to that ST classic
- > "Megaroids," which was claimed to have been written in C (although I'm
- > not positive that they didn't use assembler in there somewhere). How
- > do you, the readers of comp.sys.atari.st.tech, get good performance
- > when doing sprites? *Must* I use assembler, or can it be done in C?
- > (My problem is that I don't know assembler...) On a related topic, I
- > remember a long discussion between (I think) Dave Baggett and somebody
- > else, on the topic of double-buffering & handling it during vbl and so
- > on... Is double-buffering pretty much the only way to give animated
- > games that "smooth" look? If so, I would imagine that assembly is
- > required there, too...
-
- > Thanks for any and all input!
- > John
-
- > P.S. How do y'all handle keyboard input? i.e. How can I detect when
- > multiple keys are in the down position? How can I turn every
- > key into a "shift-like" key, so that the player can hold it down
- > as long as he/she wants to without it going into repeat mode, etc.?
-
- > Thanks again!
-
- > o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
- > o John M. Klassa o
- > o Alcatel Network Systems, Inc. --- Raleigh, NC --- (919) 850-1246 o
- > o Email: klassa%aurfs1.aur.alcatel.com@rockdal.aud.alcatel.com o
- > o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
-
- Sure, assembly is necessary if you realy want to get the speed of
- current games. But, you can do games without !
-
- Double buffering is available from about any language (XBIOS)
- And for fast animated sprites, you HAVE to do 'precomputing',
- that is preparing the data so that wherever your sprite should
- appear, it just has to be put there without having anything more
- to compute (bit shifting,...).
-
- But, sure this precise part of sprite display should be written in
- assembler, as you sure can get a speed improvement of about 2 to
- much more (depending on the compiler and on you).
-
- In general, high speed can be achieved with a little of assembler
- on the critical points and a lot of C for the rest. Of course
- all assembly can give you a bit mor speed (helpful to
- get the real 'video-game' feeling, I think)
-
- Stefan Monnier
-
-
- -----------------------------------------------------
- -- On the average, people seem to be acting normal --
- -----------------------------------------------------
-