Thursday, November 16, 2017

New World Order

Most of you know what z-ordering is. For those who don't, in Mote, it simply is the numerical order by which map objects and entities, are drawn, stacked from lowest to highest.

Mote inherited the z-Ordering scheme from MT, which basically used the highest and lowest values of rank, in order to place what's newly added to a map. Drawing order was also determined by which layer the object, background, or entity (e.g token), was on. In this system, even if the z-order value placed a background stamp above, let's say, player tokens, it will always get drawn at the bottom of such entities.

When we made changes in Mote, we inadvertently affected this system, ending up with z-order overruling layer placement. This caused some chaos on imported campaigns and frameworks, where objects and entities suddenly appeared based on what their z-Order told them to be.

Back then, we applied a quick fix, basically still keeping the MT system, and applying some methods to return the relevance of layer placement. Unfortunately, this solution was not comprehensive, and recent user reports exposed its weaknesses. Reverting back to what MT had, is also a no-go. the system has its own flaws as well.

In 1.11, we went back to this part of the code, discussed and implemented what we hope to be, a final solution. Our new algorithm looks like this:

  • Separate backgrounds and map entities into 2 groups. Backgrounds z-ordering will be from 0 and negative "infinity". Everything else will start from 1 to positive "infinity".
  • If something is added to the map, it's z-order will be determined by what it's placed on.

    If it's placed on a vacant part of the map, it will have a z-order rank based on the layer it's on. If it's placed on a stack of other map objects or entities, it will get the highest rank, for that stack. Other components of the stack, will have their z-ordering, adjusted accordingly.
  • Any other stacks, entities, or objects that have some relation to the affected stack, will also have their values adjusted. We term such a collection as a cluster.
We've also upgraded the Fix Map Object and Entity Types action under the Map menu. Apart from setting Token/Object/Background typing according to the layer it is found on, it will set an initial z-order of 0 for Backgrounds, and 1 for everything else.

Users will also be prompted if they want to reset z-order values for everything, using an extension of our new algorithm. This will "compress" stacks and set z-ordering for "standalone" stamps and tokens, to values in the new ordering that are relative to what they originally were in the former ordering.

We hope you these changes are welcome to you all. Note that this will only affect campaigns and/or frameworks, from this point on. Any exsiting values for z-ordering will remain, as long as these are not submitted either through the action mentioned above, or an automatic correction is made, when something is moved in between layers, or an invalid value for z-ordering, is set.

As with all such changes to Mote, we advise that users keep backups of their campaigns/frameworks.



Video Hangouts

Subscribers to Sandstorm's Full-feature plan can now host video hangouts in their sessions! When creating a server, just make sure you...