Max Resolution Breaker

Perhaps try this and see if it fixes things Tsuki? Just a quick rewrite of Plane:

Spoiler
Code:
class Plane  attr_reader :ox, :oy  def initialize(viewport = nil)    @sprite = Sprite.new(viewport)    @bitmap = nil    @ox = 0    @oy = 0  end  def method_missing(symbol, *args)    @sprite.method(symbol).call(*args)  end  def bitmap=(bitmap)    @bitmap = bitmap    refresh  end  def ox=(ox)    w = @sprite.viewport != nil ? @sprite.viewport.rect.width : Graphics.width    @ox = ox % w    @sprite.ox = @ox  end  def oy=(oy)    h = @sprite.viewport != nil ? @sprite.viewport.rect.height : Graphics.height    @oy = oy % h    @sprite.oy = @oy  end  def refresh    return if @bitmap.nil?    w = @sprite.viewport != nil ? @sprite.viewport.rect.width : Graphics.width    h = @sprite.viewport != nil ? @sprite.viewport.rect.height : Graphics.height    if @sprite.bitmap != nil      @sprite.bitmap.dispose    end    @sprite.bitmap = Bitmap.new(w * 2, h * 2)       max_x = w / @bitmap.width    max_y = h / @bitmap.height    for x in 0..max_x      for y in 0..max_y        @sprite.bitmap.blt(x * @bitmap.width, y * @bitmap.height,         @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height))      end    end    for i in 1...4      x = i % 2 * w      y = i / 2 * h      @sprite.bitmap.blt(x, y, @sprite.bitmap, Rect.new(0, 0, w, h))    end  endend
It works, but it runs into disposed issues upon instantiation

plane = Plane.newp plane.disposed?So presumably however it's checking whether it's disposed or not is being set to false in the original initialization method.Throwing some more stuff at it works (like aliasing the initialize and calling it), but the bitmap itself will needs to be refined.

Currently it behaves as if the "loop horizontally" and "loop vertically" buttons have been checked.

Looping just means the image will scroll as you move, but it will repeat itself (so it might not look good).

Without looping, the ox and oy are adjusted in such a way that it will scroll slow enough so that it doesn't repeat itself.

All of the RTP parallaxes are 544x544, which means they won't scroll horizontally, but they will scroll vertically very slowly assuming no looping.

Here is the current script with the modified plane

http://pastebin.com/QJjeD5fV
With the parallax, there is just a little problem, and it is about the Z coord, as it doesn't updates 😛 (since now it creates a sprite inside the plane class that mimics the plane appearance).  So just overwritting the z= method would work (and the z method too, just in case).

  def z=(n)    @sprite.z = n  end  def z    @sprite.z  endHope this helps, salut,

OZ
Good catch. I've updated the paste.


http://pastebin.com/QJjeD5fV
Are there any further developments with this script?

It crashes for me no matter what, large main map size, Esever's modified DLL, without the DLL, brand new project etc. etc.

My project I'm working on this with is commercial, and it's a little embarassing to go "Oh yeah by the way your max resoultion is 640x480 even though most people run at least 1600x900 resolutions. What? "Why?" Because it just is."

I have no battles in the game, everything is done on the map, so hopefully the issues with battles you guys are having don't affect my game, however I would like to *at least* test this instead of my game just crashing 🙁

Quick note hime, there's no comments on the first parts of the code that should be commented, leading to errors.

Edit: Tested, seems to crash whenever something other than the default resolution is used. Because my other project was at 640x480 due to a modification in Main, it crashed on startup, likewise with the other project. In a brand new project without doing this, it works fine until Graphics.resize_screen(width, height) must be called, in which it crashes then.

Sigh... Why not just let ME change it Enterbrain? You shouldn't be the boss of who gets to decide if their game will run fine on somebody's PC or not. I'd just do the DLL change, but since it's a commercial project I can get sued up the wazoo.
I don't understand how the resizing works at all so I'm not able to give any suggestions.


Especially since it crashes on a new project.
I don't understand how the resizing works at all so I'm not able to give any suggestions.

Especially since it crashes on a new project.
I'm not sure what's gone on here if you're having this result. Without any .dll editing or anything the below script appears to work 100% except for transitions, parallax and battlescreens which can be worked around with further scripting

Below materials i inserted a new script and inserted

