I'd like to play Cave Story in a small-ish window taking up about 1/4-1/2 of my screen. In the options I set it to window, and the screen scaling to "sharp" which appears to give me the approximate play size I want. Only one problem: the window is still taking up the whole screen, just now it's blank borders. I'd like to remove these border areas.
How can I change the window size of Cave Story+?
Best Answer
I know this post is three years old, but in case someone else ends up here who is looking for an answer, please see my post on the Steam forums.
I took some time to copy/paste my original thread from the Steam forums and format it for stack exchange:
The default window size of Cave Story+ is way too big (in my opinion), and even though it can be manually resized by clicking and dragging, I'd rather not mess with that.
Disclaimer: I'm working with a monitor resolution of 2560x1440, so this may or may not work well for users on lower resolutions (e.g., 1920x1080). However, you can experiment with the x/y values of the window size, and also setting the game to "stretch" instead of "sharp" to see if that makes any difference.
To that end, I have been working on figuring out a way to have the window automatically resize to specified parameters. I believe that I have a couple decent solutions; you can choose between AutoHotkey and NirCmd methods (I prefer AutoHotkey because it seems to work better with process names when defining window sizes).
With AutoHotkey (easiest method)
Download my pre-compiled AutoHotkey executable
Place Cave Story+ (Window Mode).exe in steamapps\common\Cave Story+ directory
Skip to the bottom section, "To add as a Non-Steam game"
With AutoHotkey (manual method)
Download/install AutoHotkey
Start Cave Story+ and access the game options menu
Change Screen Type to Window
Change Screen Scaling to Sharp
Close Cave Story+
Navigate to the Cave Story+ directory in steamapps\common
Right-click / New / AutoHotkey Script called "Cave Story+ (Window Mode)" (without quotes)
Open the script in notepad and paste the following:
Save the script
Either run the script directly (or create a shortcut to it), or, you can add it as a Non-Steam game (see below)
WithNirCMD
Start Cave Story+ and access the game options menu
Change Screen Type to Window
Change Screen Scaling to Sharp
Close Cave Story+
Navigate to the Cave Story+ directory in steamapps\common
Right-click / New / Text Document called "Cave Story+ window mode" (without quotes)
Open the text file and paste the following:
Save the document as a batch file (File / Save As then add .bat at the end of the file name; e.g.: Cave Story+ window mode.bat
Download NirCmd (scroll to the bottom of the page)
Unzip nircmd.exe into the Cave Story+ folder (you only need the one file, nircmd.exe)
To add as a Non-Steam game (launch from within Steam)
Open Steam, go to the Library
Click "+ ADD A GAME..." at the bottom-left of the screen
Choose "Add a Non-Steam Game..."
Click "Browse"
Navigate to the Cave Story+ folder and choose Cave Story+ (Window Mode).exe (if using my pre-compiled executable), or CaveStory+.exe if using AutoHotkey manual method or NirCmd method
Click "Add Selected Programs"
If you are using my pre-compiled executable, you are done at this point. You should be able to launch Cave Story+ (Window Mode) from your Steam library. If using one of the other two methods, continue on:
In the Library, right-click on the duplicate CaveStory+ entry (will have the space removed) and choose "Properties".
Change the name to something meaningful, like "Cave Story+ (Windowed)" or something similar
Click "Change"
Change File Type to "All Files (.)"
Choose "Cave Story+ window mode.ahk" if using AutoHotkey, or "Cave Story+ window mode.bat" if using NirCMD (note: you can also compile the AutoHotkey script you made so that you have .exe instead of .ahk, but this doesn't really matter)
Click "Open"
Click "Close"
Now you can launch Cave Story+ from your Steam library with a custom window size. To change the window size, edit the batch file you created and change the two numbers at the end of this line:
1296 represents x size whereas 955 represents y size. Cave Story+ runs at an odd aspect ratio of 1.296, so keep that in mind if you change the window size, as different aspect ratios will result in black bars on the image. Other window sizes of this aspect ratio include:
656 503 1296 955 1616 1184
Using these numbers will give you an image without black borders, but you can experiment with different resolutions if you want.
Also, if for some reason the game window is not resizing properly, try increasing the 3000 value (in either the AHK or NirCmd scripts) to 4000 or 5000:
To automatically center windows using SDL environment variable
This is something you can do which will make the process of centering the window a little bit smoother. My scripts will automatically center the window, but adding this environment variable will ever-so-slightly speed up the process. It will affect all windows using SDL (not just Cave Story+) as it involves adding an environment variable. The easiest way to do this is as follows:
Create a new text document
Open it and paste the following:
Save this document as a .bat file (batch file)
Double-click the file and run it. It will automatically set the environment variable.
If you were using the AutoHotkey manual method, you can remove this portion from the script:
If using NirCmd, remove this line:
Well, there you have it. This method may work with other games, as well, but I've only tested with this one so far. Hope this helps someone.