• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Unique identifier or unique name?

Pfap

Member
I'm trying to decide between forcing the player to pick a unique name that can't be changed or generating some other unique ID and assigning it to an install. I'm building passwordless and would like some way to recover the users progress. I've seen apps and games that do similar stuff to what I am describing. My brother showed me some game called "Monster Warlord" I believe that had a progress save ID. Where before the player deletes the app they can jot down an ID and upon reinstall go to settings and punch that number in to retrieve their progress. Also, important for when people get new phones.
Otherwise, I need some way to retrieve and store stuff in the database. And I'm not sure if I should just use auto increment for that? So, the first person to play my game would get record 1 or 0 I'm using Redis and off the top of my head can't recall if it is 0 indexed.

Has anybody here implemented anything like this? And if so how did you handle the problem?
 
H

Homunculus

Guest
Geberally that’s sonething done server-side, not directly in game maker.

It usually is some kind of UUID that matches the user on a database (something you definitely have since you want to save user progress).

https://en.m.wikipedia.org/wiki/Universally_unique_identifier

If you don’t trust the UUID to be unique you can always double check against the database, or use a mix of auto incrementing value and hashed value to get something like 2-affdb0ca where 2 is the incrementing id and the rest the hash
 

Pfap

Member
Geberally that’s sonething done server-side, not directly in game maker.

It usually is some kind of UUID that matches the user on a database (something you definitely have since you want to save user progress).

https://en.m.wikipedia.org/wiki/Universally_unique_identifier

Yea, I'm thinking to keep things cheaper I will send them to a server and give them a unique id, but only create a record for them if they are in the top 99 players or something. I guess as long as it is unique enough... the idea of collisions and the such kind of bothers me, but I guess I wont lose sleep if 1 out of an undecillion or quintillion of my players have problems :p


Edit:
This also just got more complicated. I'm not sure how many characters I should use now. I want it to be convenient for the player to jot down, but without collisions. For example if I have 50 users would it be better to generate a string of 10 characters and then compare that string to the other users' already selected strings and if it matches just try a new generation of 10 characters? I am after all expecting significantly less than 7 billion downloads lol.
 
Last edited:
H

Homunculus

Guest
In this case what about my second idea? Unique incrementing value + short hash.

Or you just let the server generate a short random string until no matches are found
 

Pfap

Member
In this case what about my second idea? Unique incrementing value + short hash.

Or you just let the server generate a short random string until no matches are found
Hmmm, the second idea might work it's a lot to think about.
What about something like this:

The player decides to transfer there data to a new phone, so I have a button in settings they can press to get a 10 character string. So, they have the really long uuid, but then a 10 character string that will be active until they retrieve there uuid again.
Something like, if 50 users in one day buy a new phone there will be 50 active 10 character strings and if a 51st generates a 10 character string it will get checked against the list of active 10 character strings to be sure it is unique and then persisted to disk until erased.
 
H

Homunculus

Guest
Could definitely work. A 10 character string though already has a huge amount of combinations and I can’t really see the need for it to be temporary
 

Pfap

Member
Could definitely work. A 10 character string though already has a huge amount of combinations and I can’t really see the need for it to be temporary
Yes, I am probably adding unnecessary complexity. I'll just generate a string and check against existing strings for uniqueness I don't see it being a problem unless there were hundreds of thousands of users.
 
Top