Spoiler
=begin#=============================================================================== Title: Unlimited Resolution Date: Oct 24, 2013-------------------------------------------------------------------------------- ** Change log Nov 6, 2013 - added some plane modifications to fix parallax images Oct 24, 2013 - Initial release-------------------------------------------------------------------------------- ** Terms of Use * Free-------------------------------------------------------------------------------- ** Description This script modifies Graphics.resize_screen to overcome the 640x480 limitation. It also includes some code to properly display maps that are smaller than the screen size. Now you can have arbitrarily large game resolutions. -------------------------------------------------------------------------------- ** Installation You should place this script above all custom scripts -------------------------------------------------------------------------------- ** Usage As usual, simply resize your screen using the script call Graphics.resize_screen(width, height)-------------------------------------------------------------------------------- ** Credits Unknown author for overcoming the 640x480 limitation Lantier, from RMW forums for posting the snippet above Esrever for handling the viewport Jet, for the custom Graphics code#================================================================================end$imported = {} if $imported.nil?$imported["TH_UnlimitedResolution"] = true#===============================================================================# ** Configuration#===============================================================================class << SceneManager alias resolution_run run def run(*args, &block) Graphics.ensure_sprite resolution_run(*args, &block) endendmodule Graphics @@super_sprite = Sprite.new @@super_sprite.z = (2 ** (0.size * 8 - 2) - 1) class << self alias :th_large_screen_resize_screen :resize_screen def freeze(*args, &block) @@super_sprite.bitmap = snap_to_bitmap end def transition(time = 10, filename = nil, vague = nil) if filename @@super_sprite.bitmap = Bitmap.new(filename) end @@super_sprite.opacity = 255 incs = 255.0 / time time.times do |i| @@super_sprite.opacity = 255.0 - incs * i Graphics.wait(1) end @@super_sprite.bitmap.dispose if @@super_sprite.bitmap reform_sprite_bitmap Graphics.brightness = 255 end def reform_sprite_bitmap @@super_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height) @@super_sprite.bitmap.fill_rect(@@super_sprite.bitmap.rect, Color.new(0, 0, 0, 255)) end def fadeout(frames) incs = 255.0 / frames frames.times do |i| i += 1 Graphics.brightness = 255 - incs * i Graphics.wait(1) end end def fadein(frames) incs = 255.0 / frames frames.times do |i| Graphics.brightness = incs * i Graphics.wait(1) end end def brightness=(i) @@super_sprite.opacity = 255.0 - i end def brightness 255 - @@super_sprite.opacity end def ensure_sprite if @@super_sprite.disposed? @@super_sprite = Sprite.new @@super_sprite.z = (2 ** (0.size * 8 - 2) - 1) reform_sprite_bitmap end end end #----------------------------------------------------------------------------- # Unknown Scripter. Copied from http://pastebin.com/sM2MNJZj #----------------------------------------------------------------------------- def self.resize_screen(width, height) wt, ht = width.divmod(32), height.divmod(32) #wt.last + ht.last == 0 || fail('Incorrect width or height') wh = -> w, h, off = 0 { [w + off, h + off].pack('l2').scan /.{4}/ } w, h = wh.(width, height) ww, hh = wh.(width, height, 32) www, hhh = wh.(wt.first.succ, ht.first.succ) base = 0x10000000 # fixed? mod = -> adr, val { DL::CPtr.new(base + adr)[0, val.size] = val } mod.(0x195F, "\x90" * 5) # ??? mod.(0x19A4, h) mod.(0x19A9, w) mod.(0x1A56, h) mod.(0x1A5B, w) mod.(0x20F6, w) mod.(0x20FF, w) mod.(0x2106, h) mod.(0x210F, h) # speed up y? #mod.(0x1C5E3, h) #mod.(0x1C5E8, w) zero = [0].pack ?l mod.(0x1C5E3, zero) mod.(0x1C5E8, zero) mod.(0x1F477, h) mod.(0x1F47C, w) mod.(0x211FF, hh) mod.(0x21204, ww) mod.(0x21D7D, hhh[0]) mod.(0x21E01, www[0]) mod.(0x10DEA8, h) mod.(0x10DEAD, w) mod.(0x10DEDF, h) mod.(0x10DEF0, w) mod.(0x10DF14, h) mod.(0x10DF18, w) mod.(0x10DF48, h) mod.(0x10DF4C, w) mod.(0x10E6A7, w) mod.(0x10E6C3, h) mod.(0x10EEA9, w) mod.(0x10EEB9, h) th_large_screen_resize_screen(width, height) endend#===============================================================================# Esrever's code from# http://www.rpgmakervxace.net/topic/100-any-chance-of-higher-resolution-or-larger-sprite-support/page-2#entry7997#===============================================================================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#-------------------------------------------------------------------------------# FenixFyre's custom Plane, simply drawing a sprite. Needs to do something about# the y-axis#-------------------------------------------------------------------------------class Plane attr_reader 😮x, 😮y alias :th_unlimited_resolution_initialize :initialize def initialize(viewport = nil) th_unlimited_resolution_initialize(viewport) @sprite = Sprite.new(viewport) @bitmap = nil @ox = 0 @oy = 0 end def method_missing(symbol, *args) @sprite.method(symbol).call(*args) end def bitmap=(bitmap) @bitmap = bitmap refresh end def bitmap @sprite.bitmap end def ox=(ox) w = @sprite.viewport != nil ? @sprite.viewport.rect.width : Graphics.width @ox = ox % w @sprite.ox = @ox end def oy=(oy) h = @sprite.viewport != nil ? @sprite.viewport.rect.height : Graphics.height @oy = oy % h @sprite.oy = @oy end def refresh return if @bitmap.nil? w = @sprite.viewport != nil ? @sprite.viewport.rect.width : Graphics.width h = @sprite.viewport != nil ? @sprite.viewport.rect.height : Graphics.height if @sprite.bitmap != nil @sprite.bitmap.dispose end @sprite.bitmap = Bitmap.new(w * 2, h * 2) max_x = w / @bitmap.width max_y = h / @bitmap.height for x in 0..max_x for y in 0..max_y @sprite.bitmap.blt(x * @bitmap.width, y * @bitmap.height, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height)) end end for i in 1...4 x = i % 2 * w y = i / 2 * h @sprite.bitmap.blt(x, y, @sprite.bitmap, Rect.new(0, 0, w, h)) end endend#==============================================================================# ■ 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
Then in main simply added in main

