MZ Mapper - Combined Maps for seamless player transfers

Jams Mapper​

Creates Seamless player transfers between maps.

1650691977268.png

Requirements/Downloads​

Primary Features​

  • Seamless transition between maps.
  • Events can wander outside of their original map.
  • Player start position is adjusted if the map is being combined.

How to setup​

  • Download the requirements/downloads and place them in the js/plugins folder
  • Ensure that the Event Bus Plugin is set before the Jams Mapper Plugin in RPG Maker.
image.png


  • Create your world maps
    • All maps need to be the same size
    • All maps need to have the same width and height (Square)
      • It is ideal to make the map size the same as size as your game window, so map loads are not visible.
    • All maps need to share the same tile set
    • All maps need to have a line added to the notes section in the following format:
      • worldpos [world name] [x] [y] e.g. worldpos Morrowind 0 1
        • [world name] - Name of the group of maps that will be combined
        • [x] - the x position compared to the other maps
        • [y] - the y position compared to the other maps
​
Hey, is it possible that you have forgotten to provide a download link or something similar?
Progress Update
Ok, so I have all the maps in an array and their world positions (Sectors below). I was thinking about how many loops I would need to combine 9 maps into 1 big map and it didn't look good, so I am creating a mathematical way to align the individual map array indexes to one big map array. This will allow me to loop through the individual map arrays only once.

Note, I am ignoring the fact that their are 6 layers in the Map.Data array for now.

1650134167192.png


It took me a few hours, but I was able to come up with a formula that will work for my situation with a little help from an excel matrix (See Attached).

I am assuming there are going to be two issues that still need to be resolved in the formula:

1. I may be making an assumption that the primary map will be in position (0,0), so I will need to test other sector values.
2. This formula only works for squares (That is the current assumption for my plugin), but I want to be able to support rectangles in the future.

1650135023367.png
Hey, is it possible that you have forgotten to provide a download link or something similar?
Thank you for the interest!

Unfortunately, I have the plugin in an unusable state right now, but as soon as I get the next phase of development complete (in the next couple days) I will give a link, so you can try it out and see it's capabilities. It is very early in development, so I would not recommend integrating it into your project until it reaches version 1.0.
That sounds interesting. I'll probably try it when it's usable.
While I read your post, I don't think joining multiple maps is a good idea. It has its reasons that maps have max sizes, that is the performance. When you want to do such a plugin, which definitely will be a great game-changer, you should aim for techniques in which you load maps dynamically when the player is close to them.

By the way, mind the events! Each event has its id, which must be unique across a map.
While I read your post, I don't think joining multiple maps is a good idea. It has its reasons that maps have max sizes, that is the performance. When you want to do such a plugin, which definitely will be a great game-changer, you should aim for techniques in which you load maps dynamically when the player is close to them.

By the way, mind the events! Each event has its id, which must be unique across a map.

Thank you for the feedback!

My goal is not to make a map bigger than the current limit. Quite the opposite. I want to only load medium to smaller size maps when a larger one is normally required so that you have more resources available for other things.

For example: The world map can often have performance issues due to the size of the map and depending on the number of events you have. My goal is to only load what is necessary for the player to see and have a seamless transition between maps, so you can fill your world with more.

Here is basically my concept via a non-plugin route.

1. Make a map that is at least a little bigger than the player resolution (No map end in sight).
2. Make the surrounding maps the same size.
3. Now copy the surround maps into the original map (Only for show and events the player will never be able to get to the end of the merged map).
4. Create events at the edge of the main map that transfer the player to the surround map he/she was about to walk onto. (I will not use events for the plugin)

Event management is going to be a necessity, but one step at a time.

The non-plugin route requires you to overlap maps and that is a lot of work to keep consistent in the editor, so my plan was to create a plugin to create the map before the game runs and force the application to read the new map instead of the original.

