playMaker

Author Topic: Server Side "Slot Machines"  (Read 255 times)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2247
    • View Profile
    • jinxtergames
Server Side "Slot Machines"
« on: April 05, 2017, 12:08:59 AM »
Hi,
This is not really a playmaker question, but i thought i ask here also.

I am working on a project with a 'sort of' slot machines,
But at the moment everything works locally.

I want to do all of the data and calculations on a server,
but i am not sure where to start.

The data should be separated for the player and the "machines"
The player data i think i can manage... :)

the "machines" i am not sure how to do this.

Each "machine" has a win/lose rate calculator which manipulates the weight of  some random numbers that will give you the reels result.
There is also a chance to get a pre-set reels.
This i want to be done on the server.

and if possible i want, one player on one "machine".
So i would have like (for example) 20 virtual machines each holding their own win/lose and other data.
If all machines are in use then automatically add a (permanent) new machine.

Any kind of help, info or tutorial suggestions would be very appreciated.

Btw, i have photon+ but never worked with it yet :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Server Side "Slot Machines"
« Reply #1 on: April 05, 2017, 02:28:11 AM »
Hi,

 Cool :) I have implemented and participated few years ago in the making of such thing, with real money involved, boy that was tricky :)

basically, if you are not too worried about cheating and randomness being not so random, it's not complicated. Photon will not be able to help you here as photon is server less when you use the cloud, and implementing your own photon server is not something I recommand, Photon is meant to share information from players to players, that's is, here you want something to give you data by itself, it's different, the player will only make a request mentionning the slot machine Id and the slot machine settings it selected for this draw, then your server system will return the result.

 For this, typically, I would go with a conventional php/mysql server, it's easy to setup and 99% already featured in basic webhosting features.

I would recommend using https://fatfreeframework.com/3.6/home for creating your server api entry points, it's one of the most direct framework I have found o do this with minimal effort. This is what runs the Ecosystem browser backend basically.

You don't really need a database unless you want to keep track of all results for history and user complains ( depending on your level of commitment and what this slot machines will do, you will need to take that into account).

normally, the algorythm to compute the result of real world and money based slots machines is complex and follow some strict rules to guarantee the outcome statistically ( or better said, to make sure you loose more than you win...) but in your case, I would go for a simple random pick for each 3-5 reels within the range of entries per reels, very simple and it will work, however not exactly how this normally gets computed in real.

http://www.casinonewsdaily.com/slots-guide/random-number-generator-hit-frequency-vs-payout-ratio/


If you have more questions let me know.

Bye,

 Jean



djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2247
    • View Profile
    • jinxtergames
Re: Server Side "Slot Machines"
« Reply #2 on: April 05, 2017, 04:29:33 AM »
Hi,
Thx for the reply.

Auctually cheating is the main reason i want it to work server based :)

For the randomness i got that quite covered, the system works differently than the standard slot machines.

Can i pm  you a video link or send a link to to video on skype so i can explain better, i do not want to show this in public yet :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Server Side "Slot Machines"
« Reply #3 on: April 05, 2017, 10:37:10 PM »
Hi,

 of course :)

 Bye,

 Jean