Random Logic?

    StormWing0

    Leads the Storm
    Joined
    Jun 26, 2015
    Messages
    2,126
    Reaction score
    316
    • Community Content - Bronze 1
    Just wondering if anyone has been working on some random logic meaning coming up with random numbers through logic?


    This would be handy for situations like say wanting a random number of activation blocks to be turned on at a given time and a few other things.

    The whole reason I'm asking is because it would be rather helpful for a multi-direction push clock I'm thinking of building to make it far less predictable.
     

    Jaaskinal

    ¯\_(ツ)_/¯
    Joined
    Jan 19, 2014
    Messages
    1,377
    Reaction score
    646
    • Legacy Citizen 4
    • Wired for Logic Gold
    • Thinking Positive
    it's very difficult to create random numbers from a logical system.
     
    Joined
    Jan 31, 2015
    Messages
    53
    Reaction score
    2
    • Purchased!
    while not entirely random, this would be hard to predict the output, you could use rotator blocks of varying speeds to control the activation of buttons which you could save into a binary signal for your number output based on the rotation of another rotator block set differently to all of the inputs.

    Yes this would produce sequential numbers, however it would be particularly hard to predict, and the sequence could be quite long
     

    StormWing0

    Leads the Storm
    Joined
    Jun 26, 2015
    Messages
    2,126
    Reaction score
    316
    • Community Content - Bronze 1
    hmm Now we're starting to think up ways to do it. Keep it up guys. :)
     

    Tunk

    Who's idea was this?
    Joined
    Sep 8, 2013
    Messages
    363
    Reaction score
    153
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen 4
    With starmade you are likely to have to rely on physical systems (eg rotator blocks) or a PRNG in logic to get usable randomness.
    A feedback register would probably be one of the simplest to implement.
     
    Joined
    Jan 18, 2015
    Messages
    41
    Reaction score
    7
    While there is no way to derive random numbers from a purely logical system, (and for that matter, maybe not if the universe's true mechanizations were to be revealed either), there is an interesting solution that I might be able to present...

    Step 1) Find an object. Preferably an asteroid, as those are neutral and can't fight back.
    Step 2) Buy tons of area triggers. You'll need these for the random numbers.
    Step 3) Buy tons of wireless logic modules.
    Step 4) Buy tons of push effect computers.
    Step 5) Make Some AI ships (about as many as you'd need for your circuit's bus width, but it's totally up to you if you want to use more or less).
    Step 6) Attach area triggers to AI ships, preferably a fair distance away so that the area triggers have about a 50/50 chance of passing through the object from 'Step 1'.
    Step 7) Attach wireless logic modules to AI ships.
    Step 8) Attach wireless logic modules to the circuit/structure where the random numbers are required.
    Step 9) Attach push effect computers to the AI ships, with the computers facing sideways.
    Step 9) Make AI ships target the object that was found in 'Step 1'.
    Step 10) Enjoy your well-made pseudo-pseudo-random number generator.

    This works well based on the principle that you changed the initial conditions on the ships so that they don't have fixed, predictable orbits. If you want to make it work better, then just get in the way of one of them :). If you want to make it work even better, put up an array of area triggers a bit out from the side of a ship that you control, and pilot it near the object in question with each area trigger connected to a different controller, so that the randomness is literally coming out of your keyboard and mouse. To take it even further, set up a hashing algorithm that mixes the inputs from the area triggers so that it has a random feel and appearance to it.

    By the way, what are you going to use this for, specifically? I'm curious as to how the would accomplish some task in the game...

    Yours truly, that guy who's planning on making a computer in starmade with a clock speed of more than 2Hz.
     

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    Yeah, even the most advanced "random" number generators are completely predictable if you know their logic and their inputs. Most use things that are incredibly difficult to predict exactly at any given moment (like the system time measured in nanoseconds) as the seed number, which then filters through the algorithms to come up with the final outcome. Some really fancy ones even use things like a heat sensor on the CPU to use the exact temperature of the chip as the seed number (since as an analog source, it is as close to truly random as you can get inside of a computer case).

    You could probably get a pretty good approximation of it though by doing wheels within wheels, as in have a rotator block with an activator attached to get the signal from it. Combine several of those with different speeds, and then OR them all together. You run enough of those into a single OR, and you should get a pretty chaotic looking output from it. Trick would be to keep the rotators turning slowly enough that you don't end up with a signal thats almost always on, and not so slowly that you get a signal thats almost never on.

    If you want to get even fancier, you could have banks of these feeding into an array of activators so that you'd have say a 4 bit block that is constantly changing values, and then logic those activators out in binary to activate different things (like a binary 3 turns on a push beam, a binary 7 fires a stop beam, etc).

    You'd construct the logic to recognize binary by having an AND going into the ones, and an AND->NOT going into the zeroes, then AND those two together. You'd do that for every binary combination for the size of your register.

    It would get big pretty fast, but it would be really random looking.
    [DOUBLEPOST=1438872988,1438872375][/DOUBLEPOST]Quickly scribbled and simplified version of what I said above, for the visual types.
     

    Attachments

    Joined
    Jan 18, 2015
    Messages
    41
    Reaction score
    7
    The problem is that that's still predictable, albeit after a long time. I would also recommend using an XOR or XNOR gate :).

    Ah ha! Just had an idea. Go to a secluded sector, set up a docked entity/ship encasing a main ship except for one block in the center, attach a missile-missile computer system to the main ship, attach a bunch of area triggers to the docked entity, fire, and get a signal. Note: this will probably require some shielding. That'll make some random noise, with the only problem being that I don't know if you'll get consistent results or not.

    Either that or you could set up a race condition with some logic.
    Wiki page: https://en.wikipedia.org/wiki/Race_condition
     

    StormWing0

    Leads the Storm
    Joined
    Jun 26, 2015
    Messages
    2,126
    Reaction score
    316
    • Community Content - Bronze 1
    Enemy detector in the content section would be easier to use and cause less lag due to number of blocks. XD
     

    AtraUnam

    Maiden of crashes
    Joined
    Oct 15, 2013
    Messages
    1,120
    Reaction score
    866
    • Railman Gold
    • Competition Winner - Small Fleets
    • Wired for Logic Gold
    Gonna have a try at a decent pseudo-random number generator, might get some other decent logic circuits out of it too.

    Edit: Ok I worked out a way that doesn't use rotors but it involves an 8 bit logic counter and I'm not making one of those just for this.
     
    Last edited: