Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: Elliott Lee Newsgroups: scea.yaroze.programming.2d_graphics Subject: Re: Collision Detection Date: Mon, 27 Jul 1998 13:52:33 -0700 Organization: Cisco Systems Lines: 44 Message-ID: <35BCE890.89FF92D0@jps.net> References: <01bdb8c7$48efce00$0100fc9d@skynet> Reply-To: tenchi@jps.net NNTP-Posting-Host: dhcp-m-62-249.cisco.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.03 [en] (Win95; U) These are some theories that may just work: Antony Arciuolo wrote: > > What is the best method of collision detection for a Starcraft-ish game? > > Two problems: One is that the square sprite is rotated, so how can the Use a circle instead of a square. OK, when the sprite is "straight", it will cover a little more area that you'd like to, but it should be OK for most purposes. I'd make the circle (or elipse, actually) just a little smaller than the longest line from the dead center of the sprite to one of the corners. [...] > The other is that for some of this, the object is highly irregular, like a > puddle or lake. It is a key component of the project that the puddle be > this irregular, so redesigning the puddle so it is more square is an > unfavored option. Well, since this object is probably part of the playing field, why not make the playfield into a grid and have the lake span multiple grid cells. You've seen games like Sim City, aye? you can clearly see the cells that have water and those that do not. In Star Craft, the same grid system appears to be employed, although with the funky rounded graphics for edges of, say, higher terrains appear to be rounded even though they are not. > My real question is can I directly access the frame buffer (a short > GetPixel(short X, short Y) function) and how can I use this to reference > the palette of the puddle so I can use palette collision detection? [...] Hehee... I used to do that a long time ago. It's OK but just wait until you have objects that overlap that visual space. Plus, you'll have to make sure you make a background snapshot of the ground BEFORE you slap graphics down on top, otherwise you'll end up getting all the wrong colors. ^_^ I think your best move is probably the grid system. Mata ne, ... ... - e! ::' tenchi@shell.jps.net ':: (Protocol) :: ACiD -/- ACS -/- pHluid -/- Yaroze -/- Nemesis :: (Tenchikun) ::. http://www.jps.net/tenchi .:: ''' '''