Enquirer Home Page | Twitter | Back to Improbable Island

 Forum Index > Season Two > Development New Topic Post Reply
 New Gambling Device in the Spiderkitty!
 |  Printable Version
Zpatula
 Wednesday, November 18 2009 @ 08:14 PM UTC (Read 2531 times)  
Forum Badass
Badass

Status: offline

Registered: 07/22/09
Posts: 106

Hey, when did the new machine show up in the Spiderkitty? I've forgotten it's name, but it's something like 'Clanker' or 'Klinker'. Fun to play! I'm not sure just what all the lights and colors mean, but I'm on my way to finding out.

Has this been here for a while and I was just overlooking it, or is it new?


I ATE PINEAPPLE!
 
Profile Email Website
Quote
SicPuess
 Wednesday, November 18 2009 @ 09:16 PM UTC  
Forum Improbable Badass
Improbable Badass

Status: offline

Registered: 08/10/08
Posts: 327

CLATTER!

I saw it yesterday, don't think it was there before. Nice distraction from the usual Jungle Horrors!


 
Profile Email
Quote
g_rock
 Wednesday, November 18 2009 @ 09:44 PM UTC  
Forum Improbable Badass
Improbable Badass

Status: offline

Registered: 11/06/09
Posts: 132

*urk* So terribly addictive!


 
Profile Email
Quote
Count Sessine
 Wednesday, November 18 2009 @ 10:47 PM UTC  
Forum Moderator
Moderator

Status: offline

Registered: 08/16/08
Posts: 1402

Yup. Very cool. Even sucked me in -- at first level!


 
Profile Email
Quote
g_rock
 Wednesday, November 18 2009 @ 11:03 PM UTC  
Forum Improbable Badass
Improbable Badass

Status: offline

Registered: 11/06/09
Posts: 132

Quote by: Count+Sessine

Yup. Very cool. Even sucked me in -- at first level!



Hmmm, I can see it now...
"You've just gone up a level in losing your life's savings! You can now lose your life's saving more quickly each day, you poor sod!"


 
Profile Email
Quote
Aeridus
 Thursday, November 19 2009 @ 01:16 AM UTC  
Forum Badass
Badass

Status: offline

Registered: 08/14/08
Posts: 91

Damn, it's like Pachinko meets Pinball! XD


 
Profile Email
Quote
Symar
 Thursday, November 19 2009 @ 05:48 AM UTC  
Forum Improbable Badass
Improbable Badass

Status: offline

Registered: 04/16/09
Posts: 212

38 coin bonus combo chain!

Only got 300 req off it though, and was like my 5th coin dropped.


 
Profile Email
Quote
CavemanJoe
 Friday, November 20 2009 @ 07:22 PM UTC  
Forum Admin
Admin

Status: offline

Registered: 02/24/08
Posts: 2281

I thought you guys might be interested in the design and mechanics of this machine, so here goes.

(once I'm done it'll be clear that I used to supply arcade machines for a living)

The whole thing is made out of parts salvaged from a post-EMP world. The machine measures no more than eight inches deep. For game aesthetic reasons, the graphics don't show the top part of the machine (where the coin slot would be), the bottom part (where the cash box, hopper and escalator mechanisms would be), or the sides (containing the locks to open the playfield area for cleaning and servicing). In effect, the graphics you see are "zoomed-in" on the playfield itself, so that you don't have to scroll down a whole hell of a lot when you get a nice combo.

The machine is designed to work in the simplest manner possible, and to be easily transported from place to place and mounted (because of its size and weight or, more accurately, lack thereof). But if the coins go in the top, clatter down to the bottom, and bonus coins are awarded from the top - and if Dan doesn't want to have to stop serving drinks to refill the top hopper every ten minutes - the most interesting question is this:

How do the coins get from the bottom of the machine all the way back up to the top?

Also,

How does the machine keep track of how many coins to pay out, if it doesn't have any integrated circuits?

