“100% Map Completion” event

I’m working on a Dungeon Crawler type game, and I want to implement a reward system, where the player gets a reward if they step on every tile on a dungeon floor.

I’m looking for a simple way to implement this, but my head is going a little screwy thinking of it.

I don’t really want to have an event on every tile that deletes itself or flips a self switch after touching it.

That seems really inefficient.

My initial thought was maybe using an event that procs when you step on certain region ids?

It could increment a variable every time you step, but there would need to be some way not to “double count” steps.

Anyone ever implement something like this before?
EVERY tile might be ambitious, but if you are wanting to cover "Every Room" that's more manageable, with an event at the entry to every room.
Otherwise, HIP SHOT:
- Establish an array that is, essentially, a grid of the map, 1s and 0s; lets say 1 for a passable space, 0 for an unpassable space at initialization.
- Run a parallel event that collects the player X/Y position.
- If the player X/Y position on the grid array is 1, turn it to 0.
- Check the array; if there are any 1s, the map is incomplete. If there are no 1s, the map has been fully walked.

Additions;
You should be able to establish this array as a variable, and do this per-map and have the achievement for each map.
Loading the map for the first time initializes the data and stores it. Ensure your unpassable areas are set to your "walked" value. If you are manually crafting the level, you'll want to find a way to export the data when you're done with the map and prepare the data.
Throw self switch A when the level is first loaded and the array is stored.
On page 2, with switch A on, have it run parallel. Get the player position, test it against the array at variable[x][y], flip the value to your walked value if it hasn't been already. Check the array for your unwalked value; if present, do nothing new. If NOT present, throw self switch B.
On page 3, with self switch B on, run your congratulatory code, award the achievement. Throw self switch C.
On page 4, with self switch C on, just do nothing at all~ Its all done~

If you are getting creative with some kind of proc gen on the map, you should be able to use the output of that to produce the array grid at the end of the generation, and then store it to a selected variable.
EVERY tile might be ambitious, but if you are wanting to cover "Every Room" that's more manageable, with an event at the entry to every room.
Otherwise, HIP SHOT:
- Establish an array that is, essentially, a grid of the map, 1s and 0s; lets say 1 for a passable space, 0 for an unpassable space at initialization.
- Run a parallel event that collects the player X/Y position.
- If the player X/Y position on the grid array is 1, turn it to 0.
- Check the array; if there are any 1s, the map is incomplete. If there are no 1s, the map has been fully walked.
The room thing will be a good fall back if I can’t figure out how to get this done.

Thank you for the array idea, It’s definitely sound in concept.
I don’t really want to have an event on every tile that deletes itself or flips a self switch after touching it.
no matter what, if you want each tile to only count once, then you need a way to store info per tile.
and as you've seen, using region common events does not give you that option.

Having one event per tile is actually the easiest way to handle this.
alternatively you could use a more complex plugin creating info per tile (for example using a fog-of-war type plugin and checking if all tiles are revealed).
if you want to do it per common events you probably have to change a variable to store an array where you mark each tile - can also be done but is a lot more complex than an event per tile.
My thought is similar to @daMooseNeo but...I dunno, without actually seeing him give the example or doing it out myself, I hesitate to say it's actually lighter weight, but it's just a different mental approach. Counting up rather than down, as it were.

Some of the details will come down to you, whether you're okay with reserving a game variable for each map you do this with, or you could make another encapsulating array...but just in terms of one map, I'd do this.

Have a one-time Autorun event when you go to the map that does:
Script: $gameVariables.setValue(69, []);

Then have a parallel common event with, say, a 10-frame Wait on it.
Script:
Code:
let coords = `${$gamePlayer.x}-${$gamePlayer.y}`;
if (!$gameVariables.value(69).includes(coords))
{
    $gameVariables.value(69).push(coords);
    if ($gameVariables.value(69).length == 52)
// do stuff for your achievement
}

So in that case, variable 69 is turned into an array storing the unique map coordinates the player has stepped on. And 52 is the number of floor tiles you have counted on your map, which indicates they've all been stepped upon.

