Time limit on a demo.
by Very Interactive Person · in Torque Game Engine · 12/03/2006 (7:07 am) · 13 replies
I want to create a demo version of my game, and instead of limiting the features, I want to put a time limit on it. So, the player could play 30 minutes, or even an hour, and have full acces to all features and levels.
Now, my question is: How do I do this technically?
Should I write something to the windows registry? But what about the macs then? And I also don't think windows registry acces comes with stock Torque. Another concern is.... isn't that too easy to change?
If I simply use text files (prefs for example)... all that needs to be done is reinstall the game and they can play again. I don't want it to be so easy (but I also don't want to spend too much time on making it secure... if people want to crack it, they will anyway).
Any ideas?
Now, my question is: How do I do this technically?
Should I write something to the windows registry? But what about the macs then? And I also don't think windows registry acces comes with stock Torque. Another concern is.... isn't that too easy to change?
If I simply use text files (prefs for example)... all that needs to be done is reinstall the game and they can play again. I don't want it to be so easy (but I also don't want to spend too much time on making it secure... if people want to crack it, they will anyway).
Any ideas?
#2
Anyway, I checked out the Rack em Up Road Trip game, I'm not going to say here how they did it. All I can say is, it took me 30 seconds to figure it out (without using any fancy tools, just common sense), and how to reset it if I wanted too (which i'm not going to do, don't worry). But this is exactly what I was thinking... isn't it too easy to reset it? But perhaps that's ok, 99% of game players won't be able to figure it out.
Anyway, I'm thinking of writing some files to system folders (like C:\Documents and Settings\All Users\Application Data\). Do I need to change TGE (or TGB) to ask the system for the path to this folder? What do I do on systems like win 98/ ME? What about the mac, where can I write stuff like this?
12/03/2006 (12:41 pm)
Its actually a TGB game, but I tought I'd get more response in the TGE forums.Anyway, I checked out the Rack em Up Road Trip game, I'm not going to say here how they did it. All I can say is, it took me 30 seconds to figure it out (without using any fancy tools, just common sense), and how to reset it if I wanted too (which i'm not going to do, don't worry). But this is exactly what I was thinking... isn't it too easy to reset it? But perhaps that's ok, 99% of game players won't be able to figure it out.
Anyway, I'm thinking of writing some files to system folders (like C:\Documents and Settings\All Users\Application Data\). Do I need to change TGE (or TGB) to ask the system for the path to this folder? What do I do on systems like win 98/ ME? What about the mac, where can I write stuff like this?
#3
problems:
- you force the user to have internet access while playing
- its generally a pain for the user I guess
- what happens if the game crashes before the user ends his current "session"?
but its the only "half-reliable and -secure" method I can think of right now...
Everything you write to the user machine can be modified, deleted, etc., so I guess you'D have to store it outside of the user system, so a web server might be a good place...
just my 2c :)
EDIT: gotta try this...
12/03/2006 (12:58 pm)
Hm, here is an idea... make your game connect to a web server... on that web server, the user gets a "time-ticket" ... the game sends a unique machine identifier to your website (e.g. the MAC address or something, combined with a unique "game identifier" for his installation?) which is stored in a database... every time the game starts and ends, you re-identify that "game instance" and check the time available for it... or something along those lines :Oproblems:
- you force the user to have internet access while playing
- its generally a pain for the user I guess
- what happens if the game crashes before the user ends his current "session"?
but its the only "half-reliable and -secure" method I can think of right now...
Everything you write to the user machine can be modified, deleted, etc., so I guess you'D have to store it outside of the user system, so a web server might be a good place...
just my 2c :)
EDIT: gotta try this...
#4
So, could someone tell me how I can modify Torque to add a new console function to retrieve the users application data folder (in .net that would be Environment.SpecialFolder.CommonApplicationData (which points to C:\Documents and Settings\All Users\Application Data\ )? Or how to write to the registry? Does anyone know what folder it will return on win 98 / ME / ...? And what about mac, is there a similar folder on mac? How do you ask the system for the right path?
12/03/2006 (1:30 pm)
Yes, that would indeed be the safest way, but I'm not going to do it that way. Would take too much resources and time to make something like this + people without an internet connection would be screwed.So, could someone tell me how I can modify Torque to add a new console function to retrieve the users application data folder (in .net that would be Environment.SpecialFolder.CommonApplicationData (which points to C:\Documents and Settings\All Users\Application Data\ )? Or how to write to the registry? Does anyone know what folder it will return on win 98 / ME / ...? And what about mac, is there a similar folder on mac? How do you ask the system for the right path?
#5
When the game runs for the first time it writes a .cs file out with a timestamp in it, execs it to compile it and then deletes the.cs file leaving a compiled file with a line like $FirstRunTimestamp = "12.03.06 21:45"; in it.
You would also need to do something sneaky to identify if this is the first time they have run it, like make sure you ship with no prefs or config files maybe and check for them, or set a variable in a pre-shipped prefs file that gets changed the first time the game is run or something like that. This isn't foolproof but if you were to change a handful of values, check for certain files to be missing etc then unless people can read your source code they are not going to figure it out.
The only downside is that a clean install will reset the timestamp.
12/03/2006 (1:48 pm)
Assuming TGB works in a similar fashion to TGE, how about this as an idea.When the game runs for the first time it writes a .cs file out with a timestamp in it, execs it to compile it and then deletes the.cs file leaving a compiled file with a line like $FirstRunTimestamp = "12.03.06 21:45"; in it.
You would also need to do something sneaky to identify if this is the first time they have run it, like make sure you ship with no prefs or config files maybe and check for them, or set a variable in a pre-shipped prefs file that gets changed the first time the game is run or something like that. This isn't foolproof but if you were to change a handful of values, check for certain files to be missing etc then unless people can read your source code they are not going to figure it out.
The only downside is that a clean install will reset the timestamp.
#6
But I don't know if:
-that's the same folder on every win XP install
-what folder to use on win 98 / ME
-what folder to use on MAC
So... I need to ask the system to return me the path to the folder.
12/03/2006 (1:51 pm)
That's exactly why i need to write to C:\Documents and Settings\All Users\Application Data\But I don't know if:
-that's the same folder on every win XP install
-what folder to use on win 98 / ME
-what folder to use on MAC
So... I need to ask the system to return me the path to the folder.
#8
And installers for MAC. Well, normally there isn't an installer. I heard MAC users hate installers.
12/03/2006 (2:02 pm)
Ah, and then let the installer write that path to prefs.cs and read it from there? Good idea! Thanks. I'll probably use NSIS for the windows installer.And installers for MAC. Well, normally there isn't an installer. I heard MAC users hate installers.
#9
12/03/2006 (2:34 pm)
Not sure why you need to write to the application directory, why not write the file to a sub directory of your install? like modname/client/scipts/filename.cs? it's where all teh other compiled (.dso) files will be sitting and will therefore not look out of place.
#10
12/03/2006 (2:38 pm)
Euhm... becuase in that case the timer can be reset by uninstalling the application and re-installing it. Or by re-installing it in a new folder.
#11
12/03/2006 (2:43 pm)
And you don;t think people will delete files from the application data directory? That would be the first place I would look, closely followed by the registry. I still think the best bet is to hide the timestamp file in with all your other .dso files.
#12
12/03/2006 (2:51 pm)
Offcourse its easy to delete those files... I even said so in this thread. Still better then putting it in the same folder as your application.
#13
12/03/2006 (4:42 pm)
On windows you could drop a crumb somewhere obscure in the registry.
Torque 3D Owner Aaron E
Default Studio Name
Since time-limited demos work in TGB, getting similar functionality in TGE and TGEA shouldn't be a problem. Unfortunately, I don't have a clue how GG accomplished it. Hopefully one of guys from Eugene will provide a resource on this.
Aside from that, I suppose you could try analyzing the REURT installer (with a repackager like InstallRite) to see what files and registry entries are added/changed during installation. That probably wouldn't be much fun though. I don't think that would be a violation of the EULA, since you would just be auditing the changes made to your computer.
[Edit: fixed a typo and added some thoughts]