Topic

Staff Topic

Glitch Mash

Who has the best Glitch outfit? It's a question that's been troubling me for some time. But finally we can find out for sure!

Glitch Mash

(This is not an officially supported feature - it's a demo of what can be done with the API. It's open source, so you can see how it works.)

Posted 17 months ago by Bees! Subscriber! | Permalink

Replies

  • @Miriamele, I just wish we had jammies in game.. would love that!
    Posted 17 months ago by Joni Mitchell Subscriber! | Permalink
  • Would it be possible to have a link back to the forums please :)
    Posted 17 months ago by Faereluth Subscriber! | Permalink
  • So cute. But it seems like I keep getting the same outfits over and over and never seeing some of the outfits on the top 10.....what gives?
    Posted 17 months ago by Dagnabbit Rabbit Subscriber! | Permalink
  • Bloop!
    (Note: Almost all fez wearing Glitchens get my vote.)
    Posted 17 months ago by Lord Bacon-o Subscriber! | Permalink
  • I entered. Reindeer antlers might be my favorite item right now. <3
    Posted 17 months ago by Luk Subscriber! | Permalink
  • love it, thanks for the entertainment during down-time.
    Posted 17 months ago by Buggerton Bigsby Subscriber! | Permalink
  • Dagnabbit Rabbit: you're more likely to see outfits with fewer votes, so when there aren't many new outfits going in, you'll see the same ones pretty often until they get enough votes.
    Posted 17 months ago by Bees! Subscriber! | Permalink
  • @ Princess Fi: Try this:
    Oxford Cloth Classic Shirt

    Seersucker Blues

    Blue Bunny Slippers

    Add some messy hair and sleepy eyes (no makeup ofcourse) and you're done!
    Posted 17 months ago by Miriamele Subscriber! | Permalink
  • I just love this.. so much fun :DD
    Posted 17 months ago by Joni Mitchell Subscriber! | Permalink
  • @bees! i seem to be getting the same ones over and over, too, but they're not the ones with less votes. they're not on the top list, but the #s next to their names are very high. nutmeg botwin and yark, for example. i would say one of those is in 2 out of 3 of each vote.
    Posted 17 months ago by greenkozi Subscriber! | Permalink
  • Green- that's a great excuse to just vote extra for me ;) 
    Posted 17 months ago by NutMeg Botwin Subscriber! | Permalink
  • Time to look at that source code. My statistical work with gaming is population distribution.I might know a trick or two :)

    Update edit: I see you are using the Smarty template library. I considered that once... Are you using that for these Glitch forums and pages? I've been seeing validations errors all over the place! (checking the rendered Glitch Mash pages now... visual check of common errors...clean).
    Posted 17 months ago by Fokian Fool Subscriber! | Permalink
  • This is obviously bugged.  I'm nowhere to be found on the top outfits page.
    Posted 17 months ago by Vicereine Linnæa Subscriber! | Permalink
  • Hey, I was #2 right after the last test and now I'm no where to be seen!  Where's the love people??  I do see, however, that comely Kevbob has maintained his stance quite well!  Kilts rock :DD

    New look now available.. http://glitchmash.iamcal.com/you/?imported=1
    TY Bees :)    Actually.. I like my original attire a bit better.. but wth :)
    Posted 17 months ago by Joni Mitchell Subscriber! | Permalink
  • Sorry.. double post.. :(
    Posted 17 months ago by Joni Mitchell Subscriber! | Permalink
  • Ok. I've been typing this code for about 4 1/2 hours. I did it in a single session. I don't have anything set up to debug and test it. But here is a random candidate function that reduces "clustering", the tendency of a random roll to come up many times close together. Still an even distribution statistically, but the random roll is adaptive. I hope this editor can handle this because I don't feel like uploading the file to be hosted somewhere. I'm too damn tired! (after 5am here).
    <?php
    function random_candidates($voter,&$candidates,&$first,&$second)
    {
     if (!isset($voter)) return FALSE; // Check to see if we have a voter.
     
     if (!isset($candidates)) return FAlSE; // Check to see if there is even any candidates to select from.
     
     $candidatescount=count($candidates); // Get the number of available candidates.
     
     if ($candidatescount<2) return FALSE; // We have to have at least two people to vote for.
     
     if (!array_key_exists($voter,$candidates)) return FALSE; // Make sure our voter is among the pool of candidates.
     
     if (!array_key_exists('choices',$candidates[$voter])) // Make sure our voter has an up-to-date pool of candidates to choose from.
     {
      // If they don't our life is somewhat easier.
      // First get the list of candidates.
      $list=array_keys($candidates);
      // Next create their pool of candidates with each candidate's distribution parameter fields set to the current count of the number of candidates.
      // The 'count' field is a decreasing numeric value that controls the particular candidate chances of being randomly selected.
      // The 'max' field is for resetting the 'count' value as well as making adjustments if the size of the candidate pool changes.
      $candidates[$voter]=array('choices'=>array_fill_keys($list,array('count'=>$candidatescount,'max'=>$candidatescount)));
     
      // At this point the distribution of candidates is equal so the random selection process is at its simplest.
      // Randomly select the first candidate.
      $first=array_rand($list);
     
      // Remove that candidate from the available pool. (Bad form here, but I like one-liners :) )
      foreach($list as $key=>&$value) if($value==$first) unset($list[$key]);
     
      // Randomly select our second candidate from the remaining list.
      $second=array_rand($list);
     
      // Adjust the voter's distribution parameters.
      $candidates[$voter]['choices'][$first]['count']--; // Decrease the distribution parameter of the first candidate by one.
      $candidates[$voter]['choices'][$second]['count']--; // Decrease the distribution parameter of the second candidate by one.
      // I just LOVE these one-line pieces of code. Did I mention that? :D
     
      return TRUE; // Return indicating we have definite candidates to choose from.
     }
     
     // Ok. Things are going to get a little hairier since we don't have the luxury of using a handy array function to help us with our selections.
     
     // First, make sure our parameter fields reflect the number of candidates accurately.
     // Get our pool of candidates specific for the current voter.
     $pool=$candidates[$voter]['choices'];
     
     // Begin calculating the upper bound of our random roll. We are just using the loop that's coming to do some extra work.;
     $upperbound=0;
     
     // Go through each member of the candidate pool and make sure it's up to date. Add the final count parameter field to our upper bound for our roll.
     // We also build a list of candidates whose adjusted count is not equal to zero.
     foreach($pool as $candidate => $statistics)
     {
      if($statistics['max']!=$candidatescount) // Is the maximum distribution the same as the total number of candidates?
      {
       // If not, adjust the current count by the difference between the values but don't let the count drop below zero.
       $statistics['count']=max(0, $statistics['count']+$candidatescount-$statistics['max']);
       // Update the maximum distribution to the new number of candidates;
       $statistics['max']=$candidatescount;
      }
      // If the candidate's count parameter field is non-zero we add it to our list of statistically available candidates.
      // We associate that candidate with the lower bound of its statistical roll range.
      if($statistics['count']!=0)
      {
       $list[$candidate]=array('low'=>$upperbound+1, //Set our list entry for that candidate to the right statistical range based on the current roll bound.
                               'high'=>$upperbound+$statistics['count']+1);
     
       // Now bump the upper bound by the count since we know it's not a zero value.
       $upperbound+=$statistics['count'];
      } 
     }
     
     // Ok. Our statistical parameters have been updated to reflect the size of our candidate pool and we have an upper bound of our random roll.
     // Now just check if we have more than two possible candidates. If not we proceed as if we have a fresh pool of candidates.
     if(count($list)<2)
     {
      // Yes, I copied and pasted :D
      // First get the list of candidates.
      $list=array_keys($candidates);
      // Next create their pool of candidates with each candidate's distribution parameter fields set to the current count of the number of candidates.
      // The 'count' field is a decreasing numeric value that controls the particular candidate chances of being randomly selected.
      // The 'max' field is for resetting the 'count' value as well as making adjustments if the size of the candidate pool changes.
      $candidates[$voter]=array('choices'=>array_fill_keys($list,array('count'=>$candidatescount,'max'=>$candidatescount)));
     
      // At this point the distribution of candidates is equal so the random selection process is at its simplest.
      // Randomly select the first candidate.
      $first=array_rand($list);
     
      // Remove that candidate from the available pool. (Bad form here, but I like one-liners :) )
      foreach($list as $key=>&$value) if($value==$first) unset($list[$key]);
     
      // Randomly select our second candidate from the remaining list.
      $second=array_rand($list);
     
      // Adjust the voter's distribution parameters.
      $candidates[$voter]['choices'][$first]['count']--; // Decrease the distribution parameter of the first candidate by one.
      $candidates[$voter]['choices'][$second]['count']--; // Decrease the distribution parameter of the second candidate by one.
      // I just LOVE these one-line pieces of code. Did I mention that? :D
     
      return TRUE; // Return indicating we have definite candidates to choose from.
     }
     
     if(count($list)>2) // check if we have more than two choices
     {
      // This is the most complicated situation, unfortunately it's going to be the most common. We have more than two candidates with a likely unequal
      // distribution. Oh. Joy.
      // First randomly generate a value in our distribution range (from 1 to the upper bound we calculated earlier).
      $roll=rand(1,$upperbound);
     
      //Select our first pick based on our random value.
      foreach($list as $candidate=>$range) // Loop through the candidates' list.
      {
       if($roll>=$range['low']&&$roll<$range['high']) // Does random value fall within the current candidate's range?
       { // If it does do the following:
        $first=$candidate; // Set the firt pick to the current candidate.
        $low=$range['low']; // Save the lower bound of the current candidate's range.
        $high=$range['high']; // Save the upper bound of the current candidate's range.
        $count=$high-$low; // Save the range itself.
        $candidates[$voter]['choices'][$first]['count']--; // Decrease the distribution parameter of the first candidate by one.
        break; // Break out of this loop. We found what we are looking for and are ready for the next candidate.
       }
      }
     
      // Ok. Now generate a new random value. Reduce the upper bound of our total range by the first candidate's range.
      $roll=rand(1,$upperbound-$count);
     
      // Make sure our new random value doesn't fall in the range of the previously found candidate.
      if($roll>=$low&&$roll<$high) $roll+=$count;
     
      // Same search method as before, but we'll be automatically skipping the range of the first candidate.
      foreach($list as $candidate=>$range) // Loop through the candidates' list.
      {
       if($roll>=$range['low']&&$roll<$range['high']) // Does random value fall within the current candidate's range?
       { // If it does do the following:
        $second=$candidate; // Set the firt pick to the current candidate.
        $candidates[$voter]['choices'][$second]['count']--; // Decrease the distribution parameter of the second candidate by one.
        break; // Break out of this loop. We found what we are looking for and are ready to exit.
       }
      }
     }
     else
     {
      // We only have two choices so no need to roll.
      $first=key(array_keys($list)); // Get the first candidate from the list.
      $second=key(array_reverse(array_keys($list))); // Get the second and final candidate from the list;
     
      //Now reset the voter's candidates list for next time by zeroing out the counts of the remaining candidates.
      $candidates[$voter]['choices'][$first]['count']=0; // Zero the distribution parameter of the first candidate.
      $candidates[$voter]['choices'][$second]['count']=0; // Zero the distribution parameter of the second candidate.
     }
     
     return TRUE; // Return indicating we have definite candidates to choose from.
    }
    ?>
    Posted 17 months ago by Fokian Fool Subscriber! | Permalink
  • Now that I'm (mostly) awake - did I do that!? I was wondering why this thread has been quiet for six hours. I think I scared people off. I'll clean it up and do a simple hosting of it somewhere (no, GithHub and the rest are not "simple" to the average person).
    Posted 17 months ago by Fokian Fool Subscriber! | Permalink
  • Uh, what?

    Sometimes I worry that you people with the computer talk and equations are really aliens.
    Posted 17 months ago by Laurali Subscriber! | Permalink
  • (I think they are onto us)
    Posted 17 months ago by Fokian Fool Subscriber! | Permalink
  • I have a question: if you change your Glitch outfit will it change in the Mash?  Can you upload more than one outfit or will your last outfit be replaced?
    Posted 17 months ago by Laurali Subscriber! | Permalink
  • Laurali
    You have to manually update it, go to Glitch Mash, Your Outfits, there is a link to update your new outfit for voting purposes. Your old outfit will be saved but not voted on until you make it active again.
    Posted 17 months ago by Dagnabbit Rabbit Subscriber! | Permalink
  • @Laurali You can have multiple outfits there, and switch which one is active.
    Posted 17 months ago by Pomegrandy Subscriber! | Permalink
  • Ok.  When you add a new outfit is it like starting with 0 votes?
    Posted 17 months ago by Laurali Subscriber! | Permalink
  • Sounds like it. I haven't delved that deep into the code (yet).
    Posted 17 months ago by Fokian Fool Subscriber! | Permalink
  • yes laurali. exept its only for that outfit. not your old ones.
    Posted 17 months ago by GiaTori Subscriber! | Permalink
  • Thanks all!
    Posted 17 months ago by Laurali Subscriber! | Permalink
  • Need to do updates with that above code :) At least in the hospital I have time enough to do it!
    Posted 17 months ago by Fokian Fool Subscriber! | Permalink
  • H-m-m-m Glitch Mash acting glitchy...my cerrent active glitch outfit is at 71%. Top one on list is 67%, but I'm not on list at all.
    Posted 17 months ago by GreyGoose Subscriber! | Permalink
  • Rachel, I see your outfit.
    Posted 17 months ago by MaryLiLamb Subscriber! | Permalink
  • Oh! Thx for letting me know, Mary. I will try again:)

    Yep, it's there:)
    Posted 17 months ago by GreyGoose Subscriber! | Permalink
  • It would be nice if it was possible to remove outfits instead of only uploading?
    I wasnt happy with some of  them (in my pyama with makeup still on, that's not good!) so added the correct look, but the wrong ones are cluttering the screen :P
    Posted 17 months ago by Miriamele Subscriber! | Permalink
  • +1 to be able to remove outfits from our lists
    Posted 17 months ago by b3achy Subscriber! | Permalink
  • Meh. Let me look at the rest of the source code. Maybe I can write something up quick tonight. I'm tempted to go HTML 5 all the way. Acceptable?
    Posted 17 months ago by Fokian Fool Subscriber! | Permalink
  • Go all the way? With the nurses? And who is HotMale5?
    Posted 17 months ago by Miriamele Subscriber! | Permalink
  • LOL!!!! That's. Just. Wrong.

    Still hilarious. :p
    Posted 17 months ago by Fokian Fool Subscriber! | Permalink
  • Woohoo Im number one....lol who would have thought a simple summery dress & sandles would plz so easily! Shall enjoy while it last (which doubt will b for long!) :)
    Posted 17 months ago by BumbleBeez Subscriber! | Permalink
  • bump....just because it's something to do while waiting for next test---lol
    Posted 17 months ago by GreyGoose Subscriber! | Permalink
  • I just now tried this--It's more fun than I thought it would be the way it's set up. Cool :)
    Posted 17 months ago by Shepherdmoon Subscriber! | Permalink
  • I'm still playing with it. I realized a bug in my above pasted code, but I don't care :) I'm having too much fun with the current version. Any time I open a browser I go there.
    Posted 17 months ago by Fokian Fool Subscriber! | Permalink
  • Bump because I think this is fun and want to be able to find it again...
    Posted 17 months ago by Audaria Subscriber! | Permalink
  • Bumpity bump
    Posted 17 months ago by Stormy Weather Subscriber! | Permalink
  • +1 to making this a "Hot Topic" sticky.
    Posted 17 months ago by Fokian Fool Subscriber! | Permalink
  • Seriously addictive. So many good outfits!
    Posted 17 months ago by Skwid Subscriber! | Permalink
  • I wish there was a way I could remove some of my outfits that I no longer want votes on. 
    Other than that, it's great. I like seeing all the different outfits and wondering, "what were these people thinking to put this with that?"  =P
    Posted 17 months ago by Zany Serendipity Subscriber! | Permalink
  • I did notice I got a lot of the same outfits to vote on, even the same 2 outfits to choose from.

    The outcome of the votes is meaningless. It is fun though, but not a good reflection of which outfit is liked the most. (If outfit A shows up more then outfit B, A has a much bigger chance of getting lots of positive votes while B only gets a few). Also, I can vote multiple times on the same choice of outfits.
    e.g. I see A and B, and I vote for A. A few votes later I see A and B again, and again I vote for A.
    To the extreme: if this happened 50 times, and I was the only voter, A would have 100% yes (50 votes out of 50) and B zero.

    Then someone else comes and votes just once, for B.
    A has 98%, 50 votes out of 51.
    B has 2%, 1 vote out of 51.

    A more honest outcome would be if the amount of votes was also filtered by the number of different voters. So at the last situation both A and B should have a ranking of 50%.

    ..30 min later...

    I tried to get an equation to make it work (need to calculate/use weighing factors, like number of total voteRs and number of total votes and do some fancy stuff with that, but too tired to figure it out :p
    Posted 17 months ago by Miriamele Subscriber! | Permalink
  • bump
    Posted 17 months ago by GreyGoose Subscriber! | Permalink
  • bump for the bored glitchers...
    Posted 16 months ago by b3achy Subscriber! | Permalink
  • This was fun.
    Posted 16 months ago by Gassy Jack Subscriber! | Permalink
  • I love this app.  I agree it would be helpful to remove outfits from our list.  Also, is there any way to know how many outfits have entered and how often you've voted?  Today I felt like I voted 50 times for the same outfit!
    Posted 16 months ago by Cat A. Tonic Subscriber! | Permalink
  • bump
    Posted 16 months ago by marycontrary Subscriber! | Permalink