Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Randomizer isn't random?

Archive: 18 posts


Hi guys,

For my upcoming level "Hover Arcade 3D" I want the player to drive over a random set of emitted highway-parts, so it looks like the player drives a diffrent set of roads everytime they play the level. However, it looks like the randomizer just chooses a random order of the road parts and then keeps that order everytime I replay the level (until I tweak the randomizer with the same settings and then go to play mode). However, I cannot find a way to make it emit diffrent orders everytime I replay the level.

I've set the randomizer to 'one at a time' with a time minimum and maximum of 1 seconds, and connected it to four emitters which each emit another highway-part (that will move downwards to create an endless-level effect). What am I doing wrong? :S
2011-03-25 01:51:00

Author:
Unknown User


You could have a randomizer connected to various emitters, each which will emit a randomizer withthe logic you need, that sjould in theory, randomize it every time.

Hope that helps!
2011-03-25 01:59:00

Author:
Silverleon
Posts: 6707


You could have a randomizer connected to various emitters, each which will emit a randomizer withthe logic you need, that sjould in theory, randomize it every time.

Hope that helps!

That's interesting, and could help me prove or disprove my theory on why randomizers aren't random.

There's really nothing random in computer logic, even simple number randomizers just simulate it by using a seed value based on the current clock. It makes it all seem very random because each time the algorithm is applied, there is a different seed value for it to modify.

In LBP, I think that seed is set at time of creation, so as soon as you create the randomizer on the level, the initial seed is set and never changes. It goes through the cycle each time. Emitting them sounds like it could get around this since you are essentially controlling the point of creation of the randomizer, and therefore creating the seeds from that point in time instead of the point where you made the level.

If that is the case, then you could just place an emitter down to emit the randomizer set up to pulse tags each time the level starts. That should reseed it each time.

I think I'm gonna go test this out later and post back.
2011-03-25 02:33:00

Author:
tdarb
Posts: 689


Well uhm..wouldn't the randomizer that spawns the randomizer also cause the same problem 2011-03-25 02:55:00

Author:
Littlebigdude805
Posts: 1924


Well uhm..wouldn't the randomizer that spawns the randomizer also cause the same problem

Like I said, "In theory" it should work, because since its "emitting" a new ranodmizer I believe it WILL have different results, as its emitting a brand new randomizer each time, meaning the result isn't already calculated, but SHOULD be calculated anew every time a new randomizer is emitted.

I think you shouldn't even need to emit more than one randomizer, now that I think about it.
2011-03-25 03:14:00

Author:
Silverleon
Posts: 6707


I don't think that works. I tried that for my Bejeweled level, but it just caused all the gems to be the same colour every time they emitted.2011-03-25 04:21:00

Author:
Yofig
Posts: 288


