Path: chuka.playstation.co.uk!news From: Steve Parnell Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Path Finding / Collision Detection Date: Thu, 10 Dec 1998 13:01:09 +0000 Organization: EIMC Lines: 36 Message-ID: <366FC615.6032F73@Bradford.ac.uk> References: <74muqb$6o64@scea> NNTP-Posting-Host: BOO-BOO.eimc.brad.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en Hi, I think basically 3 reasons: 1: Hexagons tessellate a plane, octagons etc don't. 2: Because of this, hexagon maps can easily be transformed to a regular 2D square grid and stored in a 2D array. 3: The centre of each of a hexagon's 6 neighbours is the same distance from the central hexagon's centre. This is useful when calculating next moves from one cell to another, as each step will be the same distance. In a square representation, a step to a cell at a vertex costs more than one at an edge (by a factor of sqrt(2) in fact!) and this complicates things when calculating the best route from A to B. Anything non-tessellating complicates it even more. Any more than this are beyond my limited intelligence :-\ I've always wondered whether a monitor with pixels on a hexagonal grid would help cut out jaggies and whether we humanoids are so fixed by the square grid that we're missing a point somewhere that bees sussed out aeons ago? Steev Antony Arciuolo wrote: > Just a quick question... > > Why are hexagons commonly used in RTS games and in algorithms such as A*? > I'm not well-versed in the algorithm, but it seems to me there are no > horizontally-adjacent hexagons (at least not across a side). And if it > doesn't matter whether the surrounding hexagons are surrounding by their > sides, or by their vertices, then again, why especially hexagons, why not > octagons? > > - Tony