Adventure Game Studio | Forums

AGS Support => Advanced Technical Forum => Topic started by: alkis21 on Sat 14/03/2020 18:03:34

Title: Unique keys for a commercial game - how?
Post by: alkis21 on Sat 14/03/2020 18:03:34
I searched the forum and read some topics regarding commercial games, but I couldn't find anything related to my question, so here it goes:

I've been commissioned to create an educational adventure game for 1st-6th grade students (6-12 years old) in Greece. The buyer will buy the game from a portal they intend to set up, download it and then type the key they purchased to play it. The game includes educational questions, which depend on the grade the child is currently in, so the key they are buying is restricted to a specific grade. If they want to play the game for another grade later on, they will need to purchase a different key.

The above is fairly easy to set up. My question is, how do I prevent the same key from getting used again? My clients are understandably worried that classmates will just buy a single key and all use the same one. Is there a way for an AGS game to check an internet database to see if they key has been used before? How do I do that, and what do I need to tell the web developer?

Any help will be appreciated.
Title: Re: Unique keys for a commercial game - how?
Post by: Click'd on Sat 14/03/2020 21:17:30
"portal they intend to set up"...

Serious question, why not use an existing one, like Steam, or itch? They know how to handle this.
Title: Re: Unique keys for a commercial game - how?
Post by: alkis21 on Sat 14/03/2020 22:48:17
I believe that they intend to create a full educational portal, with online courses etc. So they want everything to be in one place.
Title: Re: Unique keys for a commercial game - how?
Post by: Crimson Wizard on Sat 14/03/2020 23:07:32
If they have some system set up, with database etc, the best solution would perhaps be to write an engine plugin, that contacts that system and exchanges data, keys or whatnot. There are couple of existing plugins (like Steam/GOG plugins, and sql query plugin I've seen somewhere) that could be used as an example or starting point for this, or one could write it from scratch.
Title: Re: Unique keys for a commercial game - how?
Post by: pell on Mon 20/04/2020 23:05:51
Here's another area where knowing how to compile a game file without the editor would be useful. A script on the server could generate a key for that sale and then compile an executable of the game with that key built into it.

Still, I don't know how you stop people from just copying the game file and sharing it and the key with others. It has been a while since I've played a Steam game. Do you have to be logged into Steam to play your game?
Title: Re: Unique keys for a commercial game - how?
Post by: Crimson Wizard on Mon 20/04/2020 23:09:17
Quote from: pell on Mon 20/04/2020 23:05:51
Here's another area where knowing how to compile a game file without the editor would be useful. A script on the server could generate a key for that sale and then compile an executable of the game with that key built into it.

This is possible to do now, there are tools that can unpack and repack the game file: https://github.com/rofl0r/agsutils

Since AGS game data is basically a library of smaller files packed together, you can add such key in a separate file, for instance.

Not sure about safety of such approach though. Maybe it's not that good at all. Depends on where exacty in game data did you plan to put the key.
Title: Re: Unique keys for a commercial game - how?
Post by: Danvzare on Tue 21/04/2020 11:49:18
When it comes down to DRM, if you want something effective, you need to completely disregard the consumer.
One way I could envision doing this is a key that's somehow generated from the computer's name or something along those lines. But another way that I think would be more effective, is to require people to be logged into that portal to run the game. That way it would be connected to the account. Then all you have to do is kick out anyone who logs into the same account on more than two machines at the same time.