I want to create some rewards on my game with different value amounts (50/100/200/500/1000) and I would like to randomize them, distributing a higher incidence of lower rewards than the higher ones
For example:
Reward 50 - Incidence: 1 every 5 times
Reward 100 - Incidence: 1 every 25 times
Reward 200 - Incidence: 1 every 50 times
Reward 500 - Incidence: 1 every 100 times
Reward 1000 - Incidence: 1 every 500 times
I also want to limit this process (rewards distribution) once a day.
Could someone please help me to get it implemented?
Thanks in advance
There are examples of weighted probability on the forums if you do a search.
The very simplest form is something like
int(choose(1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,5,5,6))
Thanks for replying.
I think I would have a random plugin or something like that to use in C3, but it's okay.
Do you know how can I do to limit this offer once a day? I just want to give this reward one time per day for each user.
Develop games in your browser. Powerful, performant & highly capable.
RBuster Here is a weighted random selection I did based on a article about this subject. The link to the source is in the comments.
https://drive.google.com/open?id=1IT4e0FJ3Q0cOqqn16zxhsFZY_UPfK8q-
RBuster Here is a weighted random selection I did based on a article about this subject. The link to the source is in the comments. https://drive.google.com/open?id=1IT4e0FJ3Q0cOqqn16zxhsFZY_UPfK8q-
Thanks for the example. It was very clarifying. Do you know how can I do to run this code once a day? I just need to show it one time per day.
> RBuster Here is a weighted random selection I did based on a article about this subject. The link to the source is in the comments. > https://drive.google.com/open?id=1IT4e0FJ3Q0cOqqn16zxhsFZY_UPfK8q- Thanks for the example. It was very clarifying. Do you know how can I do to run this code once a day? I just need to show it one time per day.
> RBuster Here is a weighted random selection I did based on a article about this subject. The link to the source is in the comments.
> https://drive.google.com/open?id=1IT4e0FJ3Q0cOqqn16zxhsFZY_UPfK8q-
You need to retrieve the date from a server. If you get from the device It can easily be manipulated. I've never did this but I believe It must have examples somewhere here in the forum. Try searching for 'firebase'.
> > RBuster Here is a weighted random selection I did based on a article about this subject. The link to the source is in the comments. > > https://drive.google.com/open?id=1IT4e0FJ3Q0cOqqn16zxhsFZY_UPfK8q- > > Thanks for the example. It was very clarifying. Do you know how can I do to run this code once a day? I just need to show it one time per day. You need to retrieve the date from a server. If you get from the device It can easily be manipulated. I've never did this but I believe It must have examples somewhere here in the forum. Try searching for 'firebase'.
> > RBuster Here is a weighted random selection I did based on a article about this subject. The link to the source is in the comments.
> > https://drive.google.com/open?id=1IT4e0FJ3Q0cOqqn16zxhsFZY_UPfK8q-
>
> Thanks for the example. It was very clarifying. Do you know how can I do to run this code once a day? I just need to show it one time per day.
Rex has a firebase plugin. Maybe it can help me to get this resource working in the way I want. Thanks.