For those new to the guts of arcade machines, there are two commonly-used payout mechanisms: stack type and hopper type.
In a stack type payout mechanism, coins are stacked up flat, one on top of each other. An electromagnetic sliding mechanism at the bottom of the stack spits coins out one at a time. They're very reliable, but they're also rather slow and loud, and take up a lot of vertical space because the coins have to be neatly stacked up in one column.
In a hopper type mechanism, the coins are just dumped into a box willy-nilly, and a wheel with coin-shaped holes in it turns to catch the coins that are lying flat against it and then spit them out one at a time. They take up very little room, are fast and quiet, but because the coins are lying in the box every which way, they can't be counted on to accurately count coins by physics alone - instead, a little infrared sensor notes when a coin is successfully paid out.

The Clatter machine in the Prancing Spiderkitty makes use of a stack-type payout mech and a hopper-type mech on which the infrared sensor no longer works.

Here's how the machine works.

The coin mech is an old-fashioned mechanical type, similar to a Coin Controls S10 model that are still very popular in the States (for the benefit of Limeys such as myself, those are the old red "push to reject" mechs that only take one type of coin - the US doesn't really use electronic coin mechs, 'cause all their machines take quarters AND NOTHING BUT, DAMN IT (except for 10p pieces if you're feeling cheeky, 'cause they're near enough the same size and weight)). The mech is mounted on its side, and the coin entry panel is one of the really old-fashioned sorts that you'd see on one-armed bandits or gumball machines, where the coin goes in with the head or tail side facing you, rather than the edge.

The coin mech spits out straight onto the playfield - it doesn't route to a slider stack. There is a slider stack at the top of the machine, but we don't want to trigger the electromagnet every time a coin goes in (putting the coin in the top and spitting another coin out from the bottom) 'cause it'd wear out faster - so the coin goes straight past it. There are two switches mounted to the side of the stack - one near to the bottom, one near to the top. The reason there are two switches will become apparent soon.

This payout stack has been modified a bit - bearing not one but three payout sliders, angled so that the electromagnets are side-by-side and the sliders themselves sit on top of each other. This means that the stack will pay out coins at three different angles, which is why there's a little funnel underneath to catch them and make them straight again.

Inserted coins go past the stack and clatter down the playfield, closing switches which activate the payout electromagnets. Depending on the target hit, either the top slider, the top and middle sliders, or all three sliders will actuate and pay out coins.

At the bottom of the machine, where lost coins go, there's a hopper-type payout mechanism.

When both switches on the stack mechanism are closed (IE when the stack doesn't contain very many coins), the payout wheel on the bottom hopper starts turning. It stops when the top switch is opened (this saves the bottom mech from stopping and starting all the time, which will make it wear out quicker). The coins from the bottom mech go up a coin escalator, and into the top stack.

And that's how a Clatter machine works!

As to how the in-game representation of it works, rather than going for more efficient code it's actually quite realistically modelled. Rather than determining the coin's path at the start of the game, it decides its path randomly at each nail the coin hits, and creates the representation of the board out of seven different images:


PHP Formatted Code
<?php

function clatter_getmoduleinfo(){
        $info = array(
                "name"=>"Clatter",
                "version"=>"2009-11-17",
                "author"=>"Dan Hall",
                "category"=>"Req Gambling",
                "download"=>"",
                "prefs"=>array(
                        "lit"=>"Player's lights array,text|array()",
                        "virgin"=>"Player is new to Clatter,bool|1",
                ),
                "settings"=>array(
                        "played"=>"Total coins played,int|0",
                        "won"=>"Total coins won,int|0",
                )
        );
        return $info;
}
function clatter_install(){
        module_addhook("inn");
        return true;
}
function clatter_uninstall(){
        return true;
}
function clatter_dohook($hookname,$args){
        global $session;
        switch($hookname){
                case "inn":
                        if (get_module_pref("virgin")){
                                output("Mounted on one wall is a funny-looking wooden device with a coin slot and a glass front panel.`n`n");
                                addnav("Ask about the funny-looking machine","runmodule.php?module=clatter&op=virgin");
                        } else {
                                addnav("Play Clatter","runmodule.php?module=clatter&op=start");
                        }
                break;
                }
        return $args;
}
function clatter_run(){
        global $session;
        if (httpget('op')=="virgin"){
                page_header("What a curious-looking device.");
                $bk = getsetting('barkeep','`tCedrik');
                rawoutput("<img src=\"images/clatter/clatterboard.jpg\" align=right>");
                set_module_pref("virgin",0);
                output("You head over to the bar and ask %s what the deal is with that weird-looking box thingy on the wall.`n`n%s grins.  \"`%You like it, then?  Built it meself.  It's all relays, no IC's at all.  Runs off an old car battery.`0\"`n`n\"`#It's very nice, yes,`0\" you say carefully, \"`#but what `iis`i it, %s?`0\"`n`n%s beams proudly.  \"`%I just thought of a name fer it this mornin' - I'm gonna call it \"Clatter!\"  You put a coin in the top, see, and it goes down that nailboard.  If it comes out the very middle on the last row of nails, you get to keep it!`0\"`n`nYou frown.  \"`#I'm not sure I like those odds, %s.`0\"`n`n\"`%Ah, there's the clever bit.  Y'see those circles dotted around the nailboard?  If yer coin goes over one o' them on the way down, an electromagnetic slide fires some more coins out at the top.  It's all about chain reactions, y'see.`0\"`n`nYou stroke your chin thoughtfully.  \"`#What sort of coins does it take?`0\"`n`n\"`%It only takes these tokens here, behind the bar.  You can buy 'em from me for 20 Req each, one at a time.`0\"`n`n\"`#Wait, `ione at a time?`i  Doesn't that mean you have to hang around the machine for ages whenever someone plays it?  Who minds the bar?`0\"`n`n%s shrugs.  \"`%Corporal Punishment talked me into doin' it that way.  He kept on at me about savin' clicks and keepin' things simple for the player.  I didn't understand a bloody word of it, but y'know, he's persuasive.  Manages to talk folks out of walking around with their fists strapped together behind their backs, y'know, stuff like that.`0\" %s stares off into the middle distance for a moment. \"`%Not sure where that weird little habit started.  Seems all the cool kids were doin' it at one point.  But yeah, I sell the tokens to ya one at a time.`0\"  You raise a finger and open your mouth, and %s cuts you off.  \"`%`iTrust me,`i it's just `ieasier`i this way.  Anyway, the coins go in the top, an' then if they go over a target, it'll light up.  Next time a coin goes over that target, it'll fire out some more coins an' maybe light up another target.  So d'you fancy a go, or what?`0\"`n`n",$bk,$bk,$bk,$bk,$bk,$bk,$bk,$bk);
        } else {
                page_header("Clatter");
        }
       
        if (httpget('op')=="start"){
                output("The Clatter machine lurks in the corner, tempting you with promises of easy wealth.");
        }
       
        $woncoins=0;
       
        if (httpget('op')=="play"){
                $session['user']['gold']-=20;
                $lit=unserialize(get_module_pref("lit"));
                if (!isset($lit[1])){
                        $lit = array();
                        $lit[1] = 0;
                        $lit[2] = 0;
                        $lit[3] = 0;
                        $lit[4] = 0;
                        $lit[5] = 0;
                        $lit[6] = 0;
                        $lit[7] = 0;
                }
                $coinsinplay=1;
                $totalcoinsplayed=0;
                output("You plonk down twenty Requisition tokens onto the bar, and blink.  A single Clatter token sits in a beery puddle.  You pick it up and put it into the slot on the top of the machine.`n`n");
                increment_module_setting("played");
                while ($coinsinplay>0){
                        $msg="";
                        $coinsinplay--;
                        $totalcoinsplayed++;
                        $start = mt_rand(0,1);
                        if ($start){
                                $coinposition = 6;
                        } else {
                                $coinposition = 8;
                        }
                       
                        // output("Dropping coin %s`n",$totalcoinsplayed);
                        rawoutput("<table width=100% cellpadding=0 cellspacing=2><tr><td>");
                        if ($totalcoinsplayed==1){
                                $msg.="Your beer-soaked coin clatters down the nailboard, ";
                        } else {
                                $msg.="An electromagnetic slide fires with a satisfying KER-CHUNK, and a new coin appears at the top of the nailboard.  It descends upon its merry way, ";
                        }
                        $bonus=0;
                        for ($i=1;$i<=7;$i++){
                                if (mt_rand(0,1)){
                                        $coinposition++;
                                } else {
                                        $coinposition--;
                                }
                               
                                //bounce coins off edges
                                if ($coinposition>13){
                                        $coinposition=12;
                                }
                                if ($coinposition<1){
                                        $coinposition=2;
                                }
                               
                                //award bonuses
                                if ($i==3 && ($coinposition==3 || $coinposition==11)){
                                        $bonus=1;
                                        $msg.="passing through the first target and closing the switch.  ";
                                        if ($lit[3]){
                                                $msg.="A relay clicks open and turns off the lamp, while incrementing a counter.  `n";
                                                $coinsinplay+=1;
                                                if (!$lit[5]){
                                                        $msg.="The lamp behind the centre target turns on.`n";
                                                }
                                                $lit[5]=1;
                                                $lit[3]=0;
                                        } else {
                                                $msg.="A relay clicks closed and the lamps behind the top set of targets switch on.  The next time a coin goes across either of these targets, a bonus coin will be awarded.`n";
                                                $lit[3]=1;
                                        }
                                } else if (($i==5 && $coinposition==7)){
                                        $bonus=1;
                                        $msg.="passing through the centre target and closing the switch.  ";
                                        if ($lit[5]){
                                                $msg.="A relay clicks open and turns off the lamp, and three clicks from deep inside the machine suggests a counter is incrementing.`n";
                                                $coinsinplay+=3;
                                                if (!$lit[7]){
                                                        $msg.="The lamps behind the lower targets turn on.`n";
                                                }
                                                $lit[7]=1;
                                                $lit[5]=0;
                                        } else {
                                                $msg.="A relay clicks closed and the lamp behind the center target turns on.  The next time a coin goes across this target, three bonus coins will be awarded.`n";
                                                $lit[5]=1;
                                        }
                                } else if (($i==7 && ($coinposition==1 || $coinposition==13))){
                                        if (!$bonus){
                                                $msg.="completely missing the one-bonus and three-bonus targets and falling into one of the side channels.  ";
                                        } else {
                                                $msg.="As a further awesomeness, the coin then drops down one of the side channels.  ";
                                        }
                                        $bonus=1;
                                        if ($lit[7]){
                                                $msg.="A relay clicks open and turns off the lamp, and two clicks from deep inside the machine suggests a counter is incrementing.`n";
                                                $coinsinplay+=2;
                                                if (!$lit[3]){
                                                        $msg.="The lamp behind the center target turns on.`n";
                                                }
                                                $lit[3]=1;
                                                $lit[7]=0;
                                        } else {
                                                $msg.="A relay clicks closed and the lamps behind the bottom set of targets switch on.  The next time a coin goes across either of these targets, two bonus coins will be awarded.`n";
                                                $lit[7]=1;
                                        }
                                }
                                //output image
                                rawoutput("<img src=\"images/clatter/".$i."-".$coinposition."-".$lit[$i].".jpg\"><br />");
                        }// end individual coin drop
                        if ($coinposition==7 && $bonus){
                                $msg.="`nThe coin clatters into the centre channel, and falls into the payout chute.  Immediately a hairy hand from behind the bar grabs it and thrusts twenty Requisition tokens towards you.`n`n";
                                $woncoins++;
                                increment_module_setting("won");
                        } else if ($coinposition==7){
                                $msg.="missing every single target before being returned to you via the Payout chute at the bottom of the machine.  Immediately a hairy hand from behind the bar grabs it and thrusts twenty Requisition tokens towards you.`n`n";
                                $woncoins++;
                                increment_module_setting("won");
                        } else {
                                if (!$bonus){
                                        $msg.="completely failing to do any good whatsoever and simply disappearing into the depths of the machine.  Bah.`n`n";
                                } else {
                                        $msg.="The coin falls into the depths of the machine.`n`n";
                                }
                        }
                        rawoutput("</td><td>");
                        output("%s`n`n",$msg);
                        rawoutput("</td></tr></table>");
                } // end page load
                set_module_pref("lit",serialize($lit));
                $winnings = $woncoins*20;
                $session['user']['gold']+=$winnings;
                if ($winnings){
                        output("`nYou have won a total of %s Requisition tokens this time, minus your 20 Requisition stake.",$winnings);
                        if ($winnings==20){
                                output("  In other words, you broke even.  Huzzah!");
                        }
                } else {
                        output("`nYou didn't win anything this time.");
                }
        }
       
        addnav("Clatter");
        if ($session['user']['gold']>=20){
                addnav("Play Clatter","runmodule.php?module=clatter&op=play");
        } else {
                addnav("You can't afford to gamble right now.","");
        }
        addnav("Walk Away","inn.php");
        page_footer();
}
?>


(yes, I could have done the image creation using GD Libs - but then it'd be more complex putting the reflection of the bar on top of the coin, and it'd result in more server load)

The coins are dispensed (and their routes described) one at a time in the virtual Clatter machine, for the sake of simplicity. In the real version, after a good chain you'd have several coins going down the playfield at once.

And that's how a virtual Clatter machine works!

(there's also a purely mechanical (IE no electricity needed) model that would be possible - but the coin would have to stop at each target and the player would turn a handle to pay out a new coin, like in the old Allwins flick-ball machines)


 
Profile Email Website
Quote
Hairy Mary
 Friday, November 20 2009 @ 10:46 PM UTC  
Forum Improbable Badass
Improbable Badass

Status: offline

Registered: 08/17/08
Posts: 1083

Wow. A fascinating insight into the mechanics of game machines there.
I also rather like the reflection of the Spiderkitty in the glass. I've been wondering what the notices on the
message board are about. Unfortunately, as a midget, I can't read them. Smile


 
Profile Email
Quote
Bernard
 Friday, November 20 2009 @ 11:08 PM UTC  
Forum Improbable Badass
Improbable Badass

Status: offline

Registered: 10/26/08
Posts: 368

In days of yore people like Dan would have been burnt at the stake.


 
Profile Email
Quote
Neeip
 Monday, November 23 2009 @ 12:31 AM UTC  
Forum Newbie
Newbie

Status: offline

Registered: 08/15/09
Posts: 13

DearsweetJesus...
Thank you sir for this awsome new Game, and more ways to throw away my Req! Big Grin
Also, 49 coin Streak! Yes!


 
Profile Email
Quote
omenesia
 Monday, November 23 2009 @ 08:56 AM UTC  
Forum Contender
Contender

Status: offline

Registered: 08/15/09
Posts: 62

I love the detailed info CMJ! I found it fascinating.

Edit: Just went to waste some money on Clatter and have gotten a 13 coin combo, totally worth loosing all the money before to see that! Razz


Lions. Lions the whole way up.
 
Profile Email
Quote
Reverb
 Monday, November 23 2009 @ 05:08 PM UTC  
Forum Improbable Badass
Improbable Badass

Status: offline

Registered: 08/28/09
Posts: 448

Quote by: Bernard

In days of yore people like Dan would have been burnt at the stake.



That could be arranged..

which reminds me, incidentally, that i haven't torched Talky yet either. Granted, i completely forgot why i wanted to do that, but it must have been for a good reason!


"Censure acquits the Raven, but pursues the Dove." "So, that means i'm -always- innocent, right?"
 
Profile Email
Quote
talkydoor
 Monday, November 23 2009 @ 11:59 PM UTC  
Forum Improbable Badass
Improbable Badass

Status: offline

Registered: 09/10/09
Posts: 162


which reminds me, incidentally, that i haven't torched Talky yet either. Granted, i completely forgot why i wanted to do that, but it must have been for a good reason![/p]


Huh? Wha? I heard my name...

Also, loving the game, although I always fail to carry req with me, for fear of getting trapped by the dodgy salesman...


 
Profile Email
Quote
Content generated in: 0.62 seconds
New Topic Post Reply



 All times are UTC. The time is now 01:41 PM.

Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content