More Awesome Than You!

TS2: Burnination => The Podium => Topic started by: Oddysey on 2005 July 18, 15:05:33



Title: Multiple Pollination Technicians Hack
Post by: Oddysey on 2005 July 18, 15:05:33
For anyone familiar with fwiffo's original, I have a modification that chooses from eight PTs. I'm going to post it on MTS2 as soon as I get permission from fwiffo, but in the mean time, does anyone know a better, more efficient way to choose between eight or more possibilities than coin flips? Right now it takes 7 lines of code. More would require around 15 lines. I know very little about simantics, but I figured there might be someone here who would have an idea of what the proper command would be. I'd like to be able to use around 20 PTs in my game, at least eventually, if it's not *too* insane.


Title: Re: Multiple Pollination Technicians Hack
Post by: J. M. Pescado on 2005 July 18, 15:07:51
Err, well, that depends. If you're simply iteratively going down the list and want to make sure you select one in a single pass? No, not really. Otherwise, you could run a two-pass scheme: One pass to count the number of PTs you have, then do a Random call. Alternatively, you could get really fancy, and try to delve into the messy and ugly realm of Array Operations, so you assemble them into an Array for a single pass, and then randomly select by index....tricky stuff.


Title: Re: Multiple Pollination Technicians Hack
Post by: Oddysey on 2005 July 18, 15:10:49
Hmm. Well, considering that I have no skill, and never did really understand arrays even in BASIC, I think I'll just stick with coinflips until I get a better handle on things. Thanks.


Title: Re: Multiple Pollination Technicians Hack
Post by: J. M. Pescado on 2005 July 18, 15:18:02
Well, an artifact of using coinflips is that there's a cascade effect in pollination technicians:

For instance, if you flip a coin to decide each time, the first pollination technician has a 50% chance of being chosen, the next one has a 50% chance for a 25% chance that this one is chosen, the third one has another 50% chance, which comes down to 12.5%, and then the fourth one (assuming 4) is the fallback option, so gets the remaining difference, 12.5%.

This, of course, means there's a clear hierarchy of pollination technicians here.


Title: Re: Multiple Pollination Technicians Hack
Post by: Oddysey on 2005 July 18, 15:21:24
Except that the way it's set up, coinflip A choose between coinflip B and coinflip C, coinflip B and C choose between coinflips D, E, F and G, respectively, and those coinflips each choose between two PTs. It requires a power of two, but it gets a roughly even distribution, to my knowledge.