More Awesome Than You!
Welcome, Guest. Please login or register.
2024 November 22, 21:22:34

Login with username, password and session length
Search:     Advanced search
540287 Posts in 18067 Topics by 6545 Members
Latest Member: cincinancy
* Home Help Search Login Register
+  More Awesome Than You!
|-+  TS2: Burnination
| |-+  The Podium
| | |-+  Multiple Pollination Technicians Hack
0 Members and 3 Chinese Bots are viewing this topic. « previous next »
Pages: [1] THANKS THIS IS GREAT Print
Author Topic: Multiple Pollination Technicians Hack  (Read 9312 times)
Oddysey
Nitwitted Nuisance
***
Posts: 861


Robotic Baby Harp Seal!


View Profile
Multiple Pollination Technicians Hack
« on: 2005 July 18, 15:05:33 »
THANKS THIS IS GREAT

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.
Logged
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Multiple Pollination Technicians Hack
« Reply #1 on: 2005 July 18, 15:07:51 »
THANKS THIS IS GREAT

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.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
Oddysey
Nitwitted Nuisance
***
Posts: 861


Robotic Baby Harp Seal!


View Profile
Re: Multiple Pollination Technicians Hack
« Reply #2 on: 2005 July 18, 15:10:49 »
THANKS THIS IS GREAT

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.
Logged
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Multiple Pollination Technicians Hack
« Reply #3 on: 2005 July 18, 15:18:02 »
THANKS THIS IS GREAT

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.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
Oddysey
Nitwitted Nuisance
***
Posts: 861


Robotic Baby Harp Seal!


View Profile
Re: Multiple Pollination Technicians Hack
« Reply #4 on: 2005 July 18, 15:21:24 »
THANKS THIS IS GREAT

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.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.061 seconds with 20 queries.