How have you generated Unique Identifiers (UID)?

Get help using Construct 2

Post » Mon Feb 16, 2015 3:55 pm

For a game I am building, I am running into a couple areas where I would like to generate a UID with relative safety from collisions. In my current setup I am logging unique data about game instances (performance data from my alpha tester group) and each game played is tagged with a unique id. This logged data is beamed up to my web server via AJAX. When building the logging system, I needed a UID, and could not find a system expression for this. In a pinch to release, I ended up having my php code generate a UID ( http://php.net/manual/en/function.uniqid.php ) and then beam it back to the client, then the client beams that back with the game data.

I would rather generate a UID on the client side in the game, than on my server. I have read about some algorithms that would do a decent job that I could either attempt to program in the event sheets or extend a custom object myself using the SDK (probably the way I would go). Before I do either, I wanted to consult the community to see how others have done this?

So, how have you generated UIDs?
B
21
S
4
G
1
Posts: 96
Reputation: 1,852

Post » Mon Feb 16, 2015 5:11 pm

There are some Hash plugins available in the plugins section which might help.

plugin-cb-hash-md5-sha-1-and-sha-256_t62215
B
46
S
16
G
9
Posts: 1,096
Reputation: 11,153

Post » Mon Feb 16, 2015 5:28 pm

thanks @spongehammer
B
21
S
4
G
1
Posts: 96
Reputation: 1,852


Return to How do I....?

Who is online

Users browsing this forum: bonakid1811, oddreal, R0J0hound and 9 guests