Making in-game map efficiently

Galdon2004

  • *
  • Posts: 313
So, I have been working on designing a minimap for a metroidvania style game. I have it functional now, but it's very inconvenient to work with, as I need to manually, by hand, tell the engine where every room should be.

Currently, I have the game set up so that each map has a list game attribute which holds a value for every room in the map. Each room is associated with one slot in the list, and a value of 0 means it hasn't been found, and a value of 1 means it has. Then, in the map's code, I have an individual if statement for each item in the list in which I, by hand, assign what kind of wall to put on the four sides of the room (no wall, solid wall, or door) then create the room in the location it should be in.

This functions, but it's extremely tedious to put together for each map since I need to manually input a lot of values. I am wondering if there is a more efficient way to do it that requires less by-hand work, without becoming too difficult to work with. I am thinking, for example, creating more lists so I can have the map assemble using a for each loop, but that may end up requiring 7 lists per map which might be a bit much.

Luyren

  • *
  • Posts: 2747
https://luyren.itch.io/luyrens-map-system
Here is my implementation, if you want to use it or learn from it. The documentation file should help you understand it either way.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Galdon2004

  • *
  • Posts: 313
Ah, it looks like it depends on drawing the full map for the code to work from by hand? That seems like it would be more by-hand work than my current system uses.

Luyren

  • *
  • Posts: 2747
You design and create your complete map image only once, the code handles the rest, provided you configure the menu/mini-map layout. The only thing you need to setup per scene is the first map cell that scene corresponds to. It is extremelly less time consuming than your current approach, and given that you are creating actors for each explored room, it is less resource intensive as well.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Galdon2004

  • *
  • Posts: 313
What I mean though is that by the time I could draw a room with the correct location, size, and walls on the map image, I could with my current system input the values for several rooms. Either way I would only need to do it once, but drawing the whole map as it's own image would take much longer.