Graphics.resize_screen(1024,768)on the line before

rgss_main { SceneManager.run }seems to work just fine, but requires you to add new backgrounds/ graphics etc.

I fixed the battlescreen issue inserting the following script below materials

Spoiler
=begin================================================================================ Title: Battle Sprite Auto-position Author: Tsukihime Date: May 6, 2012-------------------------------------------------------------------------------- ** Change log 1.0 May 6, 2012 -Initial release-------------------------------------------------------------------------------- ** Terms of Use * Free to use in non-commercial projects * Contact me for commercial use * No real support. The script is provided as-is * Will do bug fixes, but no compatibility patches * Features may be requested but no guarantees, especially if it is non-trivial * Credits to Hime Works in your project * Preserve this header-------------------------------------------------------------------------------- ** Description This script adjusts the position that the battle sprites are drawn relative to the game screen size. This allows you to set your enemy positions in the troop editor without having to consider the size of your window (544x416 default vs sizes) -------------------------------------------------------------------------------- ** Installation In the script editor, place this script below Materials and above Main -------------------------------------------------------------------------------- ** Usage Plug-n-play ===============================================================================end$imported = {} if $imported.nil?$imported[:TH_BattleSpriteAutoPosition] = true#===============================================================================# ** Rest of the Script#=============================================================================== class Game_Troop < Game_Unit #-------------------------------------------------------------------------- # alias method #-------------------------------------------------------------------------- alias :th_sprite_autopos_setup :setup def setup(troop_id) th_sprite_autopos_setup(troop_id) adjust_coords end #-------------------------------------------------------------------------- # new method: adjust enemy battler coords #-------------------------------------------------------------------------- def adjust_coords adjust_x, adjust_y = (Graphics.width - 544) / 2, (Graphics.height - 416) @enemies.each do |enemy| enemy.screen_x += adjust_x enemy.screen_y += adjust_y end endend
Was using version rpg maker vx ace 1.01a
get_screen_width = Win32API.new("User32.dll","GetSystemMetrics",["L"],"L").call(0)get_screen_height = Win32API.new("User32.dll","GetSystemMetrics",["L"],"L").call(1)Graphics.resize_screen(get_screen_width, get_screen_height)Use that if you want to be 'always' full screen.

Edit:

You need to place it under the resolution script, of course. .-.

Edit:

Anyway, I found a new toy. : p

Gonna see what each mod does. Muahahaha xD
Does it work like the normal FS mode (same size map, just stretched to FS) or does it actually allow you to show a larger map?

