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
    Maybe I'm being a bit dense here but is it possible to change the Z-value of the player (and maybe events) with the camera following the player?

    *to achieve the same effect as KMS with his/her mode7 demo a few years back. The one with the airship.
     
  2. bblizzard

    bblizzard Veteran Veteran

    Messages:
    273
    Likes Received:
    278
    Location:
    Croatia
    First Language:
    Croatian
    Primarily Uses:
    RMMV
    You mean Character Anchors but for the player? Or did you want something more specific?
     
  3. Chef

    Chef yeet Veteran

    Messages:
    258
    Likes Received:
    117
    Location:
    The Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    No not like that, I think. It only happens 2 times in this video where the aircraft goes up and down in the Z-axis:


    Besides that I have another question: (I am not asking you to make this, I just wanna know if it's even possible) Is RayCasting a thing that can be done in RPG Maker, let alone work with UM7's YAW? A few days ago I basically made a Wolfenstein 3D arena without the shooting mechanic so I dove a bit deeper on how that could be achieved (player/event touch doesn't even work right yet). I think I'm somehow going to use this handicap to my advantage.

    And that comes to a 3rd and final question: I have no idea how MV reads maps but I saw how Doom on the SNES has different heights thanks to a sort of Region ID and tree like loading system that can read at what offset different parts of a map (or different maps) needs to be drawn. Now on the one side I think it uses a 3D buffer but on the other I think it's just a clever drawing trick that magically gives the illusion of height because enemies can still be shot without being on the same height. Again I'm not asking you to make it somehow work, I'm just wondering if it's even possible with pixi.js and MV.
     
    bblizzard likes this.
  4. bblizzard

    bblizzard Veteran Veteran

    Messages:
    273
    Likes Received:
    278
    Location:
    Croatia
    First Language:
    Croatian
    Primarily Uses:
    RMMV
    Hm, let's see...

    For the vehicle position on the screen technically it should be relatively easy to manipulate the GameVehicle.screenX() and GameVehicle.screenY() methods while in an airship. You'd need to add some code to make this work and then simply change the camera location. The camera is defined just by distance right now, but actually doing some minor adjustments to get that effects of going up and don't isn't too hard to do. tldr; It's both possible and relatively easy to do. You need to edit Game_Map.refreshUltraMode7View(), simply change the position of the "target" vector.

    It depends on how much of a detailed raycasting implementation you need. I have implemented UltraMode7.screenToMap() and UltraMode7.mapToScreen() which I use to transform between screen coordinates (X, Y position on the screen) and map coordinates (X, Y position on the map in standard tile coordinates), but the implementation can be copied and modified to include all of 3D space. Right now it only does raycasting onto the plane in 3D space that is the map and tries to find an intersection. This is how I know where sprites need to be position on the screen without sprites requiring a rewrite in the engine to include an actual Z coordinate.

    Doom didn't use real 3D as we know it today. Yes, their design is intricate and quite clever, but it was 2D with visual trickery (they didn't have a depth buffer). I really enjoyed looking it up myself and I suggest anybody into programming and video games to check it out. It's very interesting with how developers back then had to work with various limitations and the ingenious solutions they came up with.

    If you want to go that way, I suggest you rather try something like Wolfenstein 3D as MV's map data could easily be used to replicate that effect with region IDs. If this is what you wanted to use raycasting for, it's actually much simpler. All you need to do is a test for the intersection of two 2D vectors: Apply the yaw rotation to a vector from the player position using sin() and cos(). This will get you the player looking direction on the 2D map plane. The second vector's origin should be at the enemy position in local space (basically enemy position minus player/camera position) and then just apply the yaw plus PI / 2 (to rotate it by 90°). Finally you should apply a length on both ends to that enemy vector to create a sort of hit box (this means offseting the vector and changing its length). Then just solve the equation for a two finite 2D vectors intersection and you have a hit detection algorithm. As for walls, you can do something similar. In fact you could do all that with base MV and then just add UM7 to change the visuals as the game logic would stay identical.
    MV's map data in general is just a 2D array of tile IDs where the index of each tile ID corresponds to an X,Y coordinate on the map.
     
    Last edited: Aug 7, 2019
    Chef and Marquise* like this.
  5. StatusGear

    StatusGear Entertainment Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    I might be a little late to the game here, but do you intend to implement what was done in RPG Maker XP's H-Mode7 using heightmaps to creating levels of elevation of the map? That would significantly change the way RMMV games could be created.
     
  6. Chef

    Chef yeet Veteran

    Messages:
    258
    Likes Received:
    117
    Location:
    The Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    Sorry for the reaaaally late reply, I was hoping to learn JavaScript and implement it in at least the same week but that didn't work out. Tomorrow is my first day of learning JavaScript from A-Z. Then I want to write out your explaination. It's about time I can do such things by myself...
     
    Last edited: Aug 21, 2019
  7. bblizzard

    bblizzard Veteran Veteran

    Messages:
    273
    Likes Received:
    278
    Location:
    Croatia
    First Language:
    Croatian
    Primarily Uses:
    RMMV
    I don't plan to create height-map support for UM7 myself. But if somebody wants to build upon UM7 and do that, sure, no problem.
     
  8. StatusGear

    StatusGear Entertainment Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    If anyone is willing add heightmap support I will pay them.
     
  9. Killuki Zaoldyeck

    Killuki Zaoldyeck Veteran Veteran

    Messages:
    221
    Likes Received:
    24
    First Language:
    Spanish
    Primarily Uses:
    N/A
    Sometimes I think that RMV was greatly underpowered. I've seen a lot of awesome things done with any RGSS version but are lacking of existence on MV after... five years now? And javascript supposedly gives more opportunities. I talk from nearly zero coding knowledge by the way.
     
    Marquise* and StatusGear like this.
  10. bblizzard

    bblizzard Veteran Veteran

    Messages:
    273
    Likes Received:
    278
    Location:
    Croatia
    First Language:
    Croatian
    Primarily Uses:
    RMMV
    This is because most of the "star scripters" in the XP era stopped using RM altogether. Some of them made some really crazy stuff, pushing the limits of XP. Those who stayed for longer in the community created even crazier stuff later on since they had more experience. Basically XP just had way more time to develop a community and custom script base. It didn't have too much going for itself in its first 5 years either.

    I remember a lot of people still preferring RM2k3 when I started using RMXP myself. It took quite a bit of time until I stopped hearing from (some) people how 2k3 was better. A similar thing happened to XP and it stayed relevant through the VX and VXA eras. Realistically the only two advantages XP had was a bigger custom script base and a more flexible (but somewhat less sophisticated) mapping system. (VX, VXA and MV all are better software compared to XP in most segments.) Only now, when MV's been out for a while, I can see XP fading slowly into the background.

    But yeah, I didn't get much of a feeling that there are many very capable scripters active right now (except for all the work Yanfly's done and IDK how much DerVVulfman has done in MV).

    That being said, MV's scripting system does have a few limitations. XP did allow you to extend with DLLs and MV can't do that. So doing certain CPU intensive tasks are likely much harder to accomplish as well as online connectivity (not impossible of course, just much harder).
     
    Killuki Zaoldyeck likes this.
  11. Storyteller-Hero

    Storyteller-Hero Veteran Veteran

    Messages:
    46
    Likes Received:
    171
    First Language:
    English
    Primarily Uses:
    RMMV
    Olivia and Irina are working on a lot of great MV plugin projects over on itch.io - they might be the most active after Yanfly goes into "soft retirement" from plugin work.
     
    bblizzard likes this.
  12. KaYsEr

    KaYsEr Koruldia Veteran

    Messages:
    211
    Likes Received:
    446
    Location:
    London
    First Language:
    French
    Primarily Uses:
    RMMV
    More like 3 and a half years. Give it time, the MV we have today (1.6) is already far from the one we had in 2016 (1.0), new PIXI and NW updates, many fixes and of course plugins like this one here. (And check MogHunter on the link below, all his VXACE scripts are now on MV with even more stuff!)
    Feels like the gap between 1.0 and 1.6 is bigger than the gap between VX and VX ACE, and it will keep improving.

    Played an XP game recently, still the same screen tearing and jerky framerate when scrolling.
    Except that my CPU is an i9 9900k @5.2ghz but it doesn’t change much compared to the mighty 3.8ghz Pentium4 we had back then.

    XP (or VX-ACE to a lesser extend) wasn’t made to take advantage of our modern stuff so it’s like a bottleneck I think, unless I was particularly unlucky updating my hardware for 14 years.

    On the flip side we now have access to GPU power. A nice tradeoff, imo.

    Try an MV game on the latest GeForce RTX, it's reassuring for the future because it means even if MV has flaws we’ll be able to brute force and make them invisible, can’t say the same for XP. I bet MV runs better than XP on a Raspberry Pi, need to try that asap.^__^.

    *** *** *** *** ***

    Anyway, hey Bblizzard I wanted to tell you that a while ago I found a small compatibility issue with another plugin, that one to show items you find on the map directly on top of your MC:

    https://atelierrgss.wordpress.com/rmv-treasure-popup/

    You can see it in action in my signature .GIF or in my KS trailer. The thing is, when it’s on a UM7 map, the icons shift towards the sides (“offset” to simplify) and.. Well that’s it. Hope you are fine and hope it’s an easy fix, fingers crossed. Worst case scenario I can use a “HUD list version” (but in case other people use that plugin, would still be nice to fix) and I suspect maybe other plugins from MogHunter that I never tried (like the health bar on top of your character) could have the same issue. I’ll test that for you later this year if you want.

    Take care!
     
    bazrat and bblizzard like this.
  13. Necrojoker00

    Necrojoker00 Villager Member

    Messages:
    23
    Likes Received:
    8
    Location:
    México
    First Language:
    Spanish
    i'm getting this error, talked to the npc to the right help?
     

    Attached Files:

  14. bblizzard

    bblizzard Veteran Veteran

    Messages:
    273
    Likes Received:
    278
    Location:
    Croatia
    First Language:
    Croatian
    Primarily Uses:
    RMMV
    @KaYsEr Yeah, XP just has this limit with FPS and single-core CPU power, because it's running on such an old Ruby version. It would actually jerk less if you changed it to run at 60 FPS via script. Running at 40 causes rendering issues with v-sync as most monitors normally run at 60Hz.

    Yeah, the problem with custom sprites on the map screen is if they use a custom position. If the plugin can be changed to use the character screen X and Y as starting reference, it should actually fix itself.

    @Necrojoker00 That's the demo? I can't reproduce the error. Can you press F8 and paste the error message from the debug window after this crash happens?
     
    KaYsEr likes this.
  15. Chef

    Chef yeet Veteran

    Messages:
    258
    Likes Received:
    117
    Location:
    The Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    So after a waaaaaaaaaaay to long time I managed to fix the lighting problem. I was trying to sleep ofcourse but here I am.
    The problem was that Terrax' Light bulbs on events were flickering in the screen when an event gets pulled up behind the camera.
    The solution is a little bit complex and introduces some new limitations, BUT IT WORKS!
    1. Plugins: Ultra Mode 7, Terrax Lighting (make sure to make Terrax compatible), Altimit Movement or something else with colliders. Go to Terrax in your plugin list, set the DeActivate Switch to C or whatever is handiest (least work) for you.
    2. Make an event, put your light in the Note tag, set an animation or image if you want to, set "Through" on if the event is gonna be "Same as Characters". Set it on "Player Touch". If you're using AltimitMovement, put this in a COMMENT:
    Code:
    <collider>
    <rect x='-30' y='-6' width='60' height='1' />
    </collider>
    Underneath that, turn Self Switch C (or whatever you chose) ON.
    3. Copy that page. Now, on page 2, set Self Switch C (or whatever you chose) as a requirement and turn it OFF in that instruction under the Collider Code. Now change the "Y-value" in that Collider Code to "-5". Done.

    Limitations: On the top of my head I wouldn't know a way right now to give these events extended functionality beyond decoration purposes. Something like opening a chest for example is gonna be challenging to do. But walking / stepping animations should be fine.

    In the Collider Code, -30 and 60 are the horizontal trigger range, you can make it wider if you want (wider is -50 and 100).
    69 ligts on a map still work fine, at 60fps and 1920x1080p.

    EDIT: Yes I do know how to further utilise the lighting events. By using MOG's Event Sensor. Set the sensor to D in the pluginlist. Make a third page on the event with Self Switch D as requirement. Set a COMMENT with the following collider code:
    Code:
    <collider>
    <circle cx='0.5' cy='0.5' r='0.40' />
    </collider>
    Add another COMMENT with the following code:
    Code:
    event sensor : 1
    Copy the event sensor code to the other 2 pages as well. If it's an event for talking make sure to turn off "Through" and set is to "Same as Characters".
     
    Last edited: Aug 24, 2019
    bblizzard likes this.
  16. bazrat

    bazrat Veteran Veteran

    Messages:
    209
    Likes Received:
    131
    Location:
    Washington State
    First Language:
    English
    Primarily Uses:
    RMMV
    Entered C3 game jam using your mode 7 @bblizzard so thankful for this plugin! :D

     
    Tea's Jams, bblizzard and Chef like this.
  17. Chef

    Chef yeet Veteran

    Messages:
    258
    Likes Received:
    117
    Location:
    The Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    1. Is that just the normal ScreenShake you are using? Because it feels a bit different.
    It's really well made btw!
     
  18. bazrat

    bazrat Veteran Veteran

    Messages:
    209
    Likes Received:
    131
    Location:
    Washington State
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks, haha. The screen shake is TheoAllens plugin, https://theoallen.itch.io/rmmv-screenshake
     
    bblizzard and Chef like this.
  19. Chef

    Chef yeet Veteran

    Messages:
    258
    Likes Received:
    117
    Location:
    The Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    Wish I could like a post twice...
    But holy scheißen I didn't even know about that plugin. Seriously, thank you! :D
     
    bazrat likes this.
  20. Necrojoker00

    Necrojoker00 Villager Member

    Messages:
    23
    Likes Received:
    8
    Location:
    México
    First Language:
    Spanish
    UltraMode7.js:729 Ultra Mode 7 requires WebGL support!
    (anonymous) @ UltraMode7.js:729
    pixi.js:27682
    PixiJS 4.5.4 - ✰ Canvas ✰ http://www.pixijs.com/ ♥♥♥


    rpg_managers.js:1954 ReferenceError: UltraMode7 is not defined
    at eval (eval at Game_Interpreter.command355 (rpg_objects.js:10500), <anonymous>:1:1)
    at Game_Interpreter.command355 (rpg_objects.js:10500)
    at Game_Interpreter.executeCommand (rpg_objects.js:8930)
    at Game_Interpreter.update (rpg_objects.js:8838)
    at Game_Map.updateInterpreter (rpg_objects.js:6115)
    at Game_Map.update (rpg_objects.js:6022)
    at Scene_Map.updateMain (rpg_scenes.js:608)
    at Scene_Map.updateMainMultiply (rpg_scenes.js:600)
    at Scene_Map.update (rpg_scenes.js:589)
    at Function.SceneManager.updateScene (rpg_managers.js:2029)
     

    Attached Files:

Share This Page