Legacy GM [SOLVED] Vaguely SuperMetroid-style map

X

xorphinindi

Guest
I'm trying to make a map for my platformer game and I'm stuck in the planning phase because I'm not really sure what a good way to go about doing it is.
I know pretty well what I want it to do.
I want the full map of the area to appear in grey and then light up with a color once the room has been visited.
What I'm not sure about is what the map screen actually is.

My first thought is to draw a grey rectangle over the GUI and then draw map sprites for each room.
Every room would have its own sprite that can change color depending on whether or not it has been visited.
The problem with this seems like it would end up being a tremendous amount of sprites that would be a mess to draw exactly in the right spot.

My other idea is to draw a rectangle on the GUI like before, but use objects instead of just sprites to represent the rooms.
This way I can use the same assets and only need one object per room-shape, then I can re-color the specific rooms using the instance id.
This would also allow me to place the map-rooms manually instead of having to draw them at coordinates.
Similarly, the reason I don't like this option is that it would require a lot of little objects clustered together which feels messy.

The only other thing I could think of was instead of using the GUI, just move to a different room entirely, but that doesn't seem like it would fix the problems I've already mentioned.
I looked a bit on youtube for some sort of map-tutorial but it looked like there were only mini-map tutorials which aren't really the same thing.
I feel like there's a much easier way to go about this problem, but I'm having trouble thinking of it.

Do you know of a simpler or more streamlined way to make a map screen for a 2D platformer?
Thanks for any ideas.
 

Yal

šŸ§ *penguin noises*
GMC Elder
When I made a map like this last time (YaruPlatEngine), I basically made the game create map data (a 2D array filled with map cell image data, so each cell could contain the IDs of stuff like "1x1 room", "left side of corridor", "save room" and stuff like that) on the fly based on the direction you entered rooms from and their size. The array would start off as 1x1 and be expanded whenever you would enter an area outside it, so the mapping code didn't need to know ANYTHING about the layout of the map. You need to jump through some hoops when the player leaves through the left or upper edges (since arrays can't have negative indices, you need to move everything right or down after resizing the array, and update how the map coordinate is computed from the player's room coordinate) but if you know the absolute size of the map you can skip the whole resize logic and just make it the right size right away.

It's not too hard, and there's no extra work involved in adding rooms (they'll show up on the map automatically once you find them) but you lose the ability to give the player chunks of the map in advance.
 
X

xorphinindi

Guest
Hmm, I think I see what you mean. That does sound like a good method, and to my knowledge, nearly exactly the same as Super Metroid which is pretty neat.
I can't seem to find the YaruPlatEngine you mentioned on your itch.io page unless it's the Isaac one, but I can't find a map screen like you're describing.
Not being able to see unexplored areas is kind of a deal breaker.
Although, if I'm understanding you right, that just means I can't have cells pre-lit, which might be fine.
If I can draw an image, a sort of outline of the entire map, on top of the cell grid then as the player explores, the lit cells act as a back-light to the image, then that sounds perfect.
Does it sound like I'm understanding correctly?
 

Yal

šŸ§ *penguin noises*
GMC Elder
I can't seem to find the YaruPlatEngine you mentioned on your itch.io page unless it's the Isaac one, but I can't find a map screen like you're describing.
It's an old engine that's best left forgotten :p We're talking GM 8.0 days here, and the engine uses so much deprecated functionality I've intentionally taken it off the grid. Sorry to confuse you, I guess it's kinda vain of me to expect everyone to know everything I've ever made... x3
 
G

Galax

Guest
I found a tutorial that is kinda what you're looking for. Hopefully you can adapt it. Here you go!
 
X

xorphinindi

Guest
No worries, I'm not exactly in the loop.
Thanks for the suggestion!
 

TheouAegis

Member
At its core, you just have a block of data that is as many bytes as the area of the total map including unused space. Qhen each byte is $00 it's unknown or unused. If it's $01 it's known but unvisited. If it's $02 it's visited but unknown (glitch). If it's $03 it's visited and known. That determines the color.

The higher nybble is reserved for the room shape which defines which sprite to use. Miscellaneous things were eithwr another byte each or hardcoded hash table.
 
Top