Space Pilgrim Episode I: Alpha Centauri

Space Pilgrim Episode I: Alpha Centauri

Not enough ratings
Allow for window resizing and proper fullscreen scaling
By enderdrag64
This guide walks through the process of replacing the game engine (RPG Maker VX Ace) with an open source replacement (mkxp-z), which allows for resizing, improved fullscreen, and higher performance.
   
Award
Favorite
Favorited
Unfavorite
Section I : an overview
RPG Maker is a very old game engine - dating back to nearly 20 years ago. The specific version used by this game, VX Ace, was released all the way back in 2012. And it really shows its age. It has very poor performance, it uses a super old version of Ruby (version 1.9 specifically - for reference, the current version as of the writing of this guide is 3.0), it isn't cross-platform, it's closed source, and it artificially limits the screen resolution to 640 x 480, with no window resizing and with very poor support for scaling in fullscreen.

A number of RPG Maker replacement engines exist, but the best one for our purposes is known as mkxp-z, a fork of the popular replacement engine mkxp. In this guide, I will walk you through the installation of mkxp-z for the Space Pilgrim games, as well as some slight file changes you need to make to make them work correctly. Although this guide is under the community tab for Episode One - these steps will be compatible with all four of the original games (not Academy!!!!).

A couple of notes:
  • Firstly, doing this will break Steam achievements. Supposedly there is a way to get them to work with mkxp-z, but as I am not the game's developer I didn't want to mess with this.
  • Secondly, this guide is written with Windows in mind, though my understanding is that mkxp-z is cross platform and you could theoretically get the games running natively on Linux or OS X using it.
Section II: Downloading tools
Before we begin, we need to download a couple tools and programs.

The first is the mkxp-z replacement engine itself. You should download the latest Windows release from here:
https://gitlab.com/mkxp-z/mkxp-z/-/releases

Secondly, we're going to need a tool in order to extract the game's encrypted data so we can modify a couple scripts. You can download the latest version of this tool here:
https://github.com/uuksu/RPGMakerDecrypter/releases

Finally, we're going to need a script editor for VX Ace script files. You can download an open source editor here:
https://sourceforge.net/projects/geminieditor/files/

Section III: Installing mkxp-z
In what will probably be the easiest step in this guide, we are going to install the engine. Extract the downloaded archive, and copy the four files into your Space Pilgrim game folder. You can find this by clicking Manage -> Browse Local Files on the right-click menu in your Steam library.

Your game folder should now look like this (these example images will use Episode Two, but as I said the guide works with all four games):
Section IV: Extracting Files
Extract the second archive you downloaded, and run the file RPGMakerDecrypter.exe
You should see a window like this:

Click File -> Open RGSSAD...
Navigate to your Space Pilgrim directory
In the bottom right, switch the file type to "RPG Maker VX Ace Encrypted Archive (.rgss3a)"

Finally, select the file Game.rgss3a and click Open

If all goes well, you'll see a window like this:

Click "Extract All", and navigate once again to your Space Pilgrim game folder, then click "OK"

A moment later, you should see "Archive extracted successfully." in the bottom left corner.
You may now close the RPGMakerDecrypter.
Section V: Folder Cleanup
If you go back to File Explorer, you should notice some additions to your Space Pilgrim game folder. Now that the encrypted archive has been extracted, you should see a new "Data" folder as well as some additions to the "Graphics" folder.
We can leave these new folders alone for now.

One thing we can do, is delete the Game.rgss3a file. Now that it's been extracted, we don't need it anymore, and it will cause problems if we leave it there because the game will try to load it first before moving on to the folders.

Something else you should do at this point is delete or rename the original Game.exe file, and replace it with the mkxp-z.exe file, which should be renamed "Game.exe".
The reason we are doing this is so that Steam will still be able to launch the game.

In the end, your game folder should look like this:

Section VI: Script fixes
Now for the most difficult part of this guide. At this point, you might think that the game should be ready to launch, right? Unfortunately not. For whatever reason that I couldn't seem to figure out, mkxp-z.exe is unable to recognize steam_api.dll and UtilsSteam.dll, meaning that not only are achievements broken, but the game refuses to launch, complaining that scripts are trying to reference dlls it doesn't know about. Furthermore, even if you were to fix this issue, some outdated code in the game's scripts means that it will still crash on launch due to the new engine using a newer version of Ruby, and the mouse input will be broken.