Having one event per tile is actually the easiest way to handle this.
The problem with that is if you're using the default random encounter system, having an event on a tile prevents you from getting an encounter there.
My thought is similar to @daMooseNeo but...I dunno, without actually seeing him give the example or doing it out myself, I hesitate to say it's actually lighter weight, but it's just a different mental approach. Counting up rather than down, as it were.

Some of the details will come down to you, whether you're okay with reserving a game variable for each map you do this with, or you could make another encapsulating array...but just in terms of one map, I'd do this.

Have a one-time Autorun event when you go to the map that does:
Script: $gameVariables.setValue(69, []);

Then have a parallel common event with, say, a 10-frame Wait on it.
Script:
Code:
let coords = `${$gamePlayer.x}-${$gamePlayer.y}`;
if (!$gameVariables.value(69).includes(coords))
{
    $gameVariables.value(69).push(coords);
    if ($gameVariables.value(69).length == 52)
// do stuff for your achievement
}

So in that case, variable 69 is turned into an array storing the unique map coordinates the player has stepped on. And 52 is the number of floor tiles you have counted on your map, which indicates they've all been stepped upon.


The problem with that is if you're using the default random encounter system, having an event on a tile prevents you from getting an encounter there.
I’ll test this out and see how it works.

Basically if I have the auto event just run one time, it should store the coords even if I’ve left the floor.
Sorry, I skimmed the responses, so sorry if something like this has already been discussed;
Can this not be faked?

Like I don't know what your dungeons look like, but the image I have in my head is that there are going to be branching paths and choke points. You could just place an event at the choke point to a branching path and put another event at the end; we can safely assume that the player walked most if not all tiles from the choke point to the end without need to account for whether they did or didn't.
You also could probably even skip the choke point event and just put an event at the end of a dead end because it's basically the same thing; assuming the player walked all the tiles from the entrance to that dead end.

From a philisophical, game play stand point - and again, based on the image I have in my head - this sounds incredibly tedious to make every tile required to be stepped on. As a player I would want no part of this.
I think it would be better to just put exploration "check points" at every major room change or point of interest; and I'd probably use like an event hit box plugin so that players don't need to stand EXACTLY on the tile you deemed to be the point of interests check point, but instead the area around it.
@TheAM-Dol I don't know exactly what the OP's game is like, but from the question I'm envisioning something like the Etrian Odyssey series, some of which do in fact have quests that require you to manually map each square of a given area.
@TheAM-Dol I don't know exactly what the OP's game is like, but from the question I'm envisioning something like the Etrian Odyssey series, some of which do in fact have quests that require you to manually map each square of a given area.
Yes, it’s a FP Dungeon crawler akin to Etrian Odyssey.
some of which do in fact have quests that require you to manually map each square of a given area.
Sounds tedious.


it’s a FP Dungeon crawler
I'm not familiar with the game in reference, but many of the dungeon crawlers I've played are basically labyrinths; a single tile wide with branching paths. In it is like that, again, my idea of faking it would still work. Imagine a T, you put a player touch at the bottom of the T, one at the intersection, and one at each end of the crossbeam; we can easily assume the player traversed all the points between those.

Anyways, seems I'm not understanding the game, so apologies for the distraction in the thread. Hope you get it solved.
Sounds tedious.



I'm not familiar with the game in reference, but many of the dungeon crawlers I've played are basically labyrinths; a single tile wide with branching paths. In it is like that, again, my idea of faking it would still work. Imagine a T, you put a player touch at the bottom of the T, one at the intersection, and one at each end of the crossbeam; we can easily assume the player traversed all the points between those.

Anyways, seems I'm not understanding the game, so apologies for the distraction in the thread. Hope you get it solved.
The main conceit of Etrian Odyssey is that the map of the dungeon you're exploring doesn't exist; you have to create it yourself as you move. So it's generally beneficial to explore every tile to make sure you don't miss hidden paths and events.
Sounds tedious.



