Max Resolution Breaker

Discussion in 'RGSSx Script Support' started by Lantier, Oct 25, 2013.

  1. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,633
    Likes Received:
    14,383
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    Nope, tested it in an empty project with my Princess Princess copy. It works fine at first UNTIL I use tint screen and it hits a map with Both Loops, 40x40 size, it seems to break over here.


    I can make a test demo to see if I can replicate it.


    EDIT:


    Here's the Demo: https://dl.dropboxusercontent.com/u/17078211/UnlimitedResoBug.rar
     
    Last edited by a moderator: Aug 23, 2014
  2. Necromus

    Necromus Veteran Veteran

    Messages:
    490
    Likes Received:
    61
    Location:
    Germany
    First Language:
    German
    Is anyone actually able to explain, what exactly the unknown author of the first part of that script did?

    Like what all the mod.bla actually does?
     
  3. AwesomeCool

    AwesomeCool Bratty and spoiled little sister Veteran

    Messages:
    2,877
    Likes Received:
    1,954
    Location:
    Behind you! BOOOO!
    First Language:
    English
    Primarily Uses:
    N/A
    I really want to use this script.

    Can someone tell me what the remaining problems for this script is?
     
  4. Mihel

    Mihel Veteran Veteran

    Messages:
    384
    Likes Received:
    45
    @Archeia & Kaelan Both Yanfly's Ace Core Engine and Max Resolution Breaker alias the same method with the same name: alias scene_map_post_transfer_ace post_transfer in Scene_Map. Just delete/comment out one of those methods and the problem's fixed.
     
    Archeia likes this.
  5. Kaelan

    Kaelan Veteran Veteran

    Messages:
    762
    Likes Received:
    441
    Location:
    Seattle, USA
    First Language:
    Portuguese
    Primarily Uses:
    N/A
    It's finding the memory location where the resolution size limitation is being enforced and overwriting the default values in memory (640x480) by whatever resolution numbers you pass in when you call resize_screen(width,height).


    RPG Maker's tile drawing is slow because it's using Windows's software rendering instead of a hardware rendering API like DirectX or OpenGL (i.e. it's rendering using your CPU instead of your graphics card), so increasing the resolution a lot will slow down your game. As far as I know that's the only real issue left with this script. There's other minor things like potential incompatibility with other scripts (like the issue Archeia was having above) and requiring you to resize your background images (title screens, battlebacks, etc.) to fit whatever resolution you actually want to use, but those are easily fixable.

    The performance issue doesn't have any complete solution, but you can mitigate it by using full parallax mapping and commenting out a few lines in Spriteset_Map (38, 46-48 and 201), which will force the engine to never draw any map tiles (this is what I'm doing in my game). If you don't want to do that, you can just avoid making your resolution too high to limit the number of tiles being drawn at once.

    @Archeia Sorry, I took a look at that last night but forgot to post what I found. It's as Mihel said, it's just getting into an infinite loop because there's two post_transfers aliased the same way. Just comment out one of them and it should work. You can also edit one of them and just change the alias name so they're not both scene_map_post_transfer_ace:

    Code:
    #==============================================================================# ■ Scene_Map#==============================================================================class Scene_Map < Scene_Base   #--------------------------------------------------------------------------  # alias method: post_transfer  #--------------------------------------------------------------------------  alias scene_map_post_transfer_unlimited_resolution post_transfer  def post_transfer    @spriteset.update_viewport_sizes    scene_map_post_transfer_unlimited_resolution  end end # Scene_Map
     
    Last edited by a moderator: Aug 25, 2014
    Archeia likes this.
  6. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,633
    Likes Received:
    14,383
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    Thanks guys! I have an issue with the same map though (which can still be emulated in the demo) with this:
    [​IMG]
    What is that black box? The map is 40x40 (1280x1280) so it shouldn't appear like that in a 800x600 resolution...right?
    I also checked the valid resos and moved to 896x762 and the same problem occur. Interestingly enough, 1024x578 works well. I guess if the height reaches 600 ish, that's where problems occur.

    And some funky parallax stuff going on over here,The loop doesn't complete?

    The parallax size is 1280x760, map size is 34x25 (1088x800):

    [​IMG]

    Using Default VX/A's Blue Sky Parallax also shows this problem:

    [​IMG]
     
    Last edited by a moderator: Aug 25, 2014
  7. OMGerm

    OMGerm Villager Member

    Messages:
    7
    Likes Received:
    0
    First Language:
    English
    Thanks for this bit of info Sixth; I have actually already re-sized the BattleStart.png (paint.NET and/or Photoshop) to match my screen size (736, 544) but it seems to break transparency regardless.  If I use the default BattleStart.png with this script, transparency turns white; without this script, the transparency is maintained (again, with the default BattleStart.png, unmodified).  Perhaps I'm doing something I shouldn't, but I have tried with a clean project (only this script) as well without luck.  Thanks again!
     
  8. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,633
    Likes Received:
    14,383
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    @OMGerm, you're not alone, it happens to mine as well.
     
  9. Necromus

    Necromus Veteran Veteran

    Messages:
    490
    Likes Received:
    61
    Location:
    Germany
    First Language:
    German
    Ah ok, I get that, but the only way to find out which parts of the memory need to be changed is with a hex editor right? Assuming you don't know the source code.

    How the heck do you figure out which parts to change? It's not that there is just one change or so, there more than 10, seems an awful lot to figure out by "trying" I guess :/
     
  10. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,067
    Location:
    Toronto
    First Language:
    English
    I don't have personal experience with it since I'm not interested, but you'd attach a debugger and watch what it does when you resize the screen for example, and then go ahead and change it yourself. I would assume once you find where the particular chunk of memory begins, the structure is basically the same from there (based on how the code is written)


    Or you could disassemble the library directly and find the routines for it. But you'd still need to know the memory locations that it changes.
     
    Last edited by a moderator: Aug 26, 2014
  11. OMGerm

    OMGerm Villager Member

    Messages:
    7
    Likes Received:
    0
    First Language:
    English
    Thanks for the confirmation.  I'm fiddling with things to see if I can fix this, but no luck so far.  I'll post my findings (if I actually come up with any :)  )!
     
  12. Kaelan

    Kaelan Veteran Veteran

    Messages:
    762
    Likes Received:
    441
    Location:
    Seattle, USA
    First Language:
    Portuguese
    Primarily Uses:
    N/A
    @Archeia Right now, only resolutions that are multiples of the RPG Maker tile size (i.e 32x32) work. The black box happens because 800x600 is not divisible by 32. When it can't draw a quarter of a tile or 3/4 of a tile, it truncates the extra bit and doesn't draw anything on the remaining space. If you want the closest resolution to that, you can use 800x608. Both 896x762 and 1024x578 are also not divisible by 32. You don't notice it with 1024x578 because 578/32 is 18.0625, which maps to only 2 pixels missing and it's harder to see that.

    For the parallaxes: are the parallax images the same aspect ratio as your resolution? The parallax wrapping is done by tiling the image until it fills the screen, so that might happen if your parallax doesn't tile evenly because of your screen size.

    Not sure what's up with the transparency, I'll have to look into that a bit more later.
     
    Last edited by a moderator: Aug 28, 2014
  13. FenixFyreX

    FenixFyreX Fire Deity Veteran

    Messages:
    434
    Likes Received:
    307
    Location:
    A Volcano Somewhere
    First Language:
    English
    I'm working on fixing all the bugs on that Plane class and within this script in general. But more specifically, the Plane class :p When it's finished, I'll post the code.


    @Kaelan, from what I've tested, it doesn't matter what aspect ratio the parallax should be, it should loop find; that was an err on my part and I've updated the code thus far to wrap ox and oy by the smallest reduced fraction from (bitmap_dimension / viewport_or_graphics_dimension). This way, the code ensures no edges show.


    Honestly, I'm about fed up with RM's unecessary short-comings and restrictions haha, but the only thing we can do right now is trek on, eh? :p
     
    Necromus and Kaelan like this.
  14. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,067
    Location:
    Toronto
    First Language:
    English
    What happened to the custom RM player that was meant to overcome all of this? :(
     
  15. FenixFyreX

    FenixFyreX Fire Deity Veteran

    Messages:
    434
    Likes Received:
    307
    Location:
    A Volcano Somewhere
    First Language:
    English
    A custom Game.exe won't remove all of these restrictions; it only calls functions within RGSS(###).dll that startup and manage the game, sort of like a wrapper. If we really want to break the restrictions, said dll would have to be written from scratch, or else we resort to this kind of 'hack', if you will.
     
    Last edited by a moderator: Aug 29, 2014
  16. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,067
    Location:
    Toronto
    First Language:
    English
    We've already got a DLL that seems to cleanly removes the 640x480 restriction released when Ace came out.
    Not sure why people don't just use that, or why people continue to discourage its use.

    *snip*
     
    Last edited by a moderator: Aug 29, 2014
  17. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,633
    Likes Received:
    14,383
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    It's because that's illegal and breaks the EULA.
     
  18. infidelgkcn

    infidelgkcn Villager Member

    Messages:
    9
    Likes Received:
    0
    First Language:
    Turkish
    When using this script, every time I change something in the maps or in the scripts, i get AppCrash.

    Problem signature:

      Problem Event Name: APPCRASH

      Application Name: Game.exe

      Application Version: 3.0.0.1

      Application Timestamp: 4e8d3142

      Fault Module Name: RGSS301.dll

      Fault Module Version: 3.0.1.1

      Fault Module Timestamp: 4f443355

      Exception Code: c0000005

      Exception Offset: 0018092c

      OS Version: 6.1.7601.2.1.0.256.1

      Locale ID: 1055

      Additional Information 1: 0a9e

      Additional Information 2: 0a9e372d3b4ad19135b953a78882e789

      Additional Information 3: 0a9e

      Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

     

    I'm using Crystal Engine - Pokemon for Ace v.7 by CrystalNoel, my VX Ace is Steam version.. After 1 to 3 times of AppCrash, I can play the game in the new resolution, but it's frustrating.
     
  19. FenixFyreX

    FenixFyreX Fire Deity Veteran

    Messages:
    434
    Likes Received:
    307
    Location:
    A Volcano Somewhere
    First Language:
    English
    Here is the rewritten Plane class, I have tested it thoroughly with three parallax bitmaps, one being 32x32, BlueSky from the RTP, and BlueSky blown up 7% so it isn't 32x32 compliant; all three tile nicely and correctly.


    Can anyone else confirm this version of Plane is working?


    RGSS3 Plane - Pastebin


    EDIT: Also, I should note; when setting the bitmap of the plane, it recreates the plane's final bitmap (which is double the viewport or screen size); this results in a flash of lag. I'm working out a way to fix this, but unfortunately I don't think we can overcome it without writing a faster Bitmap blt method...so yeah, that. :/


    Fixed, I just cached the Plane bitmaps, instead of recreating it everytime. This should stop the 'lag' from happening every time the bitmap is updated to the same one from before, at least.


    Final Edit? - I'm working on rewriting Graphics::transition, so that the BattleStart image will work. Not sure I can pull it off though, as it requires alpha masks and such (a custom dll probably, meh). I have the alpha mask part written, now I must write the actual effect..
     
    Last edited by a moderator: Sep 12, 2014
  20. Kaelan

    Kaelan Veteran Veteran

    Messages:
    762
    Likes Received:
    441
    Location:
    Seattle, USA
    First Language:
    Portuguese
    Primarily Uses:
    N/A
    I've been messing with my project's resolution some more lately, I'll take a look at it tonight when I get back from work.

    Edit: Didn't have a ton of time to test this, but I tried it out briefly and had some problems. Using this (and commenting out the old Plane class) with Victor's Fogs & Overlays script causes the parallax to not display at all. This was an issue with the previous version, which I fixed by adding

    Code:
      def blend_type=(blend_type)    @blend_type = blend_type    @sprite.blend_type = blend_type  end    def opacity=(opacity)    @opacity = opacity    @sprite.opacity = opacity  end    def z=(z)    @z = z    @sprite.z = z  end    def tone=(tone)    @tone = tone    @sprite.tone = tone  end
    but that doesn't seem to work with the new version. Haven't tested the scrolling yet, since I can't figure out how to get the parallax layer to show up.
     
    Last edited by a moderator: Sep 12, 2014

Share This Page