Ralph Versteegen | 1 Aug 14:48 2010
Picon

Zone maps; file format

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)

James Paige | 2 Aug 18:14 2010

Re: Zone maps; file format

On Mon, Aug 02, 2010 at 12:48:31AM +1200, Ralph Versteegen wrote:
> 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

This all sounds great!
I am sure there are a lot of possibilities for this.

> I have them partially implemented, and will next work on a map editor
> mode, and saving and loading. I considered many different in-memory
(Continue reading)

James Paige | 2 Aug 18:37 2010

edge tracing

Just a thought. TMC's map zone plan reminded me. I was thinking I should 
make a pair of new standard NPC movement types: Trace edges (Left) and 
Trace Edges (Right)

The NPC would walk in a straight line until they reach an obstruction, 
and then they would walk along the edges of the obstruction, either left 
or right in a loop.

This would be pretty cool just with wallmapping. It would get even more 
cool with zones, where an NPC could be resitricted to a zone. Then they 
would walk the perimeter of the zone, this making it easy to make an NPC 
pace a complex path with no scripting at all, and sensible recovery from 
being temporaraly blocked by the hero or another NPC.

I can implement it independantly of the zone feature, and zone pacing 
will come for "free" once NPCs can be restricted in movement by zone.

---
James Paige
Jay Tennant | 3 Aug 05:55 2010

Re: edge tracing

> From: James Paige <Bob <at> HamsterRepublic.com>
> Sent: Monday, August 02, 2010 11:38 AM
> 
> Just a thought. TMC's map zone plan reminded me. I was thinking I should 
> make a pair of new standard NPC movement types: Trace edges (Left) and 
> Trace Edges (Right)
> 
> The NPC would walk in a straight line until they reach an obstruction, 
> and then they would walk along the edges of the obstruction, either left 
> or right in a loop.
> 
> This would be pretty cool just with wallmapping. It would get even more 
> cool with zones, where an NPC could be resitricted to a zone. Then they 
> would walk the perimeter of the zone, this making it easy to make an NPC 
> pace a complex path with no scripting at all, and sensible recovery from 
> being temporaraly blocked by the hero or another NPC.
> 
> I can implement it independantly of the zone feature, and zone pacing 
> will come for "free" once NPCs can be restricted in movement by zone.

I really like this idea. Have you considered an obstruction testing
algorithm that is flexible enough to deal with:
http://hamsterrepublic.com/ohrrpgce/index.php/Plan_for_non-tile-based_walking.html

> ---
> James Paige

_______________________________________________________
Unlimited Disk, Data Transfer, PHP/MySQL Domain Hosting
              http://www.doteasy.com 
(Continue reading)

Ralph Versteegen | 3 Aug 16:11 2010
Picon

Re: Zone maps; file format

On 3 August 2010 04:14, James Paige <Bob <at> hamsterrepublic.com> wrote:
> On Mon, Aug 02, 2010 at 12:48:31AM +1200, Ralph Versteegen wrote:
>> 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
>
> This all sounds great!
> I am sure there are a lot of possibilities for this.
>
>> I have them partially implemented, and will next work on a map editor
(Continue reading)

Ralph Versteegen | 3 Aug 16:32 2010
Picon

Re: edge tracing

On 3 August 2010 15:55, Jay Tennant <hierandel8 <at> crazyleafgames.com> wrote:
>> From: James Paige <Bob <at> HamsterRepublic.com>
>> Sent: Monday, August 02, 2010 11:38 AM
>>
>> Just a thought. TMC's map zone plan reminded me. I was thinking I should
>> make a pair of new standard NPC movement types: Trace edges (Left) and
>> Trace Edges (Right)
>>
>> The NPC would walk in a straight line until they reach an obstruction,
>> and then they would walk along the edges of the obstruction, either left
>> or right in a loop.
>>
>> This would be pretty cool just with wallmapping. It would get even more
>> cool with zones, where an NPC could be resitricted to a zone. Then they
>> would walk the perimeter of the zone, this making it easy to make an NPC
>> pace a complex path with no scripting at all,

