[XP] Custom Resolution

Started by ForeverZer0, November 25, 2010, 03:28:40 am

Previous topic - Next topic

ForeverZer0

Oh, I see.
I did write the original Custom Resolution script for RGSS1, and I assume that comment was added since the script is used sometimes with the ACE engine and RMXP. I was thinking that there was a separate compatibility script out there that had my name on it, which I have not written.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Zexion

I'd like to ask a question about this script. It's an error that's really bugged me from the beginning, but is so small I never mentioned it. Why can't maps be default size? They always display half empty when I use default maps with a smaller resolution, but if I increase the size just one tile in any direction, it works fine o.o

KK20

Oh, nice find. I see what the problem is actually.

Recall that the tilemap is being drawn by a series of Bitmap objects. It uses 'blt' to draw the tiles onto it. This is how the layers are initialized.

@layers[i].bitmap = Bitmap.new($game_map.width*32, $game_map.height*32)

A map of 20 x 15 would return a bitmap of size 640 x 480. Now look at this:

class Bitmap
 
  alias zer0_resolution_resize_init initialize
  def initialize(width = 32, height = 32, override = false)
    if width.is_a?(String)
      # Call the filename if the first argument is a String.
      zer0_resolution_resize_init(width)
    elsif [width, height] == [640, 480] && !override                    #<========== Right there
      # Resize fullscreen bitmap unless explicitly overridden.
      zer0_resolution_resize_init(SCREEN[0], SCREEN[1])              #<===== And the cause of it all
    else
      # Call method normally.
      zer0_resolution_resize_init(width, height)
    end
  end
end

The bitmaps being used to draw the tilemap are being resized to your resolution's size, hence why you see nothing to the right and down on the map.

The fix is this:

@layers[i].bitmap = Bitmap.new($game_map.width*32, $game_map.height*32, true)

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

KK20

Updated at v0.96b. Thanks to LiTTleDRAgo for his Core Engine so that I can remove the dependency for screenshot.dll! :beer:

I still don't believe my Tilemap rewrite is truly finished, hence the beta. I also didn't bother to document the script much. Good luck trying to understand how the Tilemap rewrite works; it's really not that complicated though. Just think of it making 32x32 sprites for every tile that you can see and moving them one at a time to display what needs to be shown. I was actually pretty surprised how fast it runs, and my computer isn't anything special--no, really, it isn't.

Report issues and stuff. You know the drill by now. Edit at your own risk.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

LiTTleDRAgo

November 16, 2013, 12:48:44 pm #104 Last Edit: November 16, 2013, 12:58:23 pm by LiTTleDRAgo
it's quite a feat for normal project (almost no lagg detected)
haven't tested on heavy projects because lack of free time


by the way, can you remove this line in the script?

($imported ||= {})[:drg_core_engine] = 1.39


it will cause trouble if someone using any of my script that require the full version of my core engine
(although I wonder why you're copying almost half of it, when you're only need snap_to_bitmap method to remove screenshot.dll dependency?)

Zexion

Nice update @KK20. Also, thanks for that fix(?), I haven't tried it, but I will as soon as I can!

KK20

November 17, 2013, 12:31:31 am #106 Last Edit: November 17, 2013, 01:11:49 am by KK20
@Drago

Done. Thanks for pointing that out. I'd appreciate the testing :D
I tried removing as much as I could to get the snap_to_bitmap to work. I gave up removing one section, test, remove another, test, etc. Not sure what you mean by I only need the snap_to_bitmap method when it's not as easy as copy-pasting just the method itself. I guess I could make a rewrite of the method if that's what you mean.

@Zexion

Thanks :) Yeah, the fix works--I explained the logical reason behind it after all.

EDIT: Just realized I left a bunch of unnecessary code in the scripts (like debugging buttons and messages for testing purposes). They are removed.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

LiTTleDRAgo

November 17, 2013, 02:04:12 am #107 Last Edit: November 17, 2013, 05:30:41 pm by LiTTleDRAgo
Trimmed : *Link Removed*

also bug report:

KK20

Ah thanks for trimming it up :)

And fixed the bug that you mentioned. The three lines involving PreCacheData are never used, so I just deleted them.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

sekiraze

im gonna get crazy and ask for this:

http://www.rpgrevolution.com/forums/index.php?showtopic=51938

I almost fainted when i saw all these scripts inside.

KK20


Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

G_G

Probably wants the custom resolution in it. Iunno.

sekiraze

Quote from: gameus on December 25, 2013, 12:54:02 pm
Probably wants the custom resolution in it. Iunno.


only for the battle-scene where the fighters face off: i want to only use this part for my game.
sorry for being not precise enough!

KK20

Still confused. I don't see how Custom Resolution would even apply.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

sekiraze

nvm then, im a sleep deprived man. ideas come and go.

sekiraze

lets hope this is not considered spam;
but i have an idea! (ive actually slept !)

Since fullscreen mode does not work, ive been thinking and thinking. how about this:

you have to put in your Y and X-Pixel sice. Lets assume it is 1024x768. Lets also asume your Screen Size is 1600 by 900.
What if instead of streching the game window a black frame surrounds the game window for some sort of "cinematic" fullscreen?

sum thing like this:

Spoiler: ShowHide


i dunno, i had this idea playing SNES just couple of minutes ago. there is this module that allowes you to put in GB games inside.

Spoiler: ShowHide


cuz if you push the bumper you have a variaty of bg's to choose from, and also the black one surrounding errything :3

JUST AN IDEA!

KK20

I have considered doing that actually. I remember seeing a script elsewhere that did that.

One idea I also had was to change the computer's screen resolution to the game's resolution, provided such a resolution exists. Other than experimenting with DLL calls, I don't think I ever tried to see if this would ever be a viable solution.

Most likely I'll just do that black border thingy, but I still want to play with my other idea too.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

sekiraze

awaiting the awesome /o/ Can't wait!

PhoenixFire

Yeah, me too. Personally I would rather use this one instead of Kings, and the better it gets, the more I like it =)
Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

sekiraze

Quote from: DigitalSoul on December 28, 2013, 08:52:22 am
Yeah, me too. Personally I would rather use this one instead of Kings, and the better it gets, the more I like it =)


Kings? :o what does that mean?