http://www.perlmonks.org?node_id=121379


in reply to Map Storage For Game

Does one unit represent a grid (nxn dimension) or a point in space?

What is the unit of movement? Can objects only move gridsize units at a time or do you need partial movement, where an object could potential be in four "tiles" at once?

Knowing a bit more about the requirements and limitations can let you do a lot of tricks to speed up things.

I used to work at a game company years ago and did alot in these areas. If I can help, I'd be glad to give you some advice if it's something I've got experience with. Then again, our target machines where 386SX's so it was mostly done in ASM and some C. Very over optimized. Haven't done any games in Perl yet but the concepts should all translate.

-Lee

"To be civilized is to deny one's nature."

Replies are listed 'Best First'.
Re2: Map Storage For Game
by dooberwah (Pilgrim) on Oct 25, 2001 at 17:56 UTC
    Though nothing is final yet, I think that it's likely that we will have units that can move less than a tile at a time. In Civilization (and FreeCiv) your units, and your cities all take up one tile. We're trying to steer away from this, because in actuality a group of units would be much smaller than a city. We might just fix this problem by having cities be more than a tile in size, but it would be nice to look at all the options before we settle on something.

    -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"

      It seems like it would make more sense to have your tiles be at the most granular level you can make it. This provides you with the ability to have a more detailed terrain, and keeps the complexity of trying to move a unit only a portion of the way through a tile out of your system. It also gives you larger flexibility with the design of your cities. Cities wouldn't need to be square, they could be oblong shapes if you so desired.
      Having objects move at abitrary rates also brings up problems with collision detection etc. What type of terrain is this? What type of objects? How are they shaped?

      I think making an arbitrary world model in Perl could be slow. It depends on what the criteria is though. How many frames per second do you need?

      -Lee

      "To be civilized is to deny one's nature."