Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Map Storage For Game

by mr_mischief (Monsignor)
on Oct 24, 2001 at 18:48 UTC ( #121127=note: print w/replies, xml ) Need Help??


in reply to Re: Map Storage For Game
in thread Map Storage For Game

I've actually toyed with a game system using two values per tile. One is the elevation, and the other the type of ground cover.

0-9 elevations

r=rocky, f=forest, g=grassy, w=water, etc.

This allows for a slightly more complex computation for movement, as movement is normally slower uphill than down, and a game engine could even use the map to figure trajectory differences for missile weapons to nearby tiles and things like that.

As for using a DB instead of a flat file of keeping it all in memory, I was planning on putting regions encoded like the above into the database, and pulling entire regions from the database into memory when needed, so say you could have a 16-by-16 or 32-by-32 region that gets pulled out when someone is within a certain number of tiles from it, or when someone actually enters it if the game doesn't allow multi-tile vision (depends on style of game and granularity of land areas depicted by the tiles).

I've worked quite a bit in this area, and I'm always happy to talk about it. I may even be interested in joining a project if that's an option. Perl is a good language for this type of game because of the ease of manipulating the data structures in different ways.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://121127]
help
Chatterbox?
[hippo]: Hardly "buried". Just upvote the good nodes and move on.

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









    Results (146 votes). Check out past polls.

    Notices?