Ok, I just did some testing on it, and the only way to get a good approximation of randomness would be using player sensors. Have a player sensor that activates then emits the randomizer. Since that will never happen at the exact same moment every time, this will create the appearance of randomness (even though we would know it really isn't). just put a few obstacles between the spawn point and the sensor so that the player never reaches the sensor at the exact same moment.

My testing- I hooked the randomzer up to a display that showed a number for each of four outputs. This remained the same no matter what.

I then set up an emitter that was to be activated as the level started. Although that was different from the first one, the pattern stayed the same each time. changing the offset time on the emitter did effect the resulting pattern.

Lastly I tried having an emitter emit the emitter from the second test. It was different from the others, but the pattern is constant.

Initial conclusions are that the seed value is set based on a concept of level time. The point at which the randomizer appears in the level determines the pattern.

Using what I knew from the first set of tests, I hooked my first emitter into a player sensor. When I varied the times it took the player to get to the sensor by even a small amount, the randomizer did follow a different pattern. If I got there at the exact same moment (press right as soon as I start loading the level), it did indeed hit the same pattern. The solution seems to be to vary the point at which the emitter activates. This appears to be most randomly achieved with a player sensor.
2011-03-25 04:22:00

Author:
tdarb
Posts: 689


Yeah, my guess is that they store the Date of creation, and then use that for the randomizer, instead of creating a new Date every time. Hopefully they will patch it soon... it was marked as acknowledged on GetSatisfaction.2011-03-25 04:24:00

Author:
Yofig
Posts: 288


You wouldn't have to use player sensors. Just build a custom menu into your level, and have the randomizer emitted by the player clicking the "start game" button. Shouldn't be too hard, and should be (almost) random.2011-03-25 05:18:00

Author:
Madafaku
Posts: 738


What I do in my levels to achieve something close to randomness is to have an 1-frame pulser (self-wired NOT-gate) fire continuously into a Randomiser set to Pattern Override.
Then I have external events (like Player Sensors or Tag Sensors) determine wether or not (using AND-gates) the random signal produced in a given instance actually amounts to anything in the level (this could be emission/activation of a specific object from the pool of objects I want randomised).

EDIT: And as Mm is finally aware of this issue by now, we will hopefully see a fix (= truly random randomiser) in the next patch
2011-03-25 11:27:00

Author:
Slaeden-Bob
Posts: 605


I needed to use randomisers for my 'Sackarushi Challenge DEMO', what I found was that the randomizers were re-seeded in play mode, so you may not have to worry. In computing pseudorandom numbers are often seeded from the systems real time clock value through a linear congruential generator (generally only for less demanding applications like games, you wouldn't employ this method for say an online slot machine because at some point the pattern will repeat like a mandlebrot generator) but lets not get too much into that!, what this means is that in simpler generator forms the 'pattern' or random number sequence generated is predetermined by it's seed and only by changing the seed will you change the pattern, this I suspect is why in LBP2 you find the same pattern repeating over & over again in create mode, BUT it would appear that the patterns are re-seeded with each play through in play mode, so as I said you may not have to worry!2011-03-25 11:59:00

Author:
CloaknBlagger
Posts: 78


BUT it would appear that the patterns are re-seeded with each play through in play mode, so as I said you may not have to worry!

Sadly this is not the case
The sequence is seeded upon editing of the Create Mode. As soon as a level containing Randomiser is published, it will (currently) generate the same sequence every time the level is played unless additional measures are taken.
2011-03-25 12:17:00

Author:
Slaeden-Bob
Posts: 605


Thanks for the replies guys! I allready made a menu system for my level, so I'll just connect an emitter to the "play" option, which will spawn a hologram with a randomizer connected to some tags. Each tag will activate an emitter that causes a part of the road to spawn. I guess that should make it random, however I'm affraid that everytime people that go into the level and immediately press "play" will get the same sequence of road-parts, since the seeding of the randomizer is time-based...

Ah well, I'll try it out later today and I'll let you know if it works ^_^
2011-03-25 13:36:00

Author:
Unknown User


Mmm? that is odd, I thought the patterns in my level changed each re-play, I will have to take another look & maybe tweak the logic, bugger! It's easy to change the start and end point of the sequence so that the Randomisers are cycling even before the emitters are activated, for some levels that would be enough, but because the sequence remains unaltered that would be no good as a solution for the OP. Certainly some form of player generated seed seems to be the answer. I am imagining that I may be able to solve it with some kind of Randomiser matrix where one Randomiser sequence is started before the pattern is applied (so sequence start point determined by sensor activation of some kind) and then another is used from a different start point, then both linked to their respective emitters and cycled. This would then mean that the sequences would be mixed from different points each time. Um...so say pattern 1) is 1,2,3,4,5 and pattern 2) is a,b,c,d,e you might have a result of 1,c,2,d,3,e,4,a,5.......or 3,a,4,b,5,c,1,d,2,e ?? may still not be random enough, however What you don't want to do is wire one Randomiser to another just as earlier mentioned. I'm not able to test right now though so it's only a thought for now!2011-03-25 14:00:00

Author:
CloaknBlagger
Posts: 78


When Randomizer was truly random there was a problem in preference in online game, 0.1s randomizer failed to work, when they added this same pattern every time thing it seems the problem was gone2011-03-25 15:55:00

Author:
Shadowriver
Posts: 3991


I thinkl I just got my level randomized... Thanks a lot guys! 2011-03-25 20:22:00

Author:
Unknown User


In that case what was your method? please tell2011-03-25 20:40:00

Author:
CloaknBlagger
Posts: 78


Ok, here it goes.

First of all, there is a menu in my level. As soon as you select "play", there will be a hologram emitted with a microchip on it, that contains a randomizer connected to tags (A).
Then I have a selector that will activate a hologram based on how many points the player scores (B). Inside each hologram are tags that are connected to emitters. Finally, those emitters will emit a piece of road.

http://img695.imageshack.us/img695/5424/aphoto1t.jpg

So what this all does: when the player hits "play", there will be a random sequence of tags activated (one at a time). When the player has reached enough points, the pieces of road will be emitted, one after another. Randomly. So each time they play the level, they will drive on a seemingly different road.

Theoretically, the road should be the same if the player will press the button "play" everytime at the exact same moment. However, I've tested this, and it is very hard to achieve. So it is random enough for me

If you want to know how this exactly plays out in the context of my level, you'll have to wait untill I finish it ^_^
2011-03-26 00:03:00

Author:
Unknown User


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.