-
Passcode system
I have an idea for a skill game whereby players are able to save their progress via a passcode the game gives you that can be entered when you restart.
All I need is a reliable system to turn one apparently random number into another number that means something to the game, but without the possibility of players being able to guess at a passcode and cheat.
I estimate that I will need about 50 different passcodes, so it's feasible that I could simply create them myself and use filters to match them up at the start but I'm wondering if anyone has any suggestions for a simpler system?
If it's possible I think this will be a great addition to the game as it will mean we can bypass the 30 min time limit for longer games by allowing save points along the way.
-
Senior Member
Re: Passcode system
wow thats funny, i had the same idea to make one, i was going to give the code out after the replay finishes so no one can copy and then have left/right bumper to select the alphanumeric combination, as lb/rb don't show in replay.
have the player pick a random number seed at the start and use that for the left/right bumper combo base on a fixed seed and some sort of modulo to the random
-
Re: Passcode system
See, great minds think alike
Any ideas on how to do it without creating your own set of codes?
I had one idea which I haven't tested yet, which is to use random data sources and have the seed value be the code. I "think" that if I set the time in a RDS to 30 mins (being the max track time) and then providing the upper and lower limits don't change then the "random" output should match the seed value.
If it works you'll still need to figure out all the codes you need in advance but it might help to reduce coding, maybe I'm barking up the wrong tree though.
-
Senior Member
Re: Passcode system
not really any need to have a random number, use a fixed seed and a code the player sets, have to do this as variations in time/etc will create a unique seed
just use the fixed seed and modulo the output with the player code and have left bumper / right bumper displayed when you give the code out like
A0-LB F6-LB 2E-RB
and then when the player "loads" the game at the start they select A0 with LB ... etc
codes not that bad really, i'd create the code in byte packets
like the replay system in the game is like what 3 bytes per tick:
LT 0-3 2bits
Rt 0-7 3bits
L/R sticks all 4x3bits
Y button 1 bit
LB 1 bit
RB 1 bit
LsB/RsB 1 bit each
=22bits or 3bytes
-
Senior Member
Re: Passcode system
i would do it like
random(seed: vds, time+30min) and for every level use a set event to increase the seed event by 1
this will create a random number that for the players next level
random( seed:vds,time 30+min) set event increases vds every tick and write all numbers in a vector
this will give you the random numbers were given to each level
you will need to check if non of the random numbers repeat or create a code to prevent this from happening
you would also need some code to convert a number into a button combination
digit number each number a ammount of button presses needed for a button could be enough and easy to code
-
Re: Passcode system
Creating a "random" code is relatively easy, it's getting the game to recognise it when you enter it again that's the issue.
I'd like to find another way other than having a list of codes that get checked, and I'd also like a foolproof way of making sure the player cannot guess at a code and end up in a random place in the game.
I'm thinking about using a substitution cypher interpolated with random dummy digits for the code, but this doesn't eliminate the chance of someone guessing a code correctly.
-
Senior Member
Re: Passcode system
you could do it hold a button and then insert the code
hold button activates the code entering
some button triggers to some set events to vds that recreate the code
on release it checks to see if its correct
you can a second random datasource that adds extra randomness like 2 codes that need to be entered under 2buttons or so
-
Re: Passcode system
Not sure if button combos is the way to go, I was thinking more of an alphanumeric code.
Probably over thinking this for a game that will be played by 100 people for about 30 seconds. TC is not what it used to be.
-
Senior Member
Re: Passcode system
with a minimal of code you could have random almost imposible to guess(if you do enough or make it a double code per level)
-
Senior Member
Re: Passcode system
i was thinking about this random, the problem with random based on time is the only was to get the value back to wait said time for it to be realised again! this would be a problem if the code used was generated after 30mins.
by far the easiest way is to let the user create an open Pin Number that is used to create how the data is selected, ie what button to press when selecting the code for loading and shown when save info is displayed.
what i would do is capture a sequence of random numbers based on a fixed seed to a vector from the start gate trigger, say 100 ticks worth and then modulate the Pin Number with this sequence somehow, and use these values to randomly set whether lb/rb is used to select the load alphanumeric data or used at the end of the game to display if the code is Lb or Rb selected. again i'd have this save data displayed well after the replay repeats so there is no chance for any other player to see the Lb/Rb code, they will only see the player inputting the base code at the start with no clue as to what Lb/Rb sequence is used.
i personally wouldn't care if anyone wanted to guess at a code, would be interesting to see if they can break or hack it, kudos if they do
. it all depends on what kind of CRC (type thing) you want to do to the data for testing integrity, i'd have some checks based on bare bones 'what is possible' to do in game.
could be:
Ammo count as ammo has an upper limit
location, room ID would restrict the data
if player on a platform
weapon in hand, again limited number of weapon IDs
just some of the integrity checks that can be done.
or really by far the easiest thing to do is have a save to server in place of the replay system *hint hint*