Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Looking for a resolution script [XP]

Jason

Awesome Bro

Hey, so I'm just messing around with things at the moment, trying to get all the systems down for a project I actually want to finish (I've actually put planning into this one!), but I'd like to see the game in a widescreen window (To be more specific 960x540), however I'm having a problem...

I can't find any resolution scripts that lock your character into the middle of the screen, I've only tried two, but neither of them have nailed it properly, you have to walk to the edge of the screen in order to make the map scroll, whereas I'd like it to function like the default window where the map will scroll while you're in the middle of the screen, y'know?

Does anyone know of any that exist? I know there's one or two that exist since I used one like two years ago, but it's on my dead PC and I can't remember who it was by or what they even called it, but it worked fine...

If nobody can find what I'm after, then I guess I could request a script that forces the resolution into 960x540 and keeps the player centered... but I'm not sure how much effort or trouble that would require, so if it can't be found, then I guess I'll just not use one, although it'd be nice.
 

Jason

Awesome Bro

Hmm, it seems like a lot of fiddling around, not to mention the guy in the demo says there are issues with windows bigger than the default 640x480 where tiles don't show properly, and anything with a priority over 2 doesn't get shown either... so I don't think it'll work too well, unless I'm wrong somewhere, lol.
 
Yea, that script does have a couple problems that will probably be fixed in the next versions or so. For now though, in the demo it said that if you need a bigger resolution, just use Selwyn's Window Resolution by itself. It's on the same topic from the link I gave you.
 

Jason

Awesome Bro

Yeah I've got that now, however, I can't seem to configure it to do anything, the resolution still remains at 640x480... infact, I can't really see anywhere to configure it, except it says in fullscreen the resolution will be 800x600 but when I try that, it just does nothing...

Code:
 

#==============================================================================

# Resolution Script

#------------------------------------------------------------------------------

# Script by Selwyn

#==============================================================================

 

module Resolution

  #--------------------------------------------------------------------------

  attr_reader :state

  #--------------------------------------------------------------------------

  def initialize

    title = "\0" * 256

    Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L').call("Game", "Title", "", title, 256, ".\\Game.ini")

    title.delete!("\0")

    @set_resolution  = Win32API.new('Display.dll', 'SetResolution', 'III', 'I')

    @set_window_long = Win32API.new('user32', 'SetWindowLong', 'LIL', 'L')

    @set_window_pos  = Win32API.new('user32', 'SetWindowPos', 'LLIIIII', 'I')

    @gsm             = Win32API.new('user32', 'GetSystemMetrics', 'I', 'I')

    @gcr             = Win32API.new('user32', 'GetClientRect', 'LP', 'I')

    @kbe             = Win32API.new('user32', 'keybd_event', 'LLLL', '')

    @gaks            = Win32API.new('user32', 'GetAsyncKeyState', 'L', 'I')

    @window = Win32API.new('user32', 'FindWindow', 'PP', 'I').call("RGSS Player", title)

    @default_size = size

    #if size[0] < 800 or size[1] < 600

    #  print("A minimum screen resolution of [800 by 600] is required in order to play #{title}")

    #  exit

    #end

    @state = "default"

    self.default

  end

  #--------------------------------------------------------------------------

  def fullscreen

    @default_size = size

    @set_window_long.call(@window, -16, 0x14000000)

    @set_window_pos.call(@window, -1, 0, 0, 802, 602, 64)

    @set_resolution.call(800, 600, 4)

    @state = "fullscreen"

  end

  #--------------------------------------------------------------------------

  def default

    x = @default_size[0] / 2 - 403

    y = @default_size[1] / 2 - 316

    @set_window_long.call(@window, -16, 0x14CA0000)

    @set_window_pos.call(@window, 0, x, y, 808, 627, 0)

    @set_resolution.call(@default_size[0], @default_size[1], 0)

    @state = "default"

  end

  #--------------------------------------------------------------------------

  def trigger?(key)

    return @gaks.call(key) & 0x01 == 1

  end

  #--------------------------------------------------------------------------

  private :fullscreen

  private :default

  private :trigger?

  #--------------------------------------------------------------------------

  def size

    width = @gsm.call(0)

    height = @gsm.call(1)

    return width, height

  end

  #--------------------------------------------------------------------------

  def change

    if @state == "default"

      self.fullscreen

    else

      self.default

    end

  end

  #--------------------------------------------------------------------------

  def update

    if trigger?(121)

      self.default

      exit

    end

    if Input.trigger?(Input::ALT) or Input.press?(Input::ALT)

      @kbe.call(18, 0, 2, 0)

    end

  end

  #--------------------------------------------------------------------------

  module_function :initialize

  module_function :fullscreen

  module_function :default

  module_function :trigger?

  module_function :size

  module_function :change

  module_function :update

  #--------------------------------------------------------------------------

