Ultra Mode 7

Discussion in 'JS Plugin Releases (RMMV)' started by bblizzard, Apr 15, 2018.

  1. Chef

    Chef yeet Veteran

    Messages:
    258
    Likes Received:
    117
    Location:
    The Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
  2. bblizzard

    bblizzard Veteran Veteran

    Messages:
    273
    Likes Received:
    278
    Location:
    Croatia
    First Language:
    Croatian
    Primarily Uses:
    RMMV
    Wasn't this because of how these images are created? If they are sprites that stand up-right like events, I don't think there's much I can do. Or is it just the positioning that's messed up? If yes, just make a demo. It should be a relatively quick fix.
     
  3. bblizzard

    bblizzard Veteran Veteran

    Messages:
    273
    Likes Received:
    278
    Location:
    Croatia
    First Language:
    Croatian
    Primarily Uses:
    RMMV
    *legal double post*

    @Oscar92player It appears to be your lucky day. :p I noticed that the new pixi-tilemap version fixes an issue I was having with it. Basically it wouldn't render the tilemap for a certain amount of frames when the map was entered. I had this happen on vanilla MV maps and on UM7 so I knew it had to be something within either PIXI or pixi-tilemap. Anyway, since the new version didn't have that glitch, I added it into my own game and in the process I figured out the changes that are required for it to work with the new version. So I added some compatibility code in the official release as well since it wasn't a really big change.
     
    bazrat and Oscar92player like this.
  4. Oscar92player

    Oscar92player Veteran Veteran

    Messages:
    443
    Likes Received:
    187
    Location:
    Benalmádena - Málaga - Spain
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Thanks for the update!

    I've tried the new version of the plugin, but for some reason, my map appears in black. There are no code errors on the console, either, just the message that says:
    Code:
    Ultra Mode 7: Detected a newer 'pixi-tilemap' implementation, enabling compatibility code.
    An image from the sample project:
    upload_2019-6-6_20-14-53.png

    No other plugins installed on the project, since I'm using a sample project for testing purposes. Maybe I'm missing something? :/

    UPDATE: Well, I found that the screen goes black because I some part of the code I needed to add to the "main.js" inside the 'js' folder:
    Code:
    PIXI.tilemap.Constant.boundCountPerBuffer = 1;
    PIXI.tilemap.Constant.maxTextures = 16;
    This part of code is related to some of the lines that can be found on the new "pixi-tilemap.js" version (lines 202 to 205):
    Code:
            maxTextures: 4,
            bufferSize: 2048,
            boundSize: 1024,
            boundCountPerBuffer: 4,
    This is directly related to the fix of this thread that needed to use the "new pixi-tilemap.js" version. It needs that part of the code to prevent the Change Tileset command to cause framedrops and lag on maps that use that command on parallel process events.

    If I remove the added code from tthe "main.js", the map will work just fine, but the framedrops will be there because of the Change Tileset command on the parallel process event.
     
    Last edited: Jun 7, 2019
  5. bblizzard

    bblizzard Veteran Veteran

    Messages:
    273
    Likes Received:
    278
    Location:
    Croatia
    First Language:
    Croatian
    Primarily Uses:
    RMMV
    Try higher values for boundCountPerBuffer. There are several places in the code that I saw that would abort if it was 1 or less. I alao had issues with my custom tilemap where only one texture was loaded and no autotiles were visible. So I assume this constant is to blame as it worked fine as soon as I set it back to 4.
     
  6. Oscar92player

    Oscar92player Veteran Veteran

    Messages:
    443
    Likes Received:
    187
    Location:
    Benalmádena - Málaga - Spain
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    I tried, but anything above 1 on that line will cause this issue on when rendering the map:
    upload_2019-6-6_22-37-10.png

    Because those lines are connected in some way that, if you change a value, it will cause this kind of issues. If I change the value inside the "maxTextures" line for something bigger that 16, the game will crash and throw this error on the console:
    Code:
    TypeError: Cannot read property 'render' of null
        at Function.Graphics.render (rpg_core.js:1875)
        at Function.SceneManager.renderScene (rpg_managers.js:2031)
        at Function.SceneManager.updateMain (rpg_managers.js:1987)
        at Function.SceneManager.update (rpg_managers.js:1907)
    Also, bigger values than 1 on the "boundCountPerBuffer" line will make the frame drops to return when using the Change Tileset on the parallel process event.
     
  7. bblizzard

    bblizzard Veteran Veteran

    Messages:
    273
    Likes Received:
    278
    Location:
    Croatia
    First Language:
    Croatian
    Primarily Uses:
    RMMV
    maxTextures above 16 will crash, yes. webGL doesn't support more than that. But I'm afraid that having boundCountPerBuffer set to 1 actually removes the lag spike by not loading textures at all. So you can easily switch tilesets, because it doesn't actually do anything (or it does minimal change). So I don't think that the new pixi-tilemap actually solves your problem. :/

    But maybe there's a way to preload the tilesets. Do you get continuous lag spikes while you switch back and forth between tilesets or does it only happen on the first change to a tileset that you haven't used in the current session yet?
     
  8. Oscar92player

    Oscar92player Veteran Veteran

    Messages:
    443
    Likes Received:
    187
    Location:
    Benalmádena - Málaga - Spain
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    I'm afraid this new pixi-tilemap version is the only way to fix that problem with the framedrops. Preloading the Tilesets didn't solve the problem at all, because it is the way on how PIXI renders the maps when using the Change Tileset command what was causing the frame spikes. :rsad:
     
  9. bblizzard

    bblizzard Veteran Veteran

    Messages:
    273
    Likes Received:
    278
    Location:
    Croatia
    First Language:
    Croatian
    Primarily Uses:
    RMMV
    I see. :(
     
    Oscar92player likes this.
  10. Kupotepo

    Kupotepo Fantasy realist Veteran

    Messages:
    733
    Likes Received:
    725
    Location:
    Oblivious
    First Language:
    Thai
    Primarily Uses:
    RMMV
    Thank you for sharing your plugin with us. Hopefully, it works well.:LZSsmile:
     
    bblizzard likes this.
  11. Oscar92player

    Oscar92player Veteran Veteran

    Messages:
    443
    Likes Received:
    187
    Location:
    Benalmádena - Málaga - Spain
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Well, don't worry about it. Thanks for all the support regarding this problem, anyway. Perhaps in the future I can use this plugin without worrying about the lag spikes and the Change Tileset issues.
     
    bblizzard likes this.
  12. Chef

    Chef yeet Veteran

    Messages:
    258
    Likes Received:
    117
    Location:
    The Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    https://1drv.ms/f/s!AsqbW0RDykVggcZiDT973ujTmY-SFg

    Here's the demo. It has MOG weather, Terrax Lighting, and YEP Core Engine (for resolution) in it. It's the same link I gave for Thomas Edison so it's still in the list, but not turned on.
    So Terrax doesn't do TileID lighting right yet (and maybe also RegionID).
    MOG weather doesn't use the full screen for its effects, and I'm not asking for a fix since I just now found out it isn't an UM7 problem but from Moghunter self and the 1080p resolution I'm using.
     
    bblizzard likes this.
  13. bblizzard

    bblizzard Veteran Veteran

    Messages:
    273
    Likes Received:
    278
    Location:
    Croatia
    First Language:
    Croatian
    Primarily Uses:
    RMMV
    @Arend Galenkamp I took a look at it and it can't be done. :/ Terrax Lighting works by creating a single bitmap on the entire screen for tiles as far as I can tell. And since flattening anything other than the tilemap isn't supported in UM7, it can't work. :/
     
    Chef likes this.
  14. Chef

    Chef yeet Veteran

    Messages:
    258
    Likes Received:
    117
    Location:
    The Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    ahw that sucks, thanks for taking a look at it anyway
     
  15. Chef

    Chef yeet Veteran

    Messages:
    258
    Likes Received:
    117
    Location:
    The Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    Does anyone else have the problem when a Terrax lightsource get's behind the camera to be removed from the map, the light of the event crosses the screen for a split second? It's the same thing that happened with event images before. Bigger light sources were already acting a bit weird sometimes, but now I know why.
    Maybe a possible solution is to disable all lightsources with the same number once the player is so many tiles north of them. But that introduces another problem with light events that are spawned, which is needed to properly load a "2,5D" map.
    So I don't know if it's possible to disable events entirely once UM7 starts to UFO beam them up? Or to make certain events stay?
     
  16. exel.exe

    exel.exe Veteran Veteran

    Messages:
    62
    Likes Received:
    16
    First Language:
    español
    hey like this plugin, i have a question, its there a way for use mode 7 with yep scaling sprites? left this examples of my prototypes

    with mode 7
    [​IMG]
    without mode 7
    [​IMG]
     

    Attached Files:

  17. bblizzard

    bblizzard Veteran Veteran

    Messages:
    273
    Likes Received:
    278
    Location:
    Croatia
    First Language:
    Croatian
    Primarily Uses:
    RMMV
    Hm, I did add code that should handle YEP scaling properly, but I didn't test it. So I likely messed up something. Can you make a demo?
     
  18. RyanBram

    RyanBram Veteran Veteran

    Messages:
    184
    Likes Received:
    143
    First Language:
    Indonesian
    Primarily Uses:
    RMMV
    Hi @bblizard .
    Thank you for the amazing plugin. In some previous post, I saw a scene like this:



    I am really curious if it can be done using your plugin without help from other plugin. Because I cannot find any information to lock the camera to a scene without following the characters. I have tried Galv plugin for camera lock, but it seems your plugin and him don't work well together.

    Best regards.
     
  19. malonkey1

    malonkey1 Veteran Veteran

    Messages:
    30
    Likes Received:
    19
    First Language:
    English
    It looks like that is using multiple layered parallaxes, some of which are animated (or have animated events on them), not anything resembling Mode7.

    You might be able to create a similar effect using Galv's Layer Graphics plugin, though. The moving foreground can be done by basing a layer's position on a formula referring to the player position so it can shift as the player moves.
     
    bblizzard and RyanBram like this.
  20. RyanBram

    RyanBram Veteran Veteran

    Messages:
    184
    Likes Received:
    143
    First Language:
    Indonesian
    Primarily Uses:
    RMMV
    I got the video from this thread several pages backward from this page. The author claim using Ultra Mode 7 with camera locked. You can see the player look small when from far and getting bigger when nearer, same like when you see event or any object in Ultra Mode 7 that will get bigger or smaller depend on their distance from camera, although on that video the camera is locked to the scene.
     

Share This Page