I've been meaning to implement NPC paths for a couple years, but now I
think I will do it soonish, since it seems like a companion feature to
zones.

However, I have absolutely no argument against this move-type; it
sounds useful to me.

>> and sensible recovery from
>> being temporaraly blocked by the hero or another NPC.

Ah, now that's a nice feature!

>> I can implement it independantly of the zone feature, and zone pacing
(Continue reading)

Mike | 3 Aug 18:09 2010
Picon

Re: Zone maps; file format

Why not use rectangles to define zones?

Advantages:
- easy to store
- easy to understand
- memory efficient
- really efficient collision checking

Disadvantages
- complex shaped zones might require many rectangles to define (and, either potential for overlap or a
complex rectangle optimization algorithm (which I've done before))
- potentially complex UI

Basically, for each zone, store a list of rectangles that define its area. A point is inside the zone if it's
inside any of the composite rectangles. 

Overall, this sounds a lot easier and simpler than the bitset idea.
--
Mike Caron

-----Original Message-----
From: Ralph Versteegen <teeemcee <at> gmail.com>
Sender: ohrrpgce-bounces <at> lists.motherhamster.org
Date: Wed, 4 Aug 2010 02:11:40 
To: <ohrrpgce <at> lists.motherhamster.org>
Reply-To: ohrrpgce <at> lists.motherhamster.org
Subject: Re: [Ohrrpgce] Zone maps; file format

On 3 August 2010 04:14, James Paige <Bob <at> hamsterrepublic.com> wrote:
> On Mon, Aug 02, 2010 at 12:48:31AM +1200, Ralph Versteegen wrote:
(Continue reading)

David Gowers | 4 Aug 06:14 2010
Picon

Re: Zone maps; file format

I'm thinking about this. Currently I favor a scanline-based approach:

* zonemaps
 * lines
  * <n>
   * nzones_on_this_line
   * data : unsigned-short array, (serialized with zlib compression?)
      ZONE NENTRIES START END [START END.. ]
      (repeat for each zone which has some part within this line of
      the map)
 * zone
  * id
  * name

simple UI (it's easy to translate a bitarray into a list of scanline
spans), possibly faster checking, less memory usage.
Ralph Versteegen | 4 Aug 14:38 2010
Picon

Re: Zone maps; file format

On 4 August 2010 04:09, Mike <caron.mike <at> gmail.com> wrote:
> Why not use rectangles to define zones?
>
> Advantages:
> - easy to store
> - easy to understand
> - memory efficient
> - really efficient collision checking
>
> Disadvantages
> - complex shaped zones might require many rectangles to define (and, either potential for overlap or a
complex rectangle optimization algorithm (which I've done before))
> - potentially complex UI
>
> Basically, for each zone, store a list of rectangles that define its area. A point is inside the zone if it's
inside any of the composite rectangles.
>
> Overall, this sounds a lot easier and simpler than the bitset idea.

However, it's pretty restrictive. I'm assuming that you meant that the
rectangle-based nature of zones would be exposed to the user (who
could only paint with rectangles, not freely). If I wanted to make an
isometric game (I AM making an isometric game), for example, zones
would be extremely tedious for marking rooms.

> --
> Mike Caron
>
> -----Original Message-----
> From: Ralph Versteegen <teeemcee <at> gmail.com>
(Continue reading)

subversion | 4 Aug 15:05 2010

SVN: teeemcee/3633 Cleanup map editor and other code, and fix some glitches involving the r

teeemcee
2010-08-04 06:05:10 -0700 (Wed, 04 Aug 2010)
156
Cleanup map editor and other code, and fix some glitches involving the rightmost row of tiles (which used to
be a black column, which I removed a while ago)
---
U   wip/custom.bas
U   wip/custom_udts.bi
U   wip/customsubs.bas
U   wip/drawing.bas
U   wip/mapsubs.bas

Gmane