1 Aug 2010 14:48
Zone maps; file format
Ralph Versteegen <teeemcee <at> gmail.com>
2010-08-01 12:48:31 GMT
2010-08-01 12:48:31 GMT
I was looking through some of Pepsi's scripts and noticed enormous conditionals to check whether the player is in various areas of the map. Moments later I was overcome with the urge to implement a new feature, "Zone maps". Here are the proposed features of a zone map: -Each zone is a bitmask/bitmap of the map, one bit per tile -Extra data can be associated with each zone (not on a tile-by-tile basis) -Zones are a complement to another feature to be implemented, datamaps (which are for users, likely no builtin uses, allowing association of much richer data with individual tiles), not a replacement -You should be allowed at least several thousand zones per map, so that it's possible to have one per NPC instance -Zones can overlap; to reduce memory burden I'm currently imposing a limit of at most 15 zones overlapping at any tile -Zones should be implemented to require a modest amount of memory/diskspace. A naive implementation could make zonemaps bigger than all the other data for each map -Due to this, reading and writing to a zone map is slower than reading or writing a tilemap in any implementation, but needs to be decently fast to be used for wall checking -Would be reasonable to have restrictions on shape, like requiring zones to be connected, but I currently don't have any -Zones should be writeable by scripts I have them partially implemented, and will next work on a map editor mode, and saving and loading. I considered many different in-memory formats, and currently am using one which uses 4 bytes per tile, more for pieces of the map which are heavily crowded with different zones (pathological cases only).(Continue reading)
RSS Feed