Specify seed for random

New releases and general discussions.

Post » Tue Apr 21, 2009 1:55 pm

Random events can be annoying to reproduce...
I propose adding another parameter to the random(x) function (or another function seedrandom(x,y)) where you can specify the seed used to generate the random number... so that random(5,1053908) would give a random number up to 5 and would always be equal to another random(5,1053908)

This could have many uses:

In an RPG for item drops, so that at the start of the game it sets the character's 'random_seed' to random(4200000000) then when generating random drops it uses seedrandom(420,'random_seed') or seedrandom(420,'random_seed'+4200757) or whatever. This would mean the character wouldn't be able to open a chest, be unhappy with the items, load, and open the chest again obtaining better items (an exploit that is currently very hard to stop), but would be stuck with the awful items.

I was making a game that stored your total damage to enemies as a statistic you could see at the end of the level, but some damage was random. I had events that added for example 4+random(20) to enemydamage, but i wanted to add the same random value to a global variable. The way I had to do this was make a new variable and set it to 4+random(20), then add this value to both of the events. It worked, however it would've been much simpler to add 4+seedrandom(20,tickcount) to both.

If you made a random level generator, (essentially based on random(x) events), you could instead make it be based on seedrandom(x,y) where y can either be random(95823858940) or inputted manually. This way if you wanted to save the map all you'd need to do is save the value of y.

It's also annoying being unable to reproduce random events for replays etc.
There are probably way more uses than just these.

Hopefully this is viable, I'm pretty sure people would find it useful occasionally.
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Tue Apr 21, 2009 5:44 pm

i concur, this would be useful. I was thinking of making my own random number function but it appears to be a lot more complicated than i anticipated. :mrgreen:
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Thu Apr 23, 2009 8:49 pm

is this doable? can I add it to the tracker?
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Thu Apr 23, 2009 9:21 pm

I think this would be useful as well
one example was that random star map generator
I could have only tracked a few stars at a time
and still been able to make a huge level where you would see the stars you passed if you went back to look for them
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Post » Sun Apr 26, 2009 10:38 am

I'd say throw it on anyway... it's a bloody good idea and I can't see the men in red hats saying no to it.

If it's a case of impossibility (which I'm sure it won't be with the combined power of Rich, Ash, and Dave...) then they will just close the ticket on it.

"With your powers combined.... I AM CAPTAIN ASHAVICH!"

"GOOOO ASHAVICH!"


-_- nvm

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Sun Apr 26, 2009 11:03 am

Put it on the tracker, doesn't sound hard at all.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Mon Oct 19, 2009 3:17 am

Hello :) Is this happening?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Oct 22, 2009 9:39 pm

Check out the "S" thread under construct discussion forum, that plugin has a seed-based randomizer.
B
2
G
3
Posts: 15
Reputation: 880

Post » Sun Oct 25, 2009 8:31 am

Hello, Will this feature push through? I vote that it be...
B
1
G
3
Posts: 1
Reputation: 827

Post » Sun Oct 25, 2009 11:03 am

the 's' plugin has a random seed feature
also, the perlin noise plugin is made for another type of seeded random
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests