Hi there,
Today I'm going to be showing you how you can get your rpg maker mv game hosted online without losing any of that hard earned gold!
Before we start, there are some things you are going to need.
- Git. This is a tool we will use from the command line, to perform updates to the files we are storing online. You can download git from HERE.
Once downloaded, simply run the exe and it will setup git on your system for you.
- An account at openshift. Openshift is a 'Platform-as-a-Service' (PaaS) that allows developers to quickly develop, host, and scale applications in a cloud environment. Their site is HERE.
You can build many kinds of application on openshift, but today we will be focusing on node.js and express - a framework for building web applications using javascript.
- My barebones-express-ejs repository. Found HERE, direct download HERE. (I recommend direct download of the zip file for this tutorial
- A game to upload.
- [optional] node, which has npm, installed onto your system. This will allow you to run your game server locally for testing, but this isnt vital for this tutorial. You can get node from HERE if your interested.
Once you have git installed, your account confirmed, and the barebones repository we can start.
First we will head over to the openshift website, to their 'dev console' page (
link). At the bottom of the page, there is a link to create a new (your first) application, click that.
We are then presented with a huge list of possible application types. Scroll down this list to find node.js and click it.
You will now be asked to configure some settings for your application, the only thing we need to alter is the public url. This will be the url we use to access the game from a web browser.
Once you have chosen an awesome url, scroll down the page and click 'create application'.
This usually takes a minute or two, so don't panic when the little loading spinner keeps on spinning around.
After your application has been created, we need to download the git repository of our application to our local computer - so we can make changes, and then upload our new copy. To do this, go into the folder that you wish to store your application files, and open a command window. (you can do this on windows by holding shift and right clicking in the folder window, then selecting 'open command window here' - or similar)
When you have your command window opened, go back to the openshift website which should currently be displaying the 'next steps' page of the new application creation process. On this page we are given the link to the git repository we need to clone, it looks something like this:
Copy this piece of text, and in your command window right click your mouse to paste it in (ctrl+v doesnt paste in command window) and hit enter. (dont copy the line 'cd yourgamename/'). You should be asked if you wish to continue with cloning this repository, simply type 'yes' and hit enter again. Some text will start spamming informing you of the cloning progress and should only take a second to complete. After the files have been cloned into your computer, you can use the command 'cd yourgamename' to enter into the folder you just created (will be called 'yourgamename' by default).
Your command window should now look something like this:
Assuming everything has gone smoothly so far, we are ready to upload our game. To do this, we must modify the contents of the files we just downloaded, and then upload our new files to the git repository for our application (you know, the one we just cloned).
The modification of the files if VERY EASY. Simply go into the folder that application files are in, mines is called 'mycoolgame', and select everything except the '.openshift' folder, and then, hit delete.
Now, remember the repository we downloaded earlier? The barebones-express-ejs one? Find that zip file and extract all contents into the the folder we just deleted everything from so that it looks like this:
Once thats done we need to add our game files, so open up the 'source' folder. Within the source folder there are two other folders, 'client' and 'server'. We will venture into the client folder first.
These three folders within the client folder, are about to be replaced with our game files. First highlight and delete the images, javascripts, and stylesheets folders. Then, open up your game project folder, and highlight all folders within it and copy them in place of the folders we just deleted. Your client folder should now look something like this:
Next we will leave the client folder, and enter the server folder. Within the server folder, there is two files (config.js and main.js) and a views folder, which is what we want, so enter the views folder.
Inside the views folder, the is a single file - index.ejs. All that's left for us to do, is replace the contents of index.ejs with our games index.html file. Again, this is very easy. Just enter your game project folder and locate the index.html file. Open the file up in any text editor and select all contents and copy. Now enter the views folder, open the index.ejs file in a text editor, select all contents, delete, paste your index.html file contents in, and hit save.
Thats us, we have changed all files that are required, and our game is now ready to be uploaded.
At this point, if you installed node on your system you can run the following command from the command line to run your applications server locally.
npm install & npm start
This will allow you to go to the web address
http://127.0.0.1:8080 and view your game in action.
If you have no interest in that (which there is really no need), enter the following three commands one after another into the command window:
git add .
git commit -m "changes"
git push
You should then see a stream of information about the uploading of your new files, and eventually - assuming everything went correctly - your application server will reboot. When this happens, its done. You have successfully got your game hosted online for free. Now all that's left to do is view your game.
To view your game, use the public url that you chose when first creating your application on the openshift website. It will be something like
http :// mycoolgame - userdomain.rhcloud.com/
And thats all there is to it.
There is likely other ways to obtain free online hosting, and probably easier ways, but this way works and doesn't cost anything!!
If this tutorial was useful to you in any way, feel free to leave a like or comment or such
Edit:
Here is a simple working example of a game hosted this way:
http://mycoolgame-dekita.rhcloud.com/
本贴来自国际rpgmaker官方论坛作者:??????处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/how-to-host-your-game-online-for-free.64501/