I'm not familiar with the game in reference, but many of the dungeon crawlers I've played are basically labyrinths; a single tile wide with branching paths. In it is like that, again, my idea of faking it would still work. Imagine a T, you put a player touch at the bottom of the T, one at the intersection, and one at each end of the crossbeam; we can easily assume the player traversed all the points between those.

Anyways, seems I'm not understanding the game, so apologies for the distraction in the thread. Hope you get it solved.
dont worry, I understood exactly what you meant, and I think it will work well.

I’m just testing out all the solutions laid out in the thread to see what would work best.

My comment was merely to confirm the type of game.

In Etrian Odyssey, it’s not as tedious as it sounds because you’re tasked with mapping out the dungeon.

Exploring every inch of it, is well the point actually.
It would probably help others to understand if they know that Etrian Odyssey was developed for the DS, a dual-screen handheld, and used the top screen as the regular game screen while the bottom screen/touchpad was used to draw the map with the pen.

The entire concept was fun, but is very difficult to reproduce if you don't have a screen that doubles as a touchpad in addition to a regular game screen.
It would probably help others to understand if they know that Etrian Odyssey was developed for the DS, a dual-screen handheld, and used the top screen as the regular game screen while the bottom screen/touchpad was used to draw the map with the pen.

The entire concept was fun, but is very difficult to reproduce if you don't have a screen that doubles as a touchpad in addition to a regular game screen.

Maybe, but to be fair I don't think it really applies much to the topic.

I don't want to get too off topic because this isn't really about discussing Etrian Odyssey and its map mechanics.

My thought is similar to @daMooseNeo but...I dunno, without actually seeing him give the example or doing it out myself, I hesitate to say it's actually lighter weight, but it's just a different mental approach. Counting up rather than down, as it were.

Some of the details will come down to you, whether you're okay with reserving a game variable for each map you do this with, or you could make another encapsulating array...but just in terms of one map, I'd do this.

Have a one-time Autorun event when you go to the map that does:
Script: $gameVariables.setValue(69, []);

Then have a parallel common event with, say, a 10-frame Wait on it.
Script:
Code:
let coords = `${$gamePlayer.x}-${$gamePlayer.y}`;
if (!$gameVariables.value(69).includes(coords))
{
    $gameVariables.value(69).push(coords);
    if ($gameVariables.value(69).length == 52)
// do stuff for your achievement
}

So in that case, variable 69 is turned into an array storing the unique map coordinates the player has stepped on. And 52 is the number of floor tiles you have counted on your map, which indicates they've all been stepped upon.


The problem with that is if you're using the default random encounter system, having an event on a tile prevents you from getting an encounter there.

@ATT_Turan, this worked perfectly and is easy enough to replicate for multiple maps. Thank you.
Sorry, I skimmed the responses, so sorry if something like this has already been discussed;
Can this not be faked?

Like I don't know what your dungeons look like, but the image I have in my head is that there are going to be branching paths and choke points. You could just place an event at the choke point to a branching path and put another event at the end; we can safely assume that the player walked most if not all tiles from the choke point to the end without need to account for whether they did or didn't.
You also could probably even skip the choke point event and just put an event at the end of a dead end because it's basically the same thing; assuming the player walked all the tiles from the entrance to that dead end.

From a philisophical, game play stand point - and again, based on the image I have in my head - this sounds incredibly tedious to make every tile required to be stepped on. As a player I would want no part of this.
I think it would be better to just put exploration "check points" at every major room change or point of interest; and I'd probably use like an event hit box plugin so that players don't need to stand EXACTLY on the tile you deemed to be the point of interests check point, but instead the area around it.

@TheAM-Dol, This also works, but I do have to make sure I design maps with enough choke-points or dead ends to make sure that it will work.

I think for now, I've decided to work with @ATT_Turan 's method.

Thank you all for the help.
This thread is being closed due to being solved. If you need it reopened, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/100-map-completion-event.165293/