设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 97|回复: 0

[制作教程] How to host your game online FOR FREE!!

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    3 天前
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    21262
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    25800

    灌水之王

    发表于 前天 17:10 | 显示全部楼层 |阅读模式
    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/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-10 02:07 , Processed in 0.119257 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表