How do I make a world map?

0 favourites
  • 5 posts
From the Asset Store
Two types of minimap: "full map" and "player is the center" (square map and radial map)
  • Hi,

    I'm currently planning on making a simple nation simulation visual novel. For that, I need a map that has its national and state borders clearly drawn and clicking on any state highlights that state. Those who have played grand strategy games by companies like Paradox probably have an idea what I'm talking about.

    Unfortunately, I do not know how to make parts of the map behave as its own separate states. Take United States for example, can a single map be separated into its own states so that clicking where Minnesota should be will only highlight Minnesota instead of the entire United States?

    Currently I only know how to take a sprite shaped like Minnesota and assemble it where it should be on the screen, like a jigsaw puzzle. But I'm wondering if there is a simpler way, so that I can perhaps draw the border on a single picture and it separates the states in that way. Assembling sprites like a jigsaw puzzle is going to take a lot of time and possibly require twice the memory requirement since I'll have to place the background image and the sprite as well.

    An alternative is to make Minnesota appear as just a single dot on a piece of US map and clicking the dot represents selecting the whole state. However, I don't want the game to look like this if I can help it although it will certainly be much easier.

    tl;dr Does anyone know how to create a world map with distinctive states and provinces without the programmer having to assemble the states and provinces like a jigsaw puzzle?

    Thanks in advance.

  • You could use imagepoints on the general map image. If cursor is overlapping these image points then you could set a sprite to the imagepoint position and take the shape of the state in the form of an animation frame. This method would just be one sprite image for the general map and one sprite image for the highlighted state. You could even spawn invisible detect sprites on each imagepoint of the map if the detect area needs to be wider. In a general sense it would be like the US map, with pegs where the states are (imagepoints) and if the mouse goes over these, then the state appears to be highlighted.

  • You could use imagepoints on the general map image. If cursor is overlapping these image points then you could set a sprite to the imagepoint position and take the shape of the state in the form of an animation frame. This method would just be one sprite image for the general map and one sprite image for the highlighted state. You could even spawn invisible detect sprites on each imagepoint of the map if the detect area needs to be wider. In a general sense it would be like the US map, with pegs where the states are (imagepoints) and if the mouse goes over these, then the state appears to be highlighted.

    Oh, that does sound like what I'm looking for. I'll need to experiment with this method, but I think you've solved my problem. Was afraid I was going to have to assemble thousands of provinces manually. I don't even have the patience to do several hundred pieces worth of jigsaw puzzle lol.

    However, would these invisible detection sprites take up memory or consume significant processing power? I'm planning on making a game that's light on the hardware so that even computers running windows xp from late 2000s can play it. Theoretically speaking, that is. I'm not going to go out of my way to make it compatible for xp.

    Thanks a lot.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The imagepoints are kind of irrelevant when it comes to the memory. The only concerning memory will be the main map image, if it is a huge HD image then it will take up more memory, and best practice is to use smaller source images. If this is just going to be one image and not say 20 huge maps at a time then it shouldn't creep up too much. The invisible detection sprites will also be kind of irrelevant, you won't be using any images, just an invisible sprite object for detection. The only other memory use will come from the highlighting sprite which will be represented by an image of just the one state, this shouldn't be too much memory and is likely not going to be detailed as it is just for highlighting a selected area.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)