end

 

There's the code for reference... what can I do with it lol (God this is making me feel dumb :P)
 
As for my script - as mentioned in the thread - it's mainly intended for resolutions lower than the default. It shouldn't be much of a hazzle as long as that's what you're trying to do, as my script's purpose is to do the work for you... but yeah, it won't work with resolutions above the default too well, or at least not until you replace the Tilemap version with Seph's newest one (or another that supports higher than 640x480 resolutions). Then it should work, but seriously, if you want to enlarge it, you're better off using just Selwyns script and going from there.
Also, I don't work on my XP scripts anymore, so there won't be a new version, or anything else other than the suggestion to not use it anymore ;o

As for Selwyn's script... if it doesn'T do anything, you probably never copied the Display.dll in your game directory, did you?
In case you did that, note that you need to initialize the Resolution class first, and update it from every scene. You can see how exactly by looking at my demo, or the original thread (that also has the original script - the one you posted is my version, which should be just a cleaned up one, but I might've modified something that I don't remember... :/ ). Seeing that makes me wonder if people didn't come up with a better resolution script by now, as looking at Selwyn's, there's quite a load of room for improvement...
 

Jason

Awesome Bro

Yeah I have the display.dll added lol...

I just remember a script a while back where all you did was type the resolution you wanted, and how many tiles high and wide, and that was it, it worked perfectly with every resolution I tried too, but it was like 2 years ago and I have no idea what happened to it or who it was by... it's on my dead computer so I can't get it back either, lol...
 

Jason

Awesome Bro

Okay so I've tried the Resolution.initialize thing, and the screen goes bigger now, however I'm having a problem, the playable area is still only 640x480 and in the top left corner, not to mention the framerate is dipping furiously between the mid units (5-8FPS) and the mid 20's range, whereas without the script it runs at a solid 40FPS...

Is there something else I have to do too?
 
Well, as for the 640x480 issue - that's what I addressed in the Q&A in my thread - the default tilemap only displays that range, so unless you get another Tilemap (that's newer than the one in my script thread), you're stuck with that. Well, note that changing the values in Spriteset_Map and Spriteset_Battle is required as well, but it won't solve your problem entirely (such as for the cut-off trees).
 

Jason

Awesome Bro

960x540.PNG

Yeah the mapping is bad shush it was just a test, lol.

I found a script that was extremely easy to use, just copy the .dll into your directory, paste the script and change the resolution... it does everything else for you, and works fine so far.

Here's a link to the script:
http://www.rmxpunlimited.net/forums/top ... esolution/

There's also a thread on the site with compatibility scripts which is always nice:
http://www.rmxpunlimited.net/forums/top ... pid__60645
 

Jason

Awesome Bro

Yeah but the only problem I've ran into is that even without events on my maps the FPS drops down to around 30, but maybe something could be done to fix that, I'm not quite sure...
 
What about my script?
Link is in my signature...

When I tested it on my system, (win7 64bit, quad core) and on my son's system (pentium 4 256 mb ram) the fps only dropped when running transitions other than default fade, but not by much.
 

Jason

Awesome Bro

Hmm, so I've just tried yours, I love the idea of being able to switch to multiple resolutions (Although this will only be good if you scale the scenes and windows around it too), unfortunately using your script my FPS went even lower, into the low 20's while playing...
 

Ares

Member

game_guy":18vcue7n said:
Jbrist":18vcue7n said:
960x540.PNG

Yeah the mapping is bad shush it was just a test, lol.

I found a script that was extremely easy to use, just copy the .dll into your directory, paste the script and change the resolution... it does everything else for you, and works fine so far.

Here's a link to the script:
http://www.rmxpunlimited.net/forums/top ... esolution/

There's also a thread on the site with compatibility scripts which is always nice:
http://www.rmxpunlimited.net/forums/top ... pid__60645
It was already posted ;D
But that is indeed a nice script, I am using it now, as I had the same problem. The only downside is that instead of 40 FPS it drops to ~19-22. I am going to have to find a way around that. What a shame that the ARGSS isn't finished yet, 'cause there you can set the resolution in the game.ini file.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top