Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Map Storage For Game

by dragonchild (Archbishop)
on Oct 24, 2001 at 01:49 UTC ( #120930=note: print w/replies, xml ) Need Help??


in reply to Map Storage For Game

  1. Identify the smallest granularity in your data set ... the atomic unit, so to speak.
  2. Identify what needs to be known about each atom.
  3. Build and store it as a AoAoH.
  4. Optimize from there.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Replies are listed 'Best First'.
Re: Re: Map Storage For Game
by dooberwah (Pilgrim) on Oct 24, 2001 at 21:03 UTC
    I'm not familiar with the term AoAoH. From the context I think this is some sort of database thing that I havn't covered yet (Like a 1 to Many relationship?). If anyone could explain a bit I'd be grateful.

    -Ben Jacobs (dooberwah)
    Homepage: http://dooberwah.perlmonk.org
    PGP Public Key: http://dooberwah.perlmonk.org/mykey
    "one thing i can tell you is you got to be free"

      Heh.

      Array of Arrays of Hashes. :-)

      The idea I was trying to get across was that you should try to use the most basic data structure and see how it works. If you need to optimize, then do so. But, don't optimize if you don't have to.

      Premature Optimization is the Root of All Evil

      ------
      We are the carpenters and bricklayers of the Information Age.

      Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

        Allright, I think I know what your saying but I'd like a few more clarifications. I think I understand what your saying about the data storage. You would have an array of arrays for the x and y coordinate. You could then say $foo[x][y] and have that be a hash full of data about that piece of terrain (please correct me if I'm wrong).

        My real question is: how would you propose I store this in a database? I've only been working with databases for a short time so I'm not that great at designing them yet.

        -Ben Jacobs (dooberwah)
        Homepage: http://dooberwah.perlmonk.org
        PGP Public Key: http://dooberwah.perlmonk.org/mykey
        "one thing i can tell you is you got to be free"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://120930]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2018-08-20 23:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (197 votes). Check out past polls.

    Notices?