While I wasn't able to fix the achievements, I was able to fix the game not launching, and fix the mouse input to be better than it was before. I will walk you through the changes you need to make for this. I cannot distribute files as I don't believe that would be legal, given that other than my changes the code is not mine, but I can tell you what you need to modify. I will try to make this as easy to follow as possible, even for people who aren't programmers.

Open up the Gemini.exe file you downloaded, and once it launches go to File -> Open Project.
Navigate to the game's folder and then open Data/Scripts.rvdata2
Once it loads, you should see something like this:


In the panel on the left side, scroll all the way down till you see the section with the steam scripts.
You need to open up all four of these scripts and comment out every line. You can do this by simply placing a '#' in front. So for example a line like this:

x = 2

becomes this:

# x = 2

Update: After playtesting a bit I've realized that commenting out these files completely doesn't work because it throws a NoMethodError whenever you would've unlocked an achievement. You have to comment out everything except for lines that start with "def" or "module" and their corresponding "end" lines. To make things easier I will provide a list. These are the only lines that should not be commented out:

script_steamAPI:
script_achievements_base: 4,24,27,32,37,39,46,48,55,60,67,69,73,74
script_steam_configuration: 4,21 (for episodes 1-3 only), 24 (episode 4 only)
script_steam_polling: 1,8,9,32,37,44,46,48,50,64,66,75,77,83,84,90,91,92,93,94,98,99,100,101,102,103

Once you've commented out every line in all four of these scripts, go back to the left panel and go to the script "Mouse Support" under Materials.

In this script we are going to have to make a few changes.
Firstly, go to line 383 and replace 'RGSS Player' with 'SDL_app'
The reason for this change is so that we can re-enable mouse input, which is broken otherwise since the script is searching for the wrong window.

Next, we want to scroll down a bit to lines 437 and 449.
Here you want to replace the word "index" with the word "key" on both lines.
This change fixes a crash that would occur otherwise due to syntax changes in more modern versions of ruby.

Next, we want to scroll up to the section " * Mouse Position" starting on line 303.
Delete everything in this section and replace it with this:

* START OF CODE *

#--------------------------------------------------------------------------
# * Mouse Position
#--------------------------------------------------------------------------
def self.pos
x = Input.mouse_x
y = Input.mouse_y

cursor_size_y = 23
cursor_size_x = 18

min_x = 0.0
min_y = 0.0
max_x = self.client_size[0].to_f-((self.client_size[0].to_f-Graphics.width.to_f)/1.0)-cursor_size_x.to_f
max_y = self.client_size[1].to_f-((self.client_size[1].to_f-Graphics.height.to_f)/1.0)-cursor_size_y.to_f

if (x.to_i< min_x.to_i)
x = min_x.to_i
end
if (x.to_i> max_x.to_i)
x = max_x.to_i
end
if (y.to_i< min_y.to_i)
y = min_y.to_i
end
if (y.to_i> max_y)
y = max_y.to_i
end

return x, y
end

* END OF CODE *

You can also completely delete the two sections immediately above it, " * Screen to Client" and " * Mouse Global Position".

Immediately after line 272 insert the following line:

Graphics.show_cursor = false

You can also delete line 261.

This wraps up all of the code changes we need to make.
This last set of changes focused on improving the mouse code to work properly in fullscreen with the new engine.

Now that we're done, make sure to save the project by hitting Ctrl+S.
Section VII: Wrapping Up
Now we are finally done modding the game. You may end the guide here, though I wanted to note a few more things.

You can switch into fullscreen by hitting alt+enter, or you can enable it by default in the mkxp.json file in the game directory. Just open it with notepad, go to line 48, remove the two slashes and change false to true.

Super minor issue: If you play the game with the mouse, the system cursor will still be visible over the black bars on the sides of the screen in fullscreen. This will not affect gameplay, and I doubt most people will even notice.
I've tried to get rid of this, but I'm honestly not really sure how to. If anybody reading this has an idea how to fix this feel free to leave a comment.

That's it for the guide! Feel free to leave any comments or questions down below!