Trial Version

Talk about making games.

Trial Version

Postby blockcrisisdeveloper » Thu Jan 19, 2012 5:05 am

How can I add trial version to my game? for example I want the end user to be able to play it for 3 days then it gives a message after 3 days and quits and the user won't be able to play it anymore until he/she buys it?
Any help would be appreciated.

Thank you
blockcrisisdeveloper
 
Posts: 17
Joined: Wed Jun 15, 2011 4:38 am
Score: 2 Give a positive score

Re: Trial Version

Postby skydereign » Thu Jan 19, 2012 5:23 am

You can use a stTime vector and getTime, storing the date the game was first opened. This can be worked around by changing the system's date, but it's a start. You could alternatively allow them to play the game a certain number of times, or only for a certain amount of time (by tracking how long the game has run). To actually disable the game you could either ExitGame, or move to a screen telling them to buy the game, and use PauseGameOn.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Trial Version

Postby master0500 » Thu Jan 19, 2012 10:32 am

couldn't this be worked around by also deleting the variable file?
master0500
 
Posts: 409
Joined: Sun Jun 26, 2011 9:42 pm
Score: 27 Give a positive score

Re: Trial Version

Postby skydereign » Thu Jan 19, 2012 5:41 pm

You can't delete files in gE, though you could wipe it. But nominally if you have a wiped save file (or no save file) then you should create a new one.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Trial Version

Postby blockcrisisdeveloper » Thu Jan 19, 2012 6:32 pm

Hi thank you for your reply. Can you give me an example .ged or something showing stime?

Thank you
blockcrisisdeveloper
 
Posts: 17
Joined: Wed Jun 15, 2011 4:38 am
Score: 2 Give a positive score

Re: Trial Version

Postby SuperSonic » Thu Jan 19, 2012 7:11 pm

skydereign wrote:You can't delete files in gE, though you could wipe it. But nominally if you have a wiped save file (or no save file) then you should create a new one.

I think master meant, couldn't you delete the file that is created to show how long you have played the game? :)
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: Trial Version

Postby Jagmaster » Thu Jan 19, 2012 7:52 pm

blockcrisisdeveloper wrote:Hi thank you for your reply. Can you give me an example .ged or something showing stime?
Thank you

This should help you. How to use GetTime

Regarding the other concern: I don't know how well this would work, and it would be pretty easy to hack into. what you'd do is open up a new .ged and then make a var named "Valid" and save it in a group named "Registration" or something hard to guess like "aRFG23q@#452xcnf". Then, in the create actor for the view place this code:
Code: Select all
Valid=1;// Make this equal any quantity you want. For added security you could use a string variable.
saveVars("Registration_File.sav", "Registration");

Save the.ged document and hit game mode.
You will now have a .sav file in the same directory as the .ged document.

In your actual game, you'd add the same variable with the exact name and save group name as you did in the previous .ged.
On create actor of view in your game,
Code: Select all
loadVars("Registration_File.sav", "Registration");
if(Valid!=1)
{
    ExitGame();
}

If you delete the Registration file, the game will close! To make this work, you'll need to include the Registration_File.sav file in the folder with the game when you compress it or whatever. You'll want to record the time in the same file, only crate a different save group. And that's it!

I hope it helps anyways. :)
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score

Re: Trial Version

Postby skydereign » Thu Jan 19, 2012 10:39 pm

SuperSonic wrote:
skydereign wrote:You can't delete files in gE, though you could wipe it. But nominally if you have a wiped save file (or no save file) then you should create a new one.

I think master meant, couldn't you delete the file that is created to show how long you have played the game? :)

Ah, well then yeah you could. But there is no other way to store information between plays. But, I guess if you really didn't want them to work around it, you could wipe the game file. I didn't suggest this before purely because it seems way to aggressive, but the only workaround is for them to have copied the game, or to download it. So, wherever you decide that they can't play the game anymore you can use an fopen("gamefile", "w"); to completely wipe the file.

By the way, blockcrisisdeveloper, is it safe to assume that nothing came of your work on the new interface?
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Trial Version

Postby Jagmaster » Thu Jan 19, 2012 10:47 pm

I didn't think about anyone re-downloading it. That kinda throws my idea into the dirt :lol:

You could use the system I mentioned above for keeping someone from dragging and dropping a .dat game file onto the .exe, you could save the level in valid, and if the save file was lost, or the level's number didn't match the saved number, you could display an error message or something. I guess. :?

That wouldn't use binary files, only the built in var saving system.

Quick question, is fopen, fclose and the File pointer compatible with the built in var saving system? I'm assuming so to some extent.
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score

Re: Trial Version

Postby skydereign » Thu Jan 19, 2012 10:55 pm

The only improvement I can think of is when you do want the game to delete itself, create another hidden file. That way you can put something in the view checking if the file exists, and if so, rewipe the game. That way if they for instance redownload or update the game, the file would still exist, and therefore allow you to detect that the game should be wiped. Just so you know there will always be a workaround, your hope though should be that the vast majority of people don't try to do so (which most people won't).
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Trial Version

Postby Jagmaster » Thu Jan 19, 2012 11:20 pm

Wiping the game itself is a pretty good idea. You'd have to make a startup application that would check the file and then erase the actual game once the trial expired. I just realized after a bit of trial and error that the game cannot erase itself. Possibly some kind of safety mechanism?

And Skydereign, how would do write a hidden file? is there some kind of operator in fopen like w+b, perhaps maybe w+h or something like that?
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score

Re: Trial Version

Postby skydereign » Thu Jan 19, 2012 11:31 pm

At least on mac, I can have it erase the contents of the ged or the export, it doesn't really matter. As for the hidden file, it depends on the os. It's easy on mac and linux, as you just add a . before the name. The thing is that doesn't work on windows. So, you could create the file on windows, and set in its attribute to be hidden, name it something like .erase, and then it should appear invisible on most computers. Then you use it where if there is a 1 in the file, then delete the game.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Trial Version

Postby Jagmaster » Thu Jan 19, 2012 11:54 pm

About the Game erasing. Both of these examples have the exact same code.
Game1 cannot erase itself. Game2 can erase Game1 though.
Tell me if I'm wrong. If it is so on your end, it might be some kind of built in safety feature. Either that or it's just my computer.

MouseDown>>
Code: Select all
 FILE* file = fopen("Game.exe", "w");
 fclose(file);


Game.exe
This game cannot erase itself.
(1.37 MiB) Downloaded 152 times

Game2.exe
This game can erase Game.exe
(1.37 MiB) Downloaded 155 times


Regarding the hidden files; thanks for the answer. It's a pity windows can't do that. The rather devious side of me would think that would make some pretty strange bloatware.

Well, I guess you learn something everyday. It's fun to try and come up with a fool-proof system, almost like setting up a puzzle in a way.
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score

Re: Trial Version

Postby skydereign » Fri Jan 20, 2012 12:12 am

Ah, when I tested it, it was on a mac. I forgot that in windows you can't delete (or edit) a file that is running (also the case for linux). So as you say, you would use a loader file, and it can erase your actual file. This method is also preferable for other reasons, as it allows you to load the gE engine via a small game, and then the .dat file of your actual game. That way you can display some actual graphics as the game loads, instead of a black screen. That and you aren't deleting the file the computer is running...
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Trial Version

Postby Wertyboy » Fri Jan 20, 2012 8:34 am

Sound cool... but well i need demo.... cuz i'm lazy to do myself with these things :|
User avatar
Wertyboy
 
Posts: 543
Joined: Tue Jun 15, 2010 12:38 pm
Location: HCM City, Vietnam
Score: 44 Give a positive score

Next

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest