Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Dynamic Interactive World Map (2d)

Discussion in '2D' started by Krakken232, Dec 9, 2013.

  1. Krakken232

    Krakken232

    Joined:
    Dec 9, 2013
    Posts:
    2
    m asking this question as sort of a 'probing' mission, as I haven't actually gotten into Unity yet. I'm working on a game that could really reasonably be created in HTML5/JS (in fact, all my prototyping has thus far been in simple JS). With Unity 4.3's 2d tools being released, Unity suddenly became sort of a 'low hanging fruit' for getting into a compiled environment, as really the only concern I have with Javascript is performance.

    ANYWAY, the game is intended to be a 'lite' grand strategy game, and a key component is of course an interactive world map made up of a few provinces and probably dozens of regions in each province. From my research on these forums (which basically follows the 'industry standard'), the easiest way to accomplish this is to have a hidden 2d texture where each region has a distinct color, and render the production map in lieu of this -- picking the color from the hidden texture on mouse events to determine via a table which province/region is being interacted with.

    The crux is that this map is dynamically/randomly generated. I already have a pretty sick world building algorithm prototyped and working in Javascript which can generate the 2d image with colored regions, and in HTML5 it's a simple matter of rendering the canvas as an image and saving.

    I'm wondering if Unity has any system that could accomplish this functionality. The map itself is made of polygons, and I'm not sure I've seen anything in the Unity forums that indicates there is some way to create a 2d texture based on polygons for use in your scene.

    What do you think? Should I script this task out with some other framework and use the generated image in Unity? Is this task suited for Unity? Should I think about another method of creating the map entirely (i.e. using the polygons from the map generation script to actually create an individual 3d object the shape of each)?

    What do you think?