Search Unity

How to do a Galaxy Map Overlay?

Discussion in '2D' started by JymWythawhy, Apr 23, 2017.

  1. JymWythawhy

    JymWythawhy

    Joined:
    Jan 18, 2015
    Posts:
    25
    I'm trying to figure out a good way to do something in Unity, and I could use some direction of what paths I should be going down.

    For my top down 2D space game, I will have a database of solar systems you can visit. Each solar system will have an ID, a galactic coordinate (like (1,2) or (-4,3)) and a list of the solar systems you can get to from that particular system.

    I want to be able to bring up a galaxy overlay that will show the Solar Systems in the galaxy (with the jump connections between them) so that the player can select the next destination Solar System before initiating a jump. I would like to make it so the map overlay can be scrolled and zoomed.

    It would look like basically like this, and appear over the gameplay, pausing it. The gameplay would resume after the map was closed. The map would be created programatically based on a database of solar system data items (with galactic coordinates for each solar system).



    What do you think the best way to do this is?

    I can think of a few ways that might work.

    1) Set up the galaxy map as a bunch of game objects way off to the side of where the real game play will be, and then have a secondary camera that will render to a texture that I could enable or disable based on if the map is visible or not. This would have the benefit of being easy to scroll or zoom, as I could just change the position or size of the secondary camera. Potential difficulty- I would have to figure out how to translate mouse clicks on the texture to the solar systems I was trying to select.

    2) Set it up in uGUI some how. It wouldn't be to hard to set up the entire galaxy map in uGUI, but I am not certain how I be able to scroll or zoom the galaxy map using uGUI.

    3) Draw directly to a texture? Is that a thing?

    Any advice is deeply appreciated!