Difference between revisions of "Location Shifting"

From Staredit Network Wiki
Jump to: navigation, search
(Created page with 'Location shifting is a technique used to shift locations directly to either the left or top side of the map from it's current position. It is done by centering a location twice t…')
 
m (1 revision imported: Restoring SC1 backup)
 
(No difference)

Latest revision as of 00:34, 21 March 2015

Location shifting is a technique used to shift locations directly to either the left or top side of the map from it's current position. It is done by centering a location twice the width of the map (for left shifting) or twice the height of the map (for top shifting) on the location you wish to shift and then centering that location on the shift location.


How It Works

When a location is centered beyond the bounds of the map Starcraft 'slides' that location back into the map boundaries. Starcraft first checks if the left and top boundaries are exceeded and then the bottom and right boundaries; because a left shifting location is twice the width of the map it first violates the left border (and is slid back into the map) and then violates the right map boundary (and is then slid back into the map from the right side). This sliding places the middle of the left shifting location directly on the left border of the map.


This aspect can be observed here. Suppose the map dimensions were 8x8 as shown in the picture below, after centering the left shift location on the example location "Main" the location would end up as shown. The location 'Main' can then be centered at the left shift location and will have been slid directly left of its former position to the edge of the map.

Locationshifting.jpg

Top shifting works in the same way with a location twice the height of the map.


Making a Shift Location

The simplest way to physically create the location in editor is to manually set the location parameters. Open the location properties to edit them.


For a left shifting location set the parameters to these coordinates

  • Top: 0
  • Bottom: 32
  • Left: 0
  • Right: (2 times the map width in pixel units)


For a top shifting location set the parameters to these coordinates

  • Top: 0
  • Bottom: (2 times the map height in pixel units)
  • Left: 0
  • Right: 32


The pixel width or height dimensions of your map can be easily calculated by multiplying the number of tiles wide it is by the number of pixels in a tile (32). For instance, if one wanted to make a left shifting location for a 64x64 map they would take 64*32 to find the pixel width of the map (2048), multiply it by 2 to get double the width (4096) and use that value for the right parameter of the location.


For recent versions of SCMDraft, locations cannot be created outside of the map edges. To create one with a newer version of Scmdraft double the current map size in the editor. After this, create your location for shifting, apply the proper properties, then resize the map back to its original size. Once this is done, do not open the location properties or drag the location from within the editor.


It is important to note that physically moving the shift location in editor (by dragging) will mess up the location coordinates severely.


Applications of Location Shifting

The most important function of location shifting is in it's application of Location Grids. A location grid works by centering locations of variable width on a column of units along the Y axis on either side of the map and centering a location on those wide locations in an effect to center a location displaced from the side of the map, much like how location shifting works. Location shifting can eliminate the need for the column of units along the left side of the map leaving only the right column. This is because the location can be centered on the unit representing the correct Y coordinate on the right side, location shifting to the left and the appropriate location grid location centered to cover the left portion of the map.


Any other application of location shifting can be construed directly from what location shifting is capable of. For instance, if you wanted to order a unit to move directly left of it's current position, you could center a left shift location on it and order it to the left shift location. A simple application of this technique is seen in the concept map Ensnare Detection (note that the map employs the concepts of Inverted Locations as well).