How should we handle maps that overlap

How should we handle maps that overlap

in API Development

Posted by: cvpcs.5914

cvpcs.5914

Q:

Hello, I’m not sure if this has been addressed before but I wasn’t able to get the forum search to work.

I have been investigating an issue I have with my mapping program that uses the coordinates from v2/continents to display a website map. Basically, to reduce clutter I only display map data (POIs, Tasks, etc) if the center of the viewport is hovered over a map (determined by looking at the center of the viewport and comparing it to the values in continent_rect across all maps).

This works well except with Silverwastes. Whenever I hover over Silverwastes the Dry Top map data displays.

I investigated the data and it appears that the problem is that continent_rect for dry top is [(3840, 14592), (5888, 17152)], while silverwastes is [(3840, 14208), (5888, 15744)]. As you can see, dry top’s top-left Y value 14592 is less than silverwaste’s bottom-right Y value 15744, effectively overlapping the dry top rect and the silverwastes rect. Since I was short-circuiting my map-find algorithm once one was a map was found, dry top was always given priority because its map id is lower than silverwastes and the for loop was iterating over an ordered array of maps by map ids.

So my question is how should this situation be handled client-side? I know that the X/Z translation depends on map_rect + continent_rect, so making the continent rects not overlap is probably a non-trivial affair from a game perspective. I was able to work around it by simply reversing my search order, but can we always assume that higher map ids should always be overlayed on top of maps with lower ids?

Thanks!

How should we handle maps that overlap

in API Development

Posted by: Reincarnated.1754

Reincarnated.1754

I have noticed this.
My app. only opens information for one map at a time. So it’s not a problem for me.
I guess something should be done.

You can see it more clearly in these screen shots I took in one of my little tools.

Silverwastes

Dry Top

How should we handle maps that overlap

in API Development

Posted by: Drant.5902

Drant.5902

Dry Top bounds overlapping Silverwastes is probably a bug (one I noticed since long last year), although when used in junction with the MumbleLink API, it works in locating your character whether in Silverwastes or Dry Top.

The solution is to create a special case when dealing with Dry Top, here’s a snippet of my precached version of the map JSON:


"silverwastes":
{
	id: "1015",
	map_rect: [[-24576, -18432], [24576, 18432]],
	continent_rect: [[3840, 14208], [5888, 15744]]
},
"drytop":
{
	id: "988",
	map_rect: [[-24576, -30720], [24576, 30720]],
	continent_rect: [[3840, 15744], [5888, 17152]],
	continent_rect_actual: [[3840, 14592], [5888, 17152]]
},

-

Notice the extra “continent_rect_actual” bounds which is what’s in the API, and is used for when I need to find the character’s in game position. But for when using the web map, I use my own measured “continent_rect”.