You need to place it under the resolution script, of course. .-.
oh... and here I was hoping it works all alone
I got side tracked with other scripting.

But, I managed to spare some moment on learning #pack and #unpack while tweaking the 2nd argument for .mod

The mod argument consist of:

mod(16-bit, [size].pack('l')) #pack to the 32-bitThe following mode alter the screen resolution

mod.(0x20FF, w)mod.(0x2106, h)You can change w and h with:

[desired_width].pack('l')[desired_height].pack('l')These are the obvious mods though. : p

There are other hidden mods (other unique first agument) that I'm still playing around with. Haha, I'm soooo scripting blindfolded. xD

Looping the 16-base is a fun error ride, too. : p

Edit:

Took me awhile to understand what that unknown scripter is doing. I was blinded with by the width and height value that I totally missed the memory address thingy. Such a nice pointer locator he got there. : x
Hey, has anyone tried this with parallaxing?

It does some weird cloning effect to the images.
This script is kinda hackish since it's playing with pointer addresses, so to do the parallax, someone needs to find the pointer addresses for parallax x and y, then modify the resolution. : x

I'm done playing around with this script since I've understood what it's doing, and I'm not using parallax. : p

Regards for the unknown scripter. : x
can you enlighten us with that pointer thingy?
I'm a bit rusty at this, so if someone could give a better explanation, feel free to do so.

At first, you need to understand a bit of memory allocation. Basically, to manipulate data, we need to retrieve the data, and to retrieve the data, the data needs to be stored into memory. How does data stored into memory? Well, different language has different set of rules. The usually would be by bytes. char takes 1 byte (256 characters, 1 bit / character), int takes 4 bytes. Array is stored uniformly. Array of 5 chars would have memory of A, A + 1, A + 2, A + 3, A + 4. : x

Anyway, enough intro lol.

The pointer manipulation in the script is basically started on this line:

(I was taken aback a bit by the archaic operator)

mod = -> adr, val { DL::CPtr.new(base + adr)[0, val.size] = val }Where DL::Cptr

http://ruby-doc.org/stdlib-1.9.3/libdoc/dl/rdoc/DL/CPtr.html

And

DL

http://www.ruby-doc.org/stdlib-1.9.3/libdoc/dl/rdoc/DL.html

And so, on this line:

mod.(0x19A4, h) Basically, it goes to the address on argument 1, and either rewrite or fill the value of that address with argument 2.

 DL::Cptr.new(base + 0x19A4) # return pointer to address (base + 0x19A4), let's call it pointer_A

And then:

pointer_A[0, h.size] = h # sets value from 0 to h.size to h => not sure why it has to be in length, probably it's how big the RM object size.

This following line is a bit funny to me,

base = 0x10000000 # fixed?It seems window OS will set base memory address for RM on fixed location. I found it funny because the unknown scripter is kinda saying, "it has fixed address? Oh cool, then".

And how does setting/overwriting value of the memory address will change the game? Well, it because the game runs by manipulating data by retrieving data that is stored in the memory. If the data that is stored in the memory changed, the game will change accordingly. And this unknown script knows which memory address RM is using to retrieve the window size. How does he find those pointer? Ask that person. I would say he has a good debugger that he attached to RM. : x
ah... so basically since RM won't allow you to go past a certain size if you used it's methods, you then go directly modifying the size saved in memory? pretty neat
Ya, seems like RM put bunch of limiters on 640 x 480. And that unknown scripter basically found some of those limiters' addresses. : x

Someone needs to find the limiter for paralax and others. Maybe we could get another 'hex' script at pastebin by a random scripter. : p
That would be cool.

It also crashes in battles when you kill an enemy(but maybe it's just me.)

It would be great to have higher resolution even to just have HD facesets and busts....

My character designer's illustrations lose half of their magic when resized...

Do you think that if people worked on this they could make it 100% possible to use?
Yes, but it requires specialized knowledge.


I don't know how to use debuggers properly or read assembler.


Honestly I would just use a modified DLL that takes away the limitations rather than trying to force your way around the limitations.
but isn't that againist the rules?
Yeah both is against the EULA (in order to use a debugger you have to remove the anti-debug in the dll first, most of the time).


A better solution would be simply using an engine that suits your game's actual needs instead of fiddling around with memory for a mediocre, semi-bugged compromise.

Original thread: https://forums.rpgmakerweb.com/threads/max-resolution-breaker.19336/