美文网首页
Location based games(基于位置的游戏)

Location based games(基于位置的游戏)

作者: 羊毛来了 | 来源:发表于2023-04-13 10:49 被阅读0次

Build the next big location-based game with the Mapbox Maps SDK for Unity. The Mapbox Maps SDK for Unity allows developers to create custom styling for buildings in their Unity projects.

使用 Mapbox Maps SDK for Unity 构建下一个基于位置的大型游戏。 Mapbox Maps SDK for Unity 允许开发人员在他们的 Unity 项目中为建筑物创建自定义样式。

Getting started(入门)

The Mapbox Maps SDK for Unity provides a starting point for location-based games. There are two location-based game example scenes inside of the SDK: Location-based game and Astronaut game.

Mapbox Maps SDK for Unity 为基于位置的游戏提供了一个起点。 SDK 中有两个基于位置的游戏示例场景:基于位置的游戏和宇航员游戏。

Both make use of the LocationProvider which will automatically use the device GPS to position the game map.

两者都使用 LocationProvider,它将自动使用设备 GPS 来定位游戏地图。

You can use the LocationProvider by dropping the LocationBasedGame prefab game object into a scene. It comes configured with the LocationProvider, Map, and Player objects by default.

您可以通过将 LocationBasedGame 预制游戏对象放入场景中来使用 LocationProvider。 它默认配置有 LocationProvider、Map 和 Player 对象。

Dragging and dropping the LocationBasedGame prefab into the scene will get you started on your location-based game. If you’re new to Unity, Mapbox, or both, you might find the Pocket Droids GO video tutorial useful. The guide will walk you through creating a Pokemon GO style location based game using Mapbox's location data. Additionally, the Mapbox presentation at Unite Berlin 2108 on how to make a location-based game in 20 minutes contains useful information on creating location aware gaming experiences.

将 LocationBasedGame 预制件拖放到场景中将使您开始基于位置的游戏。 如果您是 Unity、Mapbox 或两者的新手,您可能会发现 Pocket Droids GO 视频教程很有用。 该指南将引导您使用 Mapbox 的位置数据创建一个 Pokemon GO 风格的基于位置的游戏。 此外,在 Unite Berlin 2108 上关于如何在 20 分钟内制作基于位置的游戏的 Mapbox 演示包含有关创建位置感知游戏体验的有用信息。

Use case ideas(用例创意)

Points of interest(兴趣点)

Once you get a map rendered, the fun begins! Use Mapbox's POI data to have interactions at important locations. For more information on how to spawn game objects on the map, see the documentation on adding markers.

渲染地图后,乐趣就开始了! 使用 Mapbox 的 POI 数据在重要位置进行交互。 有关如何在地图上

Racing games(赛车游戏)

Mapbox's road and building data provide the building blocks to create driving games in any city in the world. You can also use real-time traffic data and navigation inside of your game to make your racer more realistic. To see examples of how vector features can be configured in Unity, see the map features documentation.

Mapbox 的道路和建筑数据为在世界任何城市创建驾驶游戏提供了基础。 您还可以在游戏中使用实时交通数据和导航,让您的赛车手更加逼真。 要查看如何在 Unity 中配置矢量要素的示例,请参阅地图要素文档。

RPG and strategy games(角色扮演游戏和策略游戏)

Create custom styles to turn real-world cities into a base map for your strategy or role playing game. Replace buildings with your own custom 3D models, or you can use the default fantasy style building texturing provided in the Maps SDK for Unity. For more information on styling, see the map texturing documentation.

创建自定义样式,将现实世界的城市变成战略或角色扮演游戏的底图。 用您自己的自定义 3D 模型替换建筑物,或者您可以使用 Maps SDK for Unity 中提供的默认奇幻风格建筑纹理。 有关样式的更多信息,请参阅地图纹理文档。

Aviation games(航空游戏)

You can create compelling games using only raster data. Create a top-down fly over game using one of the default styles for your base map. In the video below, Mapbox's satellite imagery provides the background for a fly over aviation game. Notice the realistic shadows and terrain provided by the Mapbox Satellite v9 style. You can also create your own custom style in Mapbox Studio to use in Unity for a custom backdrop for your aviation game. For more information on custom maps in Unity, see the custom style documentation.

您可以仅使用栅格数据创建引人入胜的游戏。 使用底图的一种默认样式创建一个自上而下的飞越游戏。 在下面的视频中,Mapbox 的卫星图像为飞行飞行游戏提供了背景。 请注意 Mapbox Satellite v9 样式提供的逼真阴影和地形。 您还可以在 Mapbox Studio 中创建自己的自定义样式,以在 Unity 中用于您的航空游戏的自定义背景。 有关 Unity 中自定义地图的更多信息,请参阅自定义样式文档。

Augmented reality(增强现实)

The Maps SDK for Unity also provides the building blocks for location-based AR games. For example, Space invadAR, Mapbox's demo game, uses vector data from cities around the world to create a fun world-scale AR experience. Game object styling and interaction varies based on the type of POI. For more information on building AR games, see the example scenes in the SDK, and the documentation on AR.

Maps SDK for Unity 还为基于位置的 AR 游戏提供构建块。 例如,Mapbox 的演示游戏 Space invadAR 使用来自世界各地城市的矢量数据来创建有趣的世界级 AR 体验。 游戏对象样式和交互因 POI 类型而异。 有关构建 AR 游戏的更多信息,请参阅 SDK 中的示例场景和 AR 文档。

Level creation(关卡创建)

Mapbox has a rich dataset, but for games sometimes too much data can be noisy. Use filters to restrict game play to safe areas or only display specific building types. You can also use road and trail data to create a navmesh for your scene. For example, see how this Mapbox demo makes enemy skeletons NPCs walk paths in a park. Mapbox's location data allows you to have full control to create a fun and safe gaming experience.

Mapbox 有丰富的数据集,但对于游戏来说,有时太多的数据会带来噪音。 使用过滤器将游戏限制在安全区域或仅显示特定的建筑类型。 您还可以使用道路和小径数据为您的场景创建导航网格。 例如,看看这个 Mapbox 演示如何让敌人的骷髅 NPC 在公园里行走。 Mapbox 的位置数据让您拥有完全的控制权,以创造有趣且安全的游戏体验。

相关文章

网友评论

      本文标题:Location based games(基于位置的游戏)

      本文链接:https://www.haomeiwen.com/subject/eqyaddtx.html