How do I hide part of Map(Layer) until explored.

0 favourites
  • 7 posts
From the Asset Store
Smart UI Part 1 by Epic Stock Media is a one-of-a-kind collection of modern user interface sound effects.
  • I am not sure if some of you are aware of or even remember the Warcraft game that ran off of a Floppy on DOS.

    The Game Map was blacked out. When a controllable player would move into the "darkness" the area would become permanently visible to the player for the rest of the game.

    Can someone please explain how to achieve this in Construct 2?

    Is it done with an object that is attached to a playable character and it changes the color of a mask to make that part of the layer go from black to white allowing it to be seen through? If so what blend mode would I use? How would I set it up? Is this even possible?

    Is it somehow done with an array or invisible objects in the game during game play? If it is done with an array some how, how would I set it up? If I am familiar with arrays, an array is only a memory system, It can't be used actually place objects in game. It is used to remember which object is placed in a specific spot.. Is that right?

    If both are possible which one would use less of the systems resources. I think it would be the Mask layer but am not 100% sure.

    The map that is being planned is a bit large. It would have to be remembered which parts are visible, even after being saved and loaded.

    The current Capx file is nearly empty. Posting one wouldn't be of use.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I suppose you could use a tilemap filled with solid tiles and erase them on overlap. Or you could use the paster plugin, but I don't think that would get saved with the default savestate system. I guess it depends on the art style you're going for and what kind of performance you expect.

    Using lots of individual objects definitely wouldn't be efficient, though.

  • Would using a tilemap be effective for performance? I would have each tile set to visible until a playable character comes into contact. Then the tile would become invisible/destroyed. I know it is easier for a computer to render the same object multiple times vs different objects the same amount. Since it will all be the same object and same color would it be effective? I don't think it would be rendering anything below the black tiles. It seems plausible I am not sure how it would work performance wise. The DOS game I spoke of ran on a very old computer that was only capable of DOS, back when DOS was "the best". Now even our phones are stronger than computers like that, so it may work.

    Since the project I am working on is a bit large I can't apply this extra idea into my project until after I test it a bit. It would change the game play quite a bit though. When I finish what I am working on I will test it out and test performance and post results. Unless someone beats me to it or has another idea. It will be quite a while before I am able to post results.

  • Tilemap performance is great as long as you don't try and draw large images.

  • Hey Unconnected,

    Its called the 'fog of war' and im sure there would be a lot of resources out there to help you come up with the most efficient version if you are worried about performance.

    Remember in the old warcraft games when you selected a unit you didn't have the same controls as the current RTS's . For example if you have a unit selected in starcraft 2 you can make him walk in a circle with enough clicks - try that in the old games and you would end up with a hexagon shape instead.

    You have the right idea using arrays. See this 4 by 4 array below.





    This array represents the overall map and the 0's are the spaces that are currently free to be moved onto. If your character is the number 1 then you can move any direction (this is how we determine collisions when they are made but the same thing can apply to what has been explored and what hasn't).

    For the fog itself you have the option of using tilemaps or simply tiled background objects - depends on how your maps are set up really.

  • Unconnected Ok run the example you can move the player with arrow keys. Now go to black part of map it disappears. Now exit and come back and the black part is no longer there.

  • I tried a tilemap. The large tile size looked bad because I have an Isometric Grid (45° angled grid). I did make it a smaller size of tile. It looked a lot better and still functioned correctly. It just used to much CPU. I may go back at a later time and try objects instead. It should look better since I will be able to duplicate my grid pattern.

    Thank you Everyone. I believe everything has been found out at this time.

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