Running your game using a custom launcher

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Game launchers are pretty useful, but one problem that I've had with RM launchers is the fact that players can choose not to use it, but instead just run Game.exe, effectively bypassing your launcher.

Here's a simple demo with a custom launcher that demonstrates how to set up your project to use custom launchers.

When you run the game normally, you'll get an error-message (in other games, it may not even say anything and just immediately close)

If you run the game using the RMLauncher, you can then start the game.

This is the source code for the game launcher (Java) if anyone wants to build it themselves.

public class RMLauncher { public static void main(String[] args) throws Exception { String[] cmds = {"Game.exe", "CUSTOM_LAUNCHER"}; Runtime.getRuntime().exec(cmds).waitFor(); }}You can see that it is a very simple technique. Can it be improved?For those that don't want Java, here's a C# version with a simple GUI. It is built on .NET 2.0, so unless you're using a dinosaur version of OS like win95 or something you should be able to run it without installing anything.

https://www.dropbox.com/sh/sz6mpw5n2d6zxi2/pgqp4xzR9e/Library/RMLauncher_C%23.zip

It features the default form with a single button to launch the game.

The launcher is then minimized while your game runs.

When the game finishes running, the launcher runs some clean up processes (in this case, renames Audio to Audio2, if it exists), and then exits.

Source:

Code:
using System;using System.IO;using System.Windows.Forms;using System.Diagnostics;namespace RMLauncher{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {            this.Visible = false;            this.ShowInTaskbar = true;            ProcessStartInfo procInfo = new ProcessStartInfo("Game.exe", "CUSTOM_LAUNCHER");            Process proc = new Process();            proc.StartInfo = procInfo;            proc.Start();            proc.WaitForExit();            try            {                Directory.Move("Audio", "Audio2");            }            catch (IOException)            {            }            Application.Exit();        }        private void Form1_Load(object sender, EventArgs e)        {        }    }}
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
so this blocks the user from using the Game.exe directly? that's neat
 

Simon D. Aelsi

Voice Actor/Composer
Veteran
Joined
Feb 22, 2014
Messages
4,838
Reaction score
1,394
First Language
Hylian
Primarily Uses
RMVXA
The files don't open for me. The game launcher doesn't work. Is there a readme file somewhere? I looked and found none.

I might have done something wrong... x_x help?
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
You need Java installed to run the launcher.


I chose java because it was what I had on my machine at the time, and most windows machines should come with java already installed.

so this blocks the user from using the Game.exe directly? that's neat
Pretty much.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Ah. it uses a script check for a command line argument. I guess better tell people that they need the script, else they might just copy the RMLauncher.jar and think it would work correctly
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
One thing about game launchers is that they usually provide an options menu before the game is actually played. (Pressing the "Play" button on the launcher) These options are usually graphic/resolution-based that would normally expect a re-opening of the game in order to change.

If you don't really have anything like this (especially for an RM title which most likely wouldn't) then there isn't really a point for a launcher in the first place.

Oh and another thing is for DLC/file patching and updating, which RM also mainly does not use or support.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
RM supports file patching out of the box, if you don't encrypt that is...


anyway, I think this is just a starting method where people can base their launchers from, not the final form of the launcher...
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Well I guess the file-patching is a legit enough reason to use a launcher. However creating and coding a patch system is the real part. I would suggest Microsoft Visual Basic? To make both the launcher and it's windows, the file-patching system/server, etc.

I should really go back to learning Visual Basic.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Depends on how you want the patching to work... if it's just gonna look for a single patch file and maybe check time stamps to determine if the file is needed to be downloaded then run, then I think it's quite easy to do in VB... for example we can upload a patch.txt that contains the patch version and make the VB launcher check it, then if it's more updated than the current one, it begins downloading the patch...


I long wanted to use a custom launcher but never got on how to "lock" game.exe so that it cannot be run... now that we know how to get the command line arguments thanks to Hime, it becomes easy to do now.
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Hooray for advancement in RM technology!  I believe this is a nice breakthrough. (unless it's been done already and we just never heard of it!)

*Grabs a cup of cranberry juice since I can't have wine* Cheers!
 

Mouser

Veteran
Veteran
Joined
Aug 19, 2012
Messages
1,245
Reaction score
264
First Language
English
Primarily Uses
I'm thinking this would go along nicely with the audio encryption and the command line args scripts being discussed.

There are screen resolution scripts out now, so that could be an opening option. Ditto for sound volume, that's easy enough event to a variable. If you're going to have 'difficulty levels', that would be a good place to put those as well. With a bit of work, you could probably have different player profiles as well, so two people could play the game while keeping their save games separate.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I've added a C# version with a simple GUI as proof of concept. Details in first post.


People that had issues with the java version should be able to run this one since it's more...Windows-y?

I'm thinking this would go along nicely with the audio encryption and the command line args scripts being discussed.
Yes, the post clean-up processes that couldn't be done because RM doesn't support exit hooks natively can be done through the use of a launcher.


Though, there are still issues like what happens if they kill the launcher process directly, or if their machine crashes.


Not sure if there are ways to handle those.

Well I guess the file-patching is a legit enough reason to use a launcher. However creating and coding a patch system is the real part. I would suggest Microsoft Visual Basic? To make both the launcher and it's windows, the file-patching system/server, etc.


I should really go back to learning Visual Basic.
Fortunately now you have the option of pulling up standard and proven techniques rather than re-inventing everything just to make it work with RM.


It is also not difficult to modify the encrypted archive and re-build it on the fly, since the algorithm is already released publicly by whoever reversed it.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Looks neat, so that's how we force them to use the launcher... :)
 

brandos

Veteran
Veteran
Joined
May 25, 2013
Messages
147
Reaction score
31
First Language
German
Primarily Uses
The download link for the C# version is dead. Could you reupload it please? :(
 

lexietanium

Veteran
Veteran
Joined
May 29, 2013
Messages
98
Reaction score
19
First Language
Tagalog :P
Primarily Uses
Just wanted to double check since i saw a post about custom launcher probably not being legal for commercial use. Would this one be ok? It doesn't seem like any changes were made that would make it illegal since it seems to be coded frm the ground up and only calls for the game to launch. (I could be wrong tho since Im still learning about the engine)
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
This is okay since it doesn't run the game library from a custom file, it still runs it from the default game.exe
 

lexietanium

Veteran
Veteran
Joined
May 29, 2013
Messages
98
Reaction score
19
First Language
Tagalog :P
Primarily Uses
Sweet! And i saw that there's a way to drm your game using this launcher too! But I'm not sure how i can do .exe. heck im not sure how to do the jar either. Do i need a program fir it? I have only coded css3 n html5 (takin java nxt semester so no exp on that yet) >.> n some basic ruby n lua but i used notepad++. Im not familiar at all with creating a .jar or the language you can create .exe. Would it be hard to learn?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Sweet! And i saw that there's a way to drm your game using this launcher too! But I'm not sure how i can do .exe. heck im not sure how to do the jar either. Do i need a program fir it? I have only coded css3 n html5 (takin java nxt semester so no exp on that yet) >.> n some basic ruby n lua but i used notepad++. Im not familiar at all with creating a .jar or the language you can create .exe. Would it be hard to learn?
Not really. The first things you'd learn is how to build a program.


The java source code is available in the first post (5 lines) and if you're using an IDE all you say is "build project" and it builds a jar.
 

Millerberto2

Good Sire
Veteran
Joined
Nov 10, 2014
Messages
35
Reaction score
12
First Language
Portuguese
Primarily Uses
RMVXA


I thought I was the first one to do a launcher haha, It sure is a good idea!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top