From a development stand point I update one map (The map won't be combined) and when I run the game it creates and renders the merged versions. Once your development is complete and no more map changes are needed you would disable the map creation part of the plugin and archive the original maps. No run time will be needed to merge the maps, so I am hoping you will have better performance than what you are proposing.
I had a thought of doing something like this (for vx ace), where the maps would be the same size (for uniformity); maybe 50x50, and you simply put a note tag on the map to specify what maps are adjacent for 10 directions (0-9, the 5 would be up, the 0 would be down). or whatever number depending if adjacent maps could be traveled to.
Then have those maps loaded when starting on the map. This would maybe allow a world map that is continuous and prevent transitions as the towns would be build into the map. So maybe like elder scrolls where entering a town does not load. But my main thought behind it was to be similar to Dungeon Siege. A continuous loading map. Even smooth transitions to lower levels.
Progress Update:
  • Project uploaded to Github and ready for download Mapper Plugin. I provided an entire game example, since there are no setup instructions and the code is currently very fragile.
  • Applied the new algorithm to merge maps and as expected it only works when the primary map is in the (0,0) position.

Please note that events are not being handled at this time, so you will see a event shift from the primary map in the middle to the upper left.

Example of issue (Map in editor is supposed to be the start location, but I started in the upper left map.):

1650165736723.png
I had a thought of doing something like this (for vx ace), where the maps would be the same size (for uniformity); maybe 50x50, and you simply put a note tag on the map to specify what maps are adjacent for 10 directions (0-9, the 5 would be up, the 0 would be down). or whatever number depending if adjacent maps could be traveled to.
Then have those maps loaded when starting on the map. This would maybe allow a world map that is continuous and prevent transitions as the towns would be build into the map. So maybe like elder scrolls where entering a town does not load. But my main thought behind it was to be similar to Dungeon Siege. A continuous loading map. Even smooth transitions to lower levels.
Exactly, I have been away from RPG maker for a couple decades, but when returning I was a bit depressed this feature wasn't available. Before I even start my game I want to have the game mechanics in place that I want to use and this is something that I really wanted.

Once I get this working well enough for my game I will need to build a battle system, because I also don't want to have a turned based battle system in my game. It is very important to me to have as little screen changes as possible. Plus development is fun. I wouldn't be a developer professionally if I didn't enjoy doing it in my down time as well.
My goal is not to make a map bigger than the current limit. Quite the opposite. I want to only load medium to smaller size maps when a larger one is normally required so that you have more resources available for other things.
Ah, then I got you wrong and I'm glad you know about the obstacles you will encounter 🙂
Anyone know of a good place in the code to tie my plugin code into the game loop? I don't need it to be too responsive (Maybe trigger every couple of seconds)?

Here is the general idea:
  • Tie into the game loop to pull the $gamePlayer.x and $gamePlayer.y
  • Create a function that compares the player's x and y position with center map boundaries
  • if player is outside the center map start a transfer to the outside map with the same x and y positions.
  • Walk from map to map with no visible transition 🙂
The map creation is going well, I believe I have perfected my map combination formula. I know what I need to do to offset the play start position, and have normal map events working, but I am not sure on the best method read the player's x and y position, so I can trigger a transition.
You should alias the method Scene_Map.prototype.update. It's totally fine when you only do a small test against the x and y coordinates.

This method exists for both MV and MZ.
I have been able to get the transitions to work. Unfortunately, the reserveTransfer function causes a few things I will need to overcome to make the transition seamless:

1. The sprite's walk animation stops
2. The sprite skips the space between the last and first blocks instead of the normal transition.
3. followers get warped to the same location as the player.

Here is a demonstration
The map transfer is a complex routine and I don't know if it's possible to solve all of the interruptions with reasonable effort. Also, when you have moving events, they *will* respawn from their origin.

I develop a plugin to inject randomized maps during playtime, and it was a looong way to do so. And my dream was always to combine your idea with mine, like a neverending randomized world map. But so far, I don't even have a clear concept to do that.

All in all, your road to complete your idea, and to solve the seamless transfers, and to keep track of all the events, will become long and tough.
The map transfer is a complex routine and I don't know if it's possible to solve all of the interruptions with reasonable effort. Also, when you have moving events, they *will* respawn from their origin.

I develop a plugin to inject randomized maps during playtime, and it was a looong way to do so. And my dream was always to combine your idea with mine, like a neverending randomized world map. But so far, I don't even have a clear concept to do that.

All in all, your road to complete your idea, and to solve the seamless transfers, and to keep track of all the events, will become long and tough.
I will take a look at the structure of your plugin and try to build mine with a future collaboratiin in mind, but I think it may make sense to render the map around the player like you suggested originally.

I will do some tests and figure out what direction would be best in the long run.

I want this for my game, so rest assured it will become reality.
Ok, I did a fair amount of research and didn't like the direction I was going with the player transfer. It involved too many changes to the code, so I decided to change the mechanism I am using and allow the existing game engine to handle transferring the player seamlessly via the looping on x and y axis option it provides.

Here is the idea:
1. Combine the 9 maps into one before maps are loaded by the game (No Change).
2. Set the map to loop on the x and y axis.
3. When a player walks outside the center map the next sections would be loaded out of player view.

Here is an example right movement: The player walks from map 6 to map 7:

before

1651637489845.png

after (Maps 4, 8, and 12 are loaded) and visible from Map 7 via the x axis looping.

1651637537263.png

Example of the butter smooth motion the new way accomplishes.

I have the seamless transitions working now, but will need to properly handle events next.

June 2022 Update:
  • New Features
    • Normal Map Events are now being handled
  • Optimizations/Process improvement:
    • Created Mocha Unit Testing plugin and started implementing (20% code coverage).
    • Separated Event Bus class from the Jams_Debugger plugin.
    • General Refactoring and code simplification.
    • Moved project from Git hub to Azure DevOps.
    • Only apply event and map updates to map sections that need to be reloaded instead of applying it to all maps that are being rendered.
    • Ensured map events can only be created if it doesn't already exist on the page (duplicate events due to map be loaded multiple times and event moved outside of the map section).
    • Setup Visual Studio 2022 project for RPG maker MZ plugin development to make development more efficient.
    • Now reusing abondoned event ids to reduce eventual event array size from growing too large.
  • Known issues:
    • Normal Player Transfers not working correctly
Spoiler: Video
Hey, just out of curiosity, what makes this plugin possible in MZ while something like this is notoriously impossible in MV because of js limitations? or did I get my facts wrong?

I'm building a procedurally generated worldmap in MV 200+ 48x48tile maps and would like to connect them seamlessly. Now i'm thinking of migrating to MZ 🙂

very nice work though, i'll keep an eye on this.
kind regards

Original thread: https://forums.rpgmakerweb.com/threads/mapper-combined-maps-for-seamless-player-transfers.146822/