• Breaking News

    Visual tricks for a strategy game’s map At work this past month I’ve been implementing some interesting visual tricks on a mesh-based map. While we aren’t making a game, I could totally imagine these techniques being useful for a strategy game, or maybe a tactical RPG. Let’s say you have a hex map. Well, you could easily do hexagons with a 3D mesh, and then boom you can can use all sorts of visual tricks developed for 3D games. As just one example, you can easily tint the map with vertex colors. And this could even be overlaid on a pixel-based map visual; the mesh could just be semi-transparent tinting of the polygonal map spaces, while the underlying image could be a hand-drawn map. And not just visual tricks actually, but user interaction and controls too. This may seem really mundane, but building a mesh representation of your game’s map is an awesome way to do mouse picking of spaces on the map. Just keep a Dictionary correlating triangle indexes with your map’s spaces (hexes, tiles, arbitrary polygons, or whatever your map is composed of). Then you can easily do a raycast directly against the map’s collider (as opposed to a general raycast into the scene) and Unity’s RaycastHit object includes a triangleIndex property (remember to put a Mesh collider on your map, not Box). Easy peasy! View the full article https://ift.tt/eA8V8J

    At work this past month I’ve been implementing some interesting visual tricks on a mesh-based map. While we aren’t making a game, I could totally imagine these techniques being useful for a strategy game, or maybe a tactical RPG. Let’s say you have a hex map. Well, you could easily do hexagons with a 3D mesh, and then boom you can can use all sorts of visual tricks developed for 3D games. As just one example, you can easily tint the map with vertex colors. And this could even be overlaid on a pixel-based map visual; the mesh could just be semi-transparent tinting of the polygonal map spaces, while the underlying image could be a hand-drawn map. And not just visual tricks actually, but user interaction and controls too. This may seem really mundane, but building a mesh representation of your game’s map is an awesome way to do mouse picking of spaces on the map. Just keep a Dictionary correlating triangle indexes with your map’s spaces (hexes, tiles, arbitrary polygons, or whatever your map is composed of). Then you can easily do a raycast directly against the map’s collider (as opposed to a general raycast into the scene) and Unity’s RaycastHit object includes a triangleIndex property (remember to put a Mesh collider on your map, not Box). Easy peasy! View the full article

    from GameDev.net https://ift.tt/2MrKuwV

    ليست هناك تعليقات

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728