Question about high level project structure

Just thought I'd ask this, as I'm embarking on a project that is larger than I've previously attempted, and I'm wondering how people tackle this.

Say, for example, you have a location - for the sake of argument, we'll say this is a tavern. The player returns to this tavern many times throughout their adventure, and different things happen each time - sometimes a cutscene plays, sometimes not, but most of the time, at least, different NPCs are at the bar.

The journey in the game follows a linear story, so by doing things, the user is progressing through a series of states, numbered 1 when the user starts, and the very final state is number 128. So each time they come back to the tavern in a different state, 36, 45, 84 etc., you want the tavern to be a bit different.

There are two broad ways I can see that you would do this.

The first way is that you always have 1 tavern map. In this map, you have events with logic that show/hide their presence based on a series of switches and variables, as well as events that only fire off at certain states.

The second way is that you have multiple tavern maps, and when you enter/exit the tavern, a conditional-if decides if you go to Tavern-15, Tavern-85 or Tavern-125 etc. This way, you have more maps, but the logic in each map is simpler and less prone to error.

What do people prefer? I can see strengths in both approaches, but I'm wondering if there's a best-practices approach?
I actually use both techniques in my current project as I found sticking to one of the two wasn't working due to some changes that occurred changed the look of the map to drastically to not do it this way 🙂
It's a bit more work this way but I think it works best when your 'changing map' is either rather large
The player returns to this tavern many times throughout their adventure, and different things happen each time - sometimes a cutscene plays, sometimes not, but most of the time, at least, different NPCs are at the bar.

that's an NPC manager.
it can be done with simple conditionals and common events (you don't necessarily need a plugin), but the common events have limited number of instructions, so you'd have to optimize it.

THAT, for taking care of the NPC management.
now, ON TOP OF THAT, you need a quest system, which will return you the conditions to spawn the different NPCs based on the state of your game.
and, on top of that, if you want, a dialogue manager, so you can take out any dialogue-related routines from the NPC manager and make it lighter.

for example:
nuevo-1.jpg


that is MY version.
that highlighted part is the manager itself: all it does is take the NPC being triggered by the player, and send it down for further processing, through labels and return points.
you see I have a quest manager taking care of the dialogue, which lets me not-use standard "show text" instruction (my own plugin)
and, it also checks for game progression to either enable NPCs or not, or show one dialogue or another.

basically:

Code:
variables[8] = "NPCname"
trigger_manager

manager:
  go_to_label_named "handle + variables[8]"
  :return
  exit_self

##manager_data##
  :handle NPCname
  if check_quest (ID):
    say "line1"
  else
   say "line 2"
  end_if
  go_to_label_named "return"

  :handle NPCname2
  if check_quest (ID):
    say "line1"
  else
   say "line 2"
  end_if
  go_to_label_named "return"

etc...
 ##end manager data##
end_manager
If it's a linear game, it's better to use multiple maps. You know exactly what the player is going to do throughout the game and can craft the tavern specifically each time. If you were making an SNES game or something, that might not be the best choice because of size limitations, but since that's not the case, it is definitely the easier/better way to go for a linear game.

For an open world game, or even one with a lot of branching paths, having one tavern map with a lot of conditionals for NPCs or environment stuff is better for the obvious reason being that you don't know what order the player will do things in. It would require a hell of a lot more maps to achieve every possible outcome, if you could even figure them all out. Making individual maps for this purpose is impossible at worst and very inefficient at best. There will likely be bugs, but with a lot of playtesting you'll be able to iron most of them out.

Original thread: https://forums.rpgmakerweb.com/threads/question-about-high-level-project-structure.104733/