playMaker

Author Topic: Help needed with slot machine game  (Read 11832 times)

AlanSmithee

  • Playmaker Newbie
  • *
  • Posts: 18
Help needed with slot machine game
« on: February 28, 2012, 04:50:02 PM »
Hey there,

First off i want to mention i love Playmaker, finaly something let me make games without to much hassle of programming.

My problem:

I'm making a slot machine game, i got as far to make the reel's rolling a random amount (on touching/clicking the first for now) and roll and stop with a small delay on each roll.

the problem is i want to compare the icons that are fallen/dropped.
i tried to get the rotation amount compared but the rotation outcome isn't constant, all the axis change and isn't reliable, also i didn't found a way to compare for variables.

So next thing i tried is to create 20 cubes inside each wheel and a collider detector (cylinder) and tag each cube with the matching symbol. i was planning to detect the first symbol and send a event to check for the next symbol matching etc. etc. (for example: prune1->prune2->prune3->prune4->price (yay!)

But that didnt worked out neither, not sure where i'm going wrong. if anyone got a suggestion or a sollution i would be very happy. i will even give you a virtual beer ;)

Robert Foster

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Help needed with slot machine game
« Reply #1 on: February 28, 2012, 05:18:42 PM »
hi nice  i need the file or tail want your need

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help needed with slot machine game
« Reply #2 on: February 29, 2012, 12:47:05 AM »
Ah, the good old slot machine :)

 The best way to go about this is to "model" your slot machine mathematically, and then control your reels form there and not the opposite. That's the mandatory approach for a real implementation of a slot ( especially if you will plug your slot to a server giving you the odds and results). The reason is that todays slot machines have reels with more slots than you can physically put on the physical rotating reel ( because of the odds... they don't want you to win, remember?...).

If however you don't wanna go that far, a collider acting as the result "Area" will help you, so your second solution is a good starting point, but I would not use tags.
 If each cubes has a fsm attached with a reference to what it's supposed to show, you can then query the result area collider for the current cubes currently colliding or something, then you know which cubes are front. on them cubes, call a global event or query for a the variable mentionning the symbol.

 You will most definitly need to fiddle with ArrayMaker if you want to deal with arrays and hashtables. Slot machines is the perfect example of a good use of arrayMaker. you can define easily each slots and what each reels should contains and in what order, then store winning results combinations as well, store the current result, compare them together and detect winning combinations. I would not even try to build a working slot machine without this actually :) much much arrays and hashtable involved when building a slot machine.

https://hutonggames.fogbugz.com/?W715


bye,

 Jean

AlanSmithee

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Help needed with slot machine game
« Reply #3 on: February 29, 2012, 07:21:04 AM »
Thank you for youre replies everybody,
take youre virtual beer here <beer>
i'm at work at the moment, but i will see if i can upload the project tonight.

@jean
I'm not sure what you mean but i will look into it.
I never used arrays or even heard of hash tables but i hope with looking trough the examples that are available I will make some progress. Keep you posted about the progress/frustration ;)

Also if you look at the image i attached you see that i made a state to pick randomly a rotation value en linked that that rotation. i was wondering if there isnt a better way to do this. so i dont need so much "code"

Best regards,
Alan

AlanSmithee

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Help needed with slot machine game
« Reply #4 on: February 29, 2012, 05:05:20 PM »
Ok, still stuck and getting a headache.

Help would be thoroughly appreciated.
I didn't now where or how to start with the array's (I really would to learn more about them though, seems like one of those things you really need to build a game, some more documentation/tutorials would be very helpful)
But this doesn't need to be with arrays persé i just want it working.
file lives here: http://building-site.nl/New Unity Project 2.zip

This is project is to learn more about Unity and Playmaker so i will survive if i never get this fixed.
Funny thing is, the original project what i dreamt-up doesnt need a win-test function. i was supposed to show ingredients so it randomly generate a suggestion to what to eat. (i.e. Rice-Pork-Muchroom-desert)

but i got a obsessed with it to work properly and now i cant stand it it doesnt have a win-tester.

So any help is appreciated, thank you in advance!

p.s. Jean, great portfolio!




jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help needed with slot machine game
« Reply #5 on: March 01, 2012, 12:41:18 AM »
Hi,

 I think slot machine is a very good topic to show off playmaker goodness. so expect soon a working sample ( give me a month or so tho ok?). Would you be ok if I use your assets for this? I'll make sure to document this with an tutorial explaning it step by step. I think I'll make one version without arraymaker, and one more advanced using arrayMaker.

Regards ArrayMaker, visit and mess with the samples provided, this is your first stop as to understand how it works. And yes, I must do the documentation, but lack of time and energy to really make something useful at the moment, so better search/ask question on the forum for now.

 Bye,

 Jean

AlanSmithee

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Help needed with slot machine game
« Reply #6 on: March 01, 2012, 03:26:39 AM »
Hi,

 I think slot machine is a very good topic to show off playmaker goodness. so expect soon a working sample ( give me a month or so tho ok?). Would you be ok if I use your assets for this? I'll make sure to document this with an tutorial explaning it step by step. I think I'll make one version without arraymaker, and one more advanced using arrayMaker.

Regards ArrayMaker, visit and mess with the samples provided, this is your first stop as to understand how it works. And yes, I must do the documentation, but lack of time and energy to really make something useful at the moment, so better search/ask question on the forum for now.

 Bye,

 Jean

Hey Jean,

Thank you for your help, i really appreciate it.
Off course i'm willing to provide the assets, even better if you need additional models/textures or sounds just let me know.

I looked at the examples but it didnt do much for me, i never used arrays so its kinda hard what to start with etc. i will look more into it though.

To be clear, i'm not complaining about the lack of documentations. I'm very happy with people like you taken the effort to make things better for us all. People as you make the world a bit better.

 

AlanSmithee

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Help needed with slot machine game
« Reply #7 on: April 01, 2012, 06:53:39 AM »
Any word on progress jean? Muchos gracias!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help needed with slot machine game
« Reply #8 on: April 01, 2012, 09:29:48 AM »
Hi,

 It's on my list of things to do :) haven't forgotten, I have two more pending thread to complete on this forum, and then I'll tackle the slot. Get back again end of april ( I know this is far... sorry, but that's not realistic before).

 Bye,

 Jean

AlanSmithee

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Help needed with slot machine game
« Reply #9 on: April 01, 2012, 04:10:33 PM »
Take youre time, just was wondering on how things stand.

Thanx youre a hero

t0lkien

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Help needed with slot machine game
« Reply #10 on: March 18, 2013, 03:18:19 AM »
jeanfabre, did you get anywhere with the example slot machine?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help needed with slot machine game
« Reply #11 on: March 18, 2013, 03:43:17 AM »
Hi,

 Not really I am afraid...

BUT, something is ip on the asset store on that matter:

http://forum.unity3d.com/threads/94409-Slot-Machine-a-Game-Ready-Framework

bye,

 Jean