Max Resolution Breaker

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

  1. Napoleon

    Napoleon Veteran Veteran

    Messages:
    869
    Likes Received:
    96
    First Language:
    Dutch
    The problem isn't the resolution. The problem is that they capped it on purpose (pretty sure at least). Imagine them getting many complaints/bad reviews/unhappy people regarding performance if they would allow an unlimited resolution. At least from the average user because the unlimited causes major fps problems on the most modern PC's. An unlimited resolution (even if supported by RPG Maker) should only be used by advanced users or by tiny scripts such as picture galleries. But I can't even do it for my picture gallery because they just disabled it for everyone...

    Any game? Most games are just full HD. In my experience it's pretty must just RPG Maker and a few 2D adult games. Not counting flash games obviously. I'm still downsizing my 3000+ pixel artwork to something like 200. But I knew that when I chose RPG Maker as my engine. Can only blame myself...

    And like I said before somewhere, the internal code could possibly be optimized. Someone improved the Bitmap.clear() and .blt() methods and scripts like Victors lighting script all of a sudden gain a 20 fps boost when stresstesting. Some lighting scripts like Khas's new lighting script even gained up to ~40 fps. Just by improving 2 basic methods through a dll file in c++... Absurd. At least, if I understood that properly.
     
    Last edited by a moderator: Jun 2, 2014
    #81
  2. Kaelan

    Kaelan Veteran Veteran

    Messages:
    762
    Likes Received:
    441
    Location:
    Seattle, USA
    First Language:
    Portuguese
    Primarily Uses:
    N/A
     

    Afaik there aren't any crash bugs left in this script, I've been using it for about a month and a half without any issues. It's probably something wrong with your project. Make sure you're using the latest version and you don't have anything else causing crashes in your game, like undisposed sprites.

     


    Link? Or at least mention where it can be found?
     
    Last edited by a moderator: Jun 2, 2014
    #82
  3. Napoleon

    Napoleon Veteran Veteran

    Messages:
    869
    Likes Received:
    96
    First Language:
    Dutch
    When I used the script Victors fog script bugged just by having that script even on the default resolution. At least for me it did. There is an old topic about that somewhere.

    On top of that it crashes so now and then (the entire client) but perhaps I used an old version or perhaps it didn't like another custom script. But the crashes were never instant. Sometimes after 5 minutes or sometimes somewhere in the menu or etc. I had no real way to debug it.

    About the dll. There is no link. It's a commercial dll script that is currently still in development. I'm not allowed to share it. But I could ask him when he finishes his exams to explain it in more detail in this topic.
     
    #83
  4. Kaelan

    Kaelan Veteran Veteran

    Messages:
    762
    Likes Received:
    441
    Location:
    Seattle, USA
    First Language:
    Portuguese
    Primarily Uses:
    N/A
    #84
  5. cremnophobia

    cremnophobia Veteran Veteran

    Messages:
    194
    Likes Received:
    80
    I'm interested in an explanation (maybe even a demo?), too.


    Because writing RGSS's bit blit is not a simple task and I think improving the RGSS without (at least partially) rewriting it wouldn't result in such high numbers.


    Are these only from stress tests? Are there any real world examples?
     
    Last edited by a moderator: Jun 2, 2014
    #85
  6. Napoleon

    Napoleon Veteran Veteran

    Messages:
    869
    Likes Received:
    96
    First Language:
    Dutch
    Nope there are more problems. See topic below. When you try to draw a lot of text onto the screen at once then it will crash. Sure it can be fixed or worked around but there are so many details that seem to crash the client with no error message or anything. You still have to be careful. And a bigger resolution means that you can draw more text onto the screen making it more likely that this crash occurs.

    http://forums.rpgmakerweb.com/index.php?/topic/27912-draw-text-crashes-the-client/

    Or perhaps it's just me who keeps running into crashes so now and then...

    Update: It was not caused by this script. RPG Maker simply crashes whenever you draw a long string onto a bitmap with one single bitmap.draw_text(..).
     
    Last edited by a moderator: Jun 6, 2014
    #86
  7. LunisequiouS

    LunisequiouS Villager Member

    Messages:
    9
    Likes Received:
    1
    This script causes even an empty project with no other scripts to crash as soon as Graphics.resize_screen() is called, regardless of the resolution specified. This is on Windows 7 x64. Can anyone else confirm this works on a 64 bit OS? Perhaps the memory locations are mapped differently in x64 and thus cause a crash.

    Edit: Disregard this, it works fine in x64. In order to get it to run I had to:

    1. Set compatibility mode for Game.exe for "Windows XP (Service Pack 3)" (all modes from Windows 2000 to Windows Vista (Service Pack 2) work, just not Win 9X or Windows 7 for some reason).

    2. Close anything that may be injecting into DirectX applications. In my case the culprit was MSI Afterburner. RivaTuner and EVGA Precision would likely do the same.

    That said, this has to be the best script ever. Major props to everyone involved in it's creation.
     
    Last edited by a moderator: Jun 6, 2014
    #87
    Kayss likes this.
  8. Kaelan

    Kaelan Veteran Veteran

    Messages:
    762
    Likes Received:
    441
    Location:
    Seattle, USA
    First Language:
    Portuguese
    Primarily Uses:
    N/A
    I'm on Win7 x64 and I don't have any problems using it, even after calling resize_screen multiple times. Works on my main project, two different side projects and an empty project.

    Does it provide any error information before crashing?

    Edit: Glad you got it working!

    On a separate note, it's been bugging me that this doesn't work correctly with parallaxes. FenixFyre's plane made parallaxes display again, but they don't tile correctly and they don't work correctly with Victor's Fog Overlay script (it ignores most of the settings you'd care about, like the depth - which pretty much breaks parallax mapping).

    So I fixed all of that: http://pastebin.com/FyLyMzis

    [​IMG]
    If you just want the edits, I modified most of the Plane class, Game_Map::scroll_down and Game_Map::scroll_right.
     
    Last edited by a moderator: Jun 7, 2014
    #88
    That Bread and Bonkers like this.
  9. LunisequiouS

    LunisequiouS Villager Member

    Messages:
    9
    Likes Received:
    1
    With Kaelan's latest fix this script is absolutely amazing. It's only final flaw is that in resolutions higher than 1024x768, the first row of tiles in the map seems to loop back and renders in the very bottom if when the map scrolls. If anyone can fix that one last nagging issue, we'll finally have full support for 720p+ games in RPG Maker. I've been testing out and with careful design considerations and a select few scripts you can keep the framerate very playable, I'm still getting 30+ fps even at 1080p. =D
     
    #89
  10. Kaelan

    Kaelan Veteran Veteran

    Messages:
    762
    Likes Received:
    441
    Location:
    Seattle, USA
    First Language:
    Portuguese
    Primarily Uses:
    N/A
    The looping happens when you use a map that has smaller dimensions than your resolution (specifically, when Game_Map::screen_tile_x and Game_Map::screen_tile_y are less tiles than the amount your screen size allows). If you divide your resolution by 32, you get the minimum size map you should use. i.e.: My game is running on 1280x960, so all of my maps have to be at least 40x30 tiles.
     
    #90
  11. Napoleon

    Napoleon Veteran Veteran

    Messages:
    869
    Likes Received:
    96
    First Language:
    Dutch
    Is it somehow possible to entirely disable this script during runtime when you don't need it? I noticed in the old version that even setting the resolution back to 544 still causes the potential bugs it had back then (I know they're fixed).

    I only need it enabled at specific times. But it overwrites so much that I don't see an immediate solution for that.
     
    #91
  12. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,069
    Location:
    Toronto
    First Language:
    English
    Add this somewhere

    http://www.rpgmakervxace.net/topic/100-any-chance-of-higher-resolution-or-larger-sprite-support/page-2#entry7997

    #==============================================================================# ▼ Viewports/Map Fix for Modified RGSS300.dll File# Origin of Code: Yanfly Engine Ace - Ace Core Engine v1.06# -- Last Updated: 2011.12.26# -- Level: Easy, Normal# -- Requires: n/a# #==============================================================================Graphics.resize_screen(1024,768)#==============================================================================# ■ Game_Map#==============================================================================class Game_Map #-------------------------------------------------------------------------- # overwrite method: scroll_down #-------------------------------------------------------------------------- def scroll_down(distance) if loop_vertical? @display_y += distance @display_y %= @map.height * 256 @parallax_y += distance else last_y = @display_y dh = Graphics.height > height * 32 ? height : screen_tile_y @display_y = [@display_y + distance, height - dh].min @parallax_y += @display_y - last_y end end #-------------------------------------------------------------------------- # overwrite method: scroll_right #-------------------------------------------------------------------------- def scroll_right(distance) if loop_horizontal? @display_x += distance @display_x %= @map.width * 256 @parallax_x += distance else last_x = @display_x dw = Graphics.width > width * 32 ? width : screen_tile_x @display_x = [@display_x + distance, width - dw].min @parallax_x += @display_x - last_x end endend # Game_Map#==============================================================================# ■ Spriteset_Map#==============================================================================class Spriteset_Map #-------------------------------------------------------------------------- # overwrite method: create_viewports #-------------------------------------------------------------------------- def create_viewports if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal? dx = (Graphics.width - $game_map.width * 32) / 2 else dx = 0 end dw = [Graphics.width, $game_map.width * 32].min dw = Graphics.width if $game_map.loop_horizontal? if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical? dy = (Graphics.height - $game_map.height * 32) / 2 else dy = 0 end dh = [Graphics.height, $game_map.height * 32].min dh = Graphics.height if $game_map.loop_vertical? @viewport1 = Viewport.new(dx, dy, dw, dh) @viewport2 = Viewport.new(dx, dy, dw, dh) @viewport3 = Viewport.new(dx, dy, dw, dh) @viewport2.z = 50 @viewport3.z = 100 end #-------------------------------------------------------------------------- # new method: update_viewport_sizes #-------------------------------------------------------------------------- def update_viewport_sizes if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal? dx = (Graphics.width - $game_map.width * 32) / 2 else dx = 0 end dw = [Graphics.width, $game_map.width * 32].min dw = Graphics.width if $game_map.loop_horizontal? if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical? dy = (Graphics.height - $game_map.height * 32) / 2 else dy = 0 end dh = [Graphics.height, $game_map.height * 32].min dh = Graphics.height if $game_map.loop_vertical? rect = Rect.new(dx, dy, dw, dh) for viewport in [@viewport1, @viewport2, @viewport3] viewport.rect = rect end endend # Spriteset_Map#==============================================================================# ■ Scene_Map#==============================================================================class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # alias method: post_transfer #-------------------------------------------------------------------------- alias scene_map_post_transfer_ace post_transfer def post_transfer @spriteset.update_viewport_sizes scene_map_post_transfer_ace endend # Scene_Map
    I use something similar for overlay map layers to address the looping issue as well.
     
    Last edited by a moderator: Jun 13, 2014
    #92
  13. LunisequiouS

    LunisequiouS Villager Member

    Messages:
    9
    Likes Received:
    1
    Most of my maps are 50x50, so they should be large enough for higher resolutions. I had previously used a script called Map Scroll Glitch Fix with some success and just as Tsukihime's snippet, it does prevent tiles from looping and works well, unless you have a parallax image as background in the editor (whether it follows you or stays fixed doesn't seem to matter).

    Then it appears the parallax jumps forward and renders through the tiles in the very last row of the map, quite a distracting effect. I tried editing the Ace's Overlay Mapping script to add another background layer with ZOrder at -1 to simulate static background parallaxes, but they too suffer from the same bug.

    Tsukihime, you mentioned tinkering with that script (I assume it's the same) perhaps you've fixed this issue?
     
    #93
  14. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,069
    Location:
    Toronto
    First Language:
    English
    The overlay maps I'm referring to is my own map layers script. I'm assuming you're talking about Yami's or something.
     
    #94
  15. LunisequiouS

    LunisequiouS Villager Member

    Messages:
    9
    Likes Received:
    1
    Oh I see. I'm sorry. Anyway, I've noticed the issue I'm describing happens only when the game's resolution is not divisible by 32. This is something of a problem for common 16:9 resolutions such as 1280x720, 1600x900 and 1920x1080 all have heights that don't divide by 32 and thus experience this effect. Non standard resolutions like 1024x576 and 1536x864 work flawlessly though.

    Also it looks like the script fails with large resolutions and unorthodox aspect ratios. Trying to set 2560x512 would throw an error but 2400x480 worked fine (same aspect ratio).

    Edit - Here's a simple script for calculating valid resolutions for using with your VX Ace projects:

    RATIO_X = 16.0; RATIO_Y = 9.0 #Aspect RatioSTART_X = 320; MAX_X = 2560 #Initial and final screen widths - Both must be divisible by TILE_SIZETILE_SIZE = 32 #Tile size to check againstputs "Valid " + RATIO_X.round().to_s + ":" + RATIO_Y.round().to_s + " resolutions: " x = START_X while x <= MAX_X do y = x / (RATIO_X/RATIO_Y) print x.to_s + "x" + y.round().to_s + "\t" if y % TILE_SIZE == 0 x+=TILE_SIZE endAnd here are the results for common aspect ratios:

    As you can see there are very few true 16:9 resolutions that work well with the default code that handles scrolling and assumes the resolution is perfectly divisible by 32.

    The solution I guess is sticking to these unless someone can patch that code to work with smaller tile sizes.
     
    Last edited by a moderator: Jun 13, 2014
    #95
  16. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,069
    Location:
    Toronto
    First Language:
    English
    Well the script basically resizes the viewport, so you don't see too much (and in the case of small maps, things start to overflow).


    I suspect this math causes issues:

    dh = [Graphics.height, $game_map.height * 32].minThough I'm not entirely sure, since it's SUPPOSED to draw a rectangle the size of your screen.
    If the parallax is being shown instead of the map tiles, then the viewport's simply not big enough and it isn't drawing anything near the bottom.
     
    Last edited by a moderator: Jun 13, 2014
    #96
  17. OMGerm

    OMGerm Villager Member

    Messages:
    7
    Likes Received:
    0
    First Language:
    English
    First, thank you to all involved; this is wonderful. I've noticed that transitions are a known issue. For me this means loss of transparency in BattleStart.png when combat initiates.

    I would like to address this. Is there ongoing work concerning this that I might use as a starting point? Thank you again.
     
    #97
  18. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    800
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    Wow, this script got some neat updates! o.o

    I saw those undisposed things with Mithrian's script, and had no idea where they came from.

    Good that I came across here, the new version deals with that problem. *.*

    Thanks for everyone (and wow, so many o.o) who worked on this script!

    OMGerm, you can just resize the BattleStart.png to your new resolution.

    Use a program like Photoshop, or simply use Microsoft Office Picture Manager, and resize your pictures. 

    These won't break the transparency effect at all. 

    This is an easy fix for battle transitions, I did this too. 
     
    #98
  19. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,638
    Likes Received:
    14,384
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    I tried Kaelan's fix but when used with Yanfly's Core Engine, they seem to have a stack level error.

    It seems to be this one:

    Code:
      #--------------------------------------------------------------------------  # new method: update_viewport_sizes  #--------------------------------------------------------------------------  def update_viewport_sizes    if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal?      dx = (Graphics.width - $game_map.width * 32) / 2    else      dx = 0    end    dw = [Graphics.width, $game_map.width * 32].min    dw = Graphics.width if $game_map.loop_horizontal?    if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical?      dy = (Graphics.height - $game_map.height * 32) / 2    else      dy = 0    end    dh = [Graphics.height, $game_map.height * 32].min    dh = Graphics.height if $game_map.loop_vertical?    rect = Rect.new(dx, dy, dw, dh)    for viewport in [@viewport1, @viewport2, @viewport3]      viewport.rect = rect    end  end
    If you swap the positions, the max reso breaker doesn't work.
     
    Last edited by a moderator: Aug 23, 2014
    #99
  20. Kaelan

    Kaelan Veteran Veteran

    Messages:
    762
    Likes Received:
    441
    Location:
    Seattle, USA
    First Language:
    Portuguese
    Primarily Uses:
    N/A

Share This Page