Newsgroups: comp.ai.games,rec.games.programmer
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!ub!csn!news-1.csn.net!magnus.acs.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!torn!watserv3.uwaterloo.ca!undergrad.math.uwaterloo.ca!crpalmer
From: crpalmer@solo.uwaterloo.ca (Chris Palmer)
Subject: Re: Maps & Objects
Sender: news@undergrad.math.uwaterloo.ca (news spool owner)
Message-ID: <Don599.AKq@undergrad.math.uwaterloo.ca>
Date: Thu, 21 Mar 1996 23:29:32 GMT
References: <4hs1nd$lbh@white.lambton.on.ca> <4ic87o$opp@watnews1.watson.ibm.com> <4ikgdc$d94@firewall.ihs.com> <4ipi0m$50o@white.lambton.on.ca>
Nntp-Posting-Host: solo.uwaterloo.ca
Organization: University of Waterloo
Followup-To: rec.games.programmer
Lines: 37

NOTE: followup set to rec.games.programmer since this really has nothing
      to do with ai.  I figured that I'd include comp.ai.games in this
      posting just so that people would see the thread being moved
      (nudge, nudge, wink, wink ... you know what I mean)

In article <4ipi0m$50o@white.lambton.on.ca>,
C Lambert <93004794@white.lambton.on.ca> wrote:
>	Currently I employ a 100x100 grid with a pointer in each square to 
>start a linked list of items.  I had tried using a dynamic array, but it 
>screws up everything.  (ie array of 1..1,1..1 using GETMEM).  I would have 
>liked to use the dynamic map size, VERY efficient.  Anyhow, what are some 
>other map schemes, someone have some declarations (show use the TYPE) area.

An interesting little module that I implemented a while ago was to
treat a map as an ADT that provided access to the map data where each
square was an array of object ids sorted by their stacking order on
the square.  There were primitives that popped the top element off
this stack, pushed a new item onto it, retrieve an arbitrary area of
the map, etc.

This was done by updating a file that contained the map when required
(after having buffered changes for a certain period of time) and buffers
the result and memory used to provide reasonably cheap access to arbitrary
segments of maps.

If you're planning on supporting reasonable gaming environments it's
fairly important to seperate the mechanics of the map from the other
components of your game.  It's no fun for you if you spend countless
hours developing the game only to discover that half of it has to be
rewritten because you built the map knowledge into every area of your
code.

Cheers,
Chris.
-- 
Mail: crpalmer@undergrad.uwaterloo.ca
Homepage: http://www.undergrad.math.uwaterloo.ca/~crpalmer/
