NOTICE: Google Maps Platform gaming services is deprecated as of October 18, 2021. Current users will have continued access until December 31, 2022. During this time, we will continue to provide support and fixes to major bugs and outages. See the Gaming Services Transition Guide for resources to help you plan the next steps for your projects.

Package google.maps.playablelocations.v3.sample

Index

AreaFilter

Specifies the area to search for playable locations.

Fields
s2_cell_id

fixed64

Required. The S2 cell ID of the area you want. This must be between cell level 11 and 14 (inclusive).

S2 cells are 64-bit integers that identify areas on the Earth. They are hierarchical, and can therefore be used for spatial indexing.

The S2 geometry library is available in a number of languages:

Criterion

Encapsulates a filter criterion for searching for a set of playable locations.

Fields
game_object_type

int32

Required. An arbitrary, developer-defined identifier of the type of game object that the playable location is used for. This field allows you to specify criteria per game object type when searching for playable locations.

You should assign a unique game_object_type ID across all request_criteria to represent a distinct type of game object. For example, 1=monster location, 2=powerup location.

The response contains a map<game_object_type, Response>.

filter

Filter

Specifies filtering options, and specifies what will be included in the result set.

fields_to_return

FieldMask

Specifies which PlayableLocation fields are returned.

name (which is used for logging impressions), center_point and place_id (or plus_code) are always returned.

The following fields are omitted unless you specify them here:

  • snapped_point
  • types

Note: The more fields you include, the more expensive in terms of data and associated latency your query will be.

Filter

Specifies the filters to use when searching for playable locations.

Fields
max_location_count

int32

Specifies the maximum number of playable locations to return. This value must not be greater than 1000. The default value is 100.

Only the top-ranking playable locations are returned.

spacing

SpacingOptions

A set of options that control the spacing between playable locations. By default the minimum distance between locations is 200m.

included_types[]

string

Restricts the set of playable locations to just the types that you want.

PlayableLocation

A geographical point suitable for placing game objects in location-based games.

Fields
name

string

Required. The name of this playable location.

types[]

string

A collection of Playable Location Types for this playable location. The first type in the collection is the primary type.

Type information might not be available for all playable locations.

center_point

LatLng

Required. The latitude and longitude associated with the center of the playable location.

By default, the set of playable locations returned from SamplePlayableLocations use center-point coordinates.

snapped_point

LatLng

The playable location's coordinates, snapped to the sidewalk of the nearest road, if a nearby road exists.

Union field location_id. Required. Each location has one of the following identifiers: location_id can be only one of the following:
place_id

string

A place ID

plus_code

string

A plus code

PlayableLocationList

A list of PlayableLocation objects that satisfies a single Criterion.

Fields
locations[]

PlayableLocation

A list of playable locations for this game object type.

SpacingOptions

A set of options that specifies the separation between playable locations.

Fields
min_spacing_meters

double

Required. The minimum spacing between any two playable locations, measured in meters. The minimum value is 30. The maximum value is 1000.

Inputs will be rounded up to the next 10 meter interval.

The default value is 200m.

Set this field to remove tight clusters of playable locations.

Note:

The spacing is a greedy algorithm. It optimizes for selecting the highest ranking locations first, not to maximize the number of locations selected. Consider the following scenario:

  • Rank: A: 2, B: 1, C: 3.
  • Distance: A--200m--B--200m--C

If spacing=250, it will pick the highest ranked location [B], not [A, C].

Note:

Spacing works within the game object type itself, as well as the previous ones. Suppose three game object types, each with the following spacing:

  • X: 400m, Y: undefined, Z: 200m.
  1. Add locations for X, within 400m of each other.
  2. Add locations for Y, without any spacing.
  3. Finally, add locations for Z within 200m of each other as well X and Y.

The distance diagram between those locations end up as:

  • From->To.
  • X->X: 400m
  • Y->X, Y->Y: unspecified.
  • Z->X, Z->Y, Z->Z: 200m.
point_type

PointType

Specifies whether the minimum spacing constraint applies to the center-point or to the snapped point of playable locations. The default value is CENTER_POINT.

If a snapped point is not available for a playable location, its center-point is used instead.

Set this to the point type used in your game.

PointType

Specifies whether the playable location's geographic coordinates (latitude and longitude) correspond to its center-point, or to its location snapped to the sidewalk of the nearest road.

Enums
POINT_TYPE_UNSPECIFIED Unspecified point type. Do not use this value.
CENTER_POINT The geographic coordinates correspond to the center of the location.
SNAPPED_POINT The geographic coordinates correspond to the location snapped to the sidewalk of the nearest road (when a nearby road exists).