Introduction
I've been tinkering with manipulating the size of the available gaming area for RPGMaker XP games. This is essentially the barebones system that allows me to do so, all without the need of a DLL outside Win32 manipulations.
For this, I have combined a collection of scripts known as 'Hidden Class' rewrites into one, and added a few touches to allow them to go beyond their original limitations.
However, it is not a complete system. You will need a Tilemap script in order to fill the space left vacant when increasing the screen size beyond the default 640x480 size, or to accommodate any map when the game screen is smaller than normal.
The Game.Exe's Fullscreen mode reverts to a fixed 640x480 resolution so the [ALT]+[ENTER] key combination is disabled. Fullscreen mode is literally disabled by intent with this setup.
Screenshots
None.
Demo BOX.COM LINKLook for the Download link in the top right of the screen
Script
Instruction/Header
Code:
#==============================================================================
# ** SCREEN SIZE for RMXP
#------------------------------------------------------------------------------
# Version 1.0
# By DerVVulfman
# 02-21-2025 (MM-DD-YYYY)
# RGSS / RPGMaker XP
#==============================================================================
# > INTRODUCTION AND HEADER PAGE <
#==============================================================================
#
# INTRODUCTION:
# =============
# I've been tinkering with manipulating the size of the available gaming area
# for RPGMaker XP games. This is essentially the barebones system that allows
# me to do so, all without the need of a DLL outside Win32 manipulations.
#
# For this, I have combined a collection of scripts known as 'Hidden Class'
# rewrites into one, and added a few touches to allow them to go beyond their
# original limitations.
#
# However, it is not a complete system. You will need a Tilemap script in
# order to fill the space left vacant when increasing the screen size beyond
# the default 640x480 size, or to accommodate any map when the game screen is
# smaller than normal.
#
# ALERT: The Game.Exe's Fullscreen mode reverts to a fixed 640x480 resolution
# so the [ALT]+[ENTER] key combination is disabled. Fullscreen mode is
# literally disabled by intent with this setup.
#
#
# ------------------------------------------------------------------------
#
# INSTALLATION:
# =============
# This script requires methods from the RMXP SDK v 2.3 or higher. Ergo, this
# script needs to be placed below the RMXP SDK, or any collection of needed
# SDK classes thereof.
#
# RMXP SDK Methods manipulated:
# * Spriteset_Map.init_viewports * Spriteset_Battle.init_viewport
#
#
# ------------------------------------------------------------------------
#
# INSTRUCTIONS:
# =============
# I would hope this is clear. It is mostly plug-and-play, only requiring you
# to set some configurable values within the ScrnSize module at the very top
# of the actual system code. And all the variable options have detailed des-
# criptions of what is being set.
#
# This script requires methods from the RMXP SDK v 2.3 or higher. Ergo, this
#
#
# ------------------------------------------------------------------------
#
# SYSTEMS USED:
# =============
# As stated within the introduction, this is a collection of scripts manupu-
# lated to go beyond their original expectations. Most of those within the
# the engine are Hidden Class scripts, scripts that were designed to simulate
# or replace classes built into the RPGMaker game.exe itself.
#
# Below is a list of the scripts put to use:
#
# I would hope this is clear. It is mostly plug-and-play, only requiring you
#
# * Resolution
# ----------
# Selwyn's classic script to redefine the size of the gaming screen. It has
# been altered to no longer require the Display.DLL and a fixed 800x600 size.
#
# * Plane
# -----
# The plane class is a hidden class within RPGMaker engines where content is
# drawn. Selwyn created his Plane class script that allows more control over
# the drawing area, and it has been edited to use the values defined here.
#
# * RPG::Weather
# ------------
# This is an edit of the update method in the default RPG::Weather class. It
# is very light (only the bottom section being altered) and with good amount
# of comments. So if you follow the comments given, adding a custom weather
# script should be no problem.
#
# Again notee that the code for the RPG::Weather has extensive notes within
# for anyone adapting their own weather script in place. This would be the
# only hidden class script I would change given the number of replacements.
#
# * Spriteset_Map
# -------------
# First, the structure of both the initialize and update methods HAVE been
# heavily changed. They have, in fact, been broken into smaller methods as
# defined by the 2007 era RPGMaker SDK. So SDK scripts would have no issue
# with this system, and normal uses likewise would not. Apart from that,
# the actual changes made involve redefining the 'viewports' of the screen
# to accommodate the window resolutions.
#
# * Spriteset_Battle
# ----------------
# First, the structure of both the initialize and update methods HAVE been
# heavily changed. They have, in fact, been broken into smaller methods as
# defined by the 2007 era RPGMaker SDK. So SDK scripts would have no issue
# with this system, and normal uses likewise would not. Apart from that,
# the actual changes made involve redefining the 'viewports' of the screen
# to accommodate the window resolutions.
#
#
#==============================================================================
#
# COMPATABILITY:
# ==============
# Designed for RPGMaker XP. Requires the RMXP SDK or a noted collection of
# scripts from within.
#
#
#==============================================================================
#
# TERMS and CONDITIONS:
# =====================
# Free for use, even in commercial scripts. However, I require due credit for
# myself and Selwyn who orchestrated most of the Hidden Class scriptwork.
#
#
#==============================================================================
Engine
Code:
#==============================================================================
# ** SCREEN SIZE for RMXP
#------------------------------------------------------------------------------
# Version 1.0
# By DerVVulfman
# 02-21-2025 (MM-DD-YYYY)
# RGSS / RPGMaker XP
#==============================================================================
# > CONFIGURATION AND ENGINE PAGE <
#==============================================================================
#==============================================================================
# ** ScrnSize
#------------------------------------------------------------------------------
# This module handles the adjustable screen size for games that utilize
# resolution scripts to alter game window dimensions.
#==============================================================================
module ScrnSize
# GAME SCREEN RESOLUTION
# ======================
# The absolute necessity... defining the size of the visible area of your
# game on the screen. You will see below some dimensions tested, and then
# commented out. Even reducing the size to older RPGMaker 2000 scale exe-
# cuted just fine.
# < -- IT IS RECOMMENDED THAT THE DEFINED VALUES BE MULTIPLES OF 32! -- >
# -----------------------------------------------------------------------
#
Width = 1280 # Screen area width in pixels
Height = 736 # Screen area height in pixels.
# Width = 640
# Height = 480
# Width = 320
# Height = 200
# BATTLE SCREEN SIZE
# ==================
# -----------------------------------------------------------------------
# A secondary requirement, this value defines the depth of the default
# battlesystem's main viewport. Defined as Viewport 1, it is where all of
# the enemies appear, where weather effects take place, and screen tone
# and shake effects are rendered.
# -----------------------------------------------------------------------
#
BattleHeight = 320 # Battle screen area height in pixels.
# GAME INI NAMING
# ===============
# A necessity if you are renaming the Game Executable (eg Game.exe). When
# your game/project is run, it looks for its requisite .ini file which it
# assumes to have the same name as its executable. Many leave the name of
# the executable alone. But if you choose to rename Game.exe to Trek.exe,
# it will search for Trek.ini. And if the assumed ini does not exist, the
# game will fail.
#
# The resolution changing system relies upon retriving the windows handle
# for the game when it executes. And for this, it needs the current name
# of the Game's INI file. So if you do change the name of the executable
# (and thus the name of the INI), it needs the name defined below.
# -----------------------------------------------------------------------
#
INI_Name = 'Game.ini'
# GAME EXECUTION SPEED
# ====================
# This is an old trick, changing the speed of the executable to make the
# game itself run faster. RPGMaker XP was set to a default 40 frames per
# second while RPGMaker VX and VXAce to a native 60 frames per second.
#
# -----------------------------------------------------------------------
# Changing this value affects all... script/code speed, character speed
# in the fieldmap, battle animations, and the like. RAMGE (10-120)
# NOTE: Smooth mode refreshes graphics ever frame based on this value.
# Normal mode only refreshes every other frame.
# -----------------------------------------------------------------------
#
Graphics.frame_rate = 40
end
#==============================================================================
# ** Resolution
#------------------------------------------------------------------------------
# This module uses the Win32API to connect to the RPGMaker XP game window and
# re-sizes the window based on the game developer's preferences.
#==============================================================================
# Render message and exit if size is not supported
# ================================================
@default_size = self.size
if size[0] < @reswidth or size[1] < @resheight
print("\"#{title}\" requires a minimum screen resolution " +
"of [#{@reswidth} x #{@resheight}]\r\n\r\n" +
"\tYour Resolution: [#{@default_size[0]} x #{@default_size[1]}]")
exit
end
#--------------------------------------------------------------------------
# ● change
#--------------------------------------------------------------------------
def change
#
if @state == "default"
self.fullscreen
else
self.default
end
#
end
#--------------------------------------------------------------------------
# ● update
#--------------------------------------------------------------------------
def update
#
if trigger?(121) # F10
self.change
end
if Input.trigger?(Input::ALT) or Input.press?(Input::ALT)
@kbe.call(18, 0, 2, 0)
end
#
end
#==============================================================================
# ** Input
#------------------------------------------------------------------------------
# A class that handles input data from a gamepad or keyboard.
#==============================================================================
class << Input
#--------------------------------------------------------------------------
# * Alias Listings (with F12 Stack prevention)
#--------------------------------------------------------------------------
alias res_update update unless $@
#--------------------------------------------------------------------------
# * Input.update
#--------------------------------------------------------------------------
def Input.update
# Perform the original call
res_update
# Update the Resolution
Resolution.update
end
end
# Execute at start
Resolution.initialize
#==============================================================================
# ** Plane
#------------------------------------------------------------------------------
# The Plane class. Planes are special sprites that tile bitmap patterns across
# the entire screen, and are used to display panoramas and fog.
#==============================================================================
class Plane < Sprite
# Redefine methods dealing with coordinates (defined in super) to do nothing.
def x; end
def y; end
def x=(x); end
def y=(y); end
#--------------------------------------------------------------------------
# * Z Depth
# z : z-depth
#--------------------------------------------------------------------------
def z=(z)
#
# Change the Z value of the viewport, not the sprite.
super(z * 1000)
#
end
#--------------------------------------------------------------------------
# * Origin - X Coordinates
# ox : x origin
#--------------------------------------------------------------------------
def ox=(ox)
#
# Exit if there is no valid bitmap
return if @bitmap.nil?
# Have viewport stay in loop on X-axis.
super(ox % @bitmap.width)
#
end
#--------------------------------------------------------------------------
# * Origin - Y Coordinates
# oy : y origin
#--------------------------------------------------------------------------
def oy=(oy)
#
# Exit if there is no valid bitmap
return if @bitmap.nil?
# Have viewport stay in loop on Y-axis.
super(oy % @bitmap.height)
#
end
#--------------------------------------------------------------------------
# * Get / Return Bitmap image before tiling
#--------------------------------------------------------------------------
def bitmap
#
# Return the single bitmap, before it was tiled.
return @bitmap
#
end
#--------------------------------------------------------------------------
# * Set Bitmap to be tiled in the plane
#--------------------------------------------------------------------------
def bitmap=(tile)
#
# Create/assign the bitmap
@bitmap = tile
#
# Calculate the number of tiles it takes to span screen in both directions.
xx = 1 + (ScrnSize::Width.to_f / tile.width).ceil
yy = 1 + (ScrnSize::Height.to_f / tile.height).ceil
#
# Create appropriately sized bitmap, then tile across it with source image.
plane = Bitmap.new(@bitmap.width * xx, @bitmap.height * yy)
#
# Cycle through screen parameters and blit the bitmap in place
(0..xx).each {|x| (0..yy).each {|y|
plane.blt(x * @bitmap.width, y * @bitmap.height, @bitmap, @bitmap.rect)
}}
#
# Set the bitmap to the sprite through its super class (Sprite).
super(plane)
#
end
end
#==============================================================================
# ** RPG
#------------------------------------------------------------------------------
# A module containing RPGXP's data structures and more.
#==============================================================================
module RPG
#============================================================================
# ** Weather
#----------------------------------------------------------------------------
# Class for weather effects (rain, storm, snow) displayed via RPGXP's
# Event command.
#============================================================================
class Weather
#------------------------------------------------------------------------
# * Frame update
#------------------------------------------------------------------------
def update
#Alteration notes:
#--------------------------------------------------------------------
# The original placement and opacity determining code at the bottom
# of the method was as below:
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# if sprite.opacity < 64 or
# x < -50 or x > 750 or
# y < -300 or y > 500
# sprite.x = rand(800) - 50 + @ox
# sprite.y = rand(800) - 200 + @oy
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# It took some time to determine the randomized 0-800 range for the
# sprite.x and sprite.y values knowing they were meant to be based
# on the 640x480 window. Eventually, I was able to discern how the
# calculations were made, and developed the following 4 temp values:
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# xrand = 640 + 160 # 800
# yrand = 480 + 320 # 800
# xstop = xrand - 50 # 750
# ystop = yrand - 300 # 500
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# This allows for weather objects to be generated outside of the
# game's defined window and move into view, all while it takes into
# account for window scrolling.
#
# All changes are at the very bottom where the opacity/visibility
# of the sprites are determined.
#--------------------------------------------------------------------
return if @type == 0
for i in 1..@max
sprite = @sprites[i]
break if sprite == nil
# Rain
if @type == 1
sprite.x -= 2
sprite.y += 16
sprite.opacity -= 8
end
# Storm
if @type == 2
sprite.x -= 8
sprite.y += 16
sprite.opacity -= 12
end
# Snow
if @type == 3
sprite.x -= 2
sprite.y += 8
sprite.opacity -= 8
end
# Sprite position tracking for opacity test below
x = sprite.x - @ox
y = sprite.y - @oy
#------------------------------------------------------------------
# Edited Content:
#------------------------------------------------------------------
#
# Base ranges upon resolution size
xrand = ScrnSize::Width + 160
yrand = ScrnSize::Height + 320
xstop = xrand - 50
ystop = yrand - 300
#
# move sprite position and set opacity only if within position
if sprite.opacity < 64 or
x < -50 or x > xstop or # <- xstop instead of 750
y < -300 or y > ystop # <- ystop instead of 500
sprite.x = rand(xrand) + 50 + @ox # <- xrand instead of 800
sprite.y = rand(yrand) - 200 + @oy # " "
sprite.opacity = 255
end
#------------------------------------------------------------------
end
end
end
end
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc.
# It's used within the Scene_Map class.
#==============================================================================
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
# This class brings together battle screen sprites. It's used within
# the Scene_Battle class.
#==============================================================================
#==============================================================================
# ** FIXED OVERLAYS
#------------------------------------------------------------------------------
# Version 1.0
# By DerVVulfman
# 02-21-2025 (MM-DD-YYYY)
# RGSS / RPGMaker XP
#==============================================================================
#
# INTRODUCTION:
# =============
# This is actually more of an option given someone requested the ability
# to use the map panoramas be used as the actual fieldmap rather than the
# need for tiles.
#
# This allows the game developer to disable the odd scrolling options of
# the panorama background and/or the fog display and have their positions
# be fixed in relation to the map. What happens if they are enabled???
#
# Panorama backgrounds do not have any subtle scrolling affect like fogs
# and will adjust and visibly scroll as any tileset terrain background.
#
# While fogs have vertical and horizontal scrolling options to simulate
# wind intensity, the fog will not outwardly have an odd shift when the
# map shifts due to player movement.
#
#
# INSTALLATION:
# =============
# This script requires methods from the RMXP SDK v 2.3 or higher. Ergo, this
# script needs to be placed below the RMXP SDK, or any collection of needed
# SDK classes thereof.
#
# RMXP SDK Methods manipulated:
# * Spriteset_Map.update_panorama_plane * Spriteset_Map.update_fog_plane
#
#
# INSTRUCTIONS:
# =============
# Very simple. Any map that needs its Fog or Panorama 'fixed' in place
# is to have its ID added into either the FOG and/or PANORAMA array in
# the Fixed_Overlays module.
#
#
#==============================================================================
#
# COMPATABILITY:
# ==============
# Designed for RPGMaker XP. Requires the RMXP SDK or a noted collection of
# scripts from within.
#
#
#==============================================================================
#
# TERMS and CONDITIONS:
# =====================
# Free for use, even in commercial scripts. But due credit is required.
#
#
#==============================================================================
#==============================================================================
# ** Fixed_Overlays
#------------------------------------------------------------------------------
# This module holds the IDs of maps that have fixed panoramas and fogs.
#==============================================================================
module Fixed_Overlays
PANORAMA = [1] # IDs of maps where the panorama is fixed
FOGS = [] # IDs of maps where the fogs are fixed
end
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles the map. It includes scrolling and passable determining
# functions. Refer to "$game_map" for the instance of this class.
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :parallax_fixed # flag if parallax map is fixed
attr_accessor :fog_fixed # flag if parallax map is fixed
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias game_map_fixed_overlays_setup_tileset setup_tileset
#--------------------------------------------------------------------------
# * Setup Tileset
#--------------------------------------------------------------------------
def setup_tileset
#
# Perform the original method
game_map_fixed_overlays_setup_tileset
#
# Set values based on whether or not they are defined
@parallax_fixed = (Fixed_Overlays::PANORAMA.include?(@map_id))
@fog_fixed = (Fixed_Overlays::FOGS.include?(@map_id))
#
#
end
end
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc.
# It's used within the Scene_Map class.
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Update Panorama Plane
#--------------------------------------------------------------------------
def update_panorama_plane
#
# Update panorama scrolling or position fixed relative to player/camer
if $game_map.parallax_fixed
@panorama.ox = $game_map.display_x / 4
@panorama.oy = $game_map.display_y / 4
else
@panorama.ox = $game_map.display_x / 8
@panorama.oy = $game_map.display_y / 8
end
#
end
#--------------------------------------------------------------------------
# * Update Fog Plane
#--------------------------------------------------------------------------
def update_fog_plane
#
# Update fog zoom factor
@fog.zoom_x = $game_map.fog_zoom / 100.0
@fog.zoom_y = $game_map.fog_zoom / 100.0
#
# Update fog opacity and blending
@fog.opacity = $game_map.fog_opacity
@fog.blend_type = $game_map.fog_blend_type
#
# Update fog scrolling or position fixed relative to player/camer
if $game_map.fog_fixed
@fog.ox = $game_map.display_x / 8 + $game_map.fog_ox
@fog.oy = $game_map.display_y / 8 + $game_map.fog_oy
else
@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
end
#
# Update fog tone relative to screen
@fog.tone = $game_map.fog_tone
#
end
Compatibility
Designed for RPGMaker XP
Will require the RMXP SDK or a collection of SDK Methods (included in the demo)
Credits and Thanks
Thanks to Selwyn who worked on the original Resolution and Plane Hidden Class scripts.
Terms and Conditions
Free for use, even in commercial scripts. However, I require due credit for myself and Selwyn who orchestrated most of the Hidden Class scriptwork.