Seed and random seed limitation to 256 ?

Started by kaedorg, December 13, 2013, 04:24:59 am

Previous topic - Next topic

kaedorg

Let me explain why i'm asking this.
Sometimes i start with a project with some old tgc files and i put them together and try to create a new view.
From then, as i don't think the first view could be the best, i try to modify some seeds.
On a project, i try to change the fractal terrain seed. Rather than using the random, i start from 1 and increase until it seems good in the preview window.
Then I make a quick render and i save it with the seed information.
This morning i was doing this and finishing a render with seed 315. Immediately it came to my mind that i saw this view recently.
Checking my other renders i admit that seed 59 and 315 are exactly the same. Not long to see that between 59 and 315 the gap is 256.

So i check with the opening terrain in tg3 seed 119, seed 375 and seed 631 are the same.

Then my question is : is there a useful limitation to 256 and rather than random can we only check between 1 and 256 for any seed to get the more appropriate ?

David

cyphyr

Very interesting find.
We've all noticed that differing seeds seem to sometimes produce the same result. Now we know why.
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)

Dune

That is really striking! Great find indeed, but a rather disconcerting one as well. Just checked of course, and it seems we only have 256 seeds indeed. Mmmmm. Based on color depth of 256?

TheBadger

If its only 256, then couldn't that be documented. I mean for each place there is a seed, then a render of the effect from default?

I had thought that the seeds were basically infinite variety, even if only in subtle ways. But 256 sounds like it could be doucumented by visual example.... Every one take 10 numbers and go?
It has been eaten.

masonspappy

Not sure where exactly you  are inputting your value.   Can you specify a fraction, say 127.123 and get a different result?

Dune

Don't know if fractions work as seed. But input is in the seed text field in a PF. If you enter any number and add x (whole number) times 256, they'll all be the same.

j meyer

Interesting find,indeed!Especially the relation.

jaf

December 13, 2013, 11:33:13 am #7 Last Edit: December 13, 2013, 11:37:07 am by jaf
Gee, I always thought using 666 for a seed would be unique, now I find 154 or 2970 is the same?
Wouldn't that be a bug, if only because clicking the Random Seed but generates up to a five digit integer (not meaning it's limited to 256 -- just misleading)?

[edit] that was a clumsy question on my part.  What I was attempting to say was, if 256 random values is a program constraint, why generate 5 digit numbers?
(19oct19) Ryzen 1800x, 970 EVO 1TB NVME-M.2 SSD, Corsair Vengeance 64GB DDR4 3200 Mem,  EVGA GeForce GTX 1080 Ti FTW3 Graphics 436.48 (02oct19), Win 10 Pro x64, Terragen Frontier 4.4.39 BMark 0:10:18

cyphyr

Remember the seed value is only one aspect of the PF generation.  There's plenty of extra variation that can be added with the rest of the settings. And of course adding two or more either chained or with the merge shader gives near infinite variety.
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)

kaedorg

I completely agree with Richard. Opening this thread didn't mean to reduce the power of TG3.
And if in the opening basic project, there are only 2 seeds (fractal terrain and base colours) which already means 256 x 256 = 65536 possibilities.
We all know that our projects have many more seeds which means an infinite variety. And some variations as scale for example and camera position
don't use seeds.
This 256 trick can just be useful for testing more elements rather than using the random seed button (as fractal terrains or clouds) before choosing your ideal one.

I work a lot by this way and archive all renders with seeds differences. I think it is useful to select the best and sometimes another seed opens a new project and so on ....

TG3 potential is not reduced as it is still infinite.

David

jaf

I wasn't trying to be negative -- just pointing out how misleading those random seed number are.  I just looked at a density shader (cloud fractal shader) and it has the same 256 limitation.  There's always a chance it's a programming error -- maybe an integer cast to a byte, so it's good to question these things.
(19oct19) Ryzen 1800x, 970 EVO 1TB NVME-M.2 SSD, Corsair Vengeance 64GB DDR4 3200 Mem,  EVGA GeForce GTX 1080 Ti FTW3 Graphics 436.48 (02oct19), Win 10 Pro x64, Terragen Frontier 4.4.39 BMark 0:10:18

cyphyr

I have suspected this (or something like this) for a long time. Good to have it confirmed.
It appears to NOT be true of the seed used in populations.
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)

PabloMack

December 13, 2013, 04:16:06 pm #12 Last Edit: December 13, 2013, 05:28:42 pm by PabloMack
Quote from: masonspappy on December 13, 2013, 08:15:38 am
Not sure where exactly you are inputting your value.   Can you specify a fraction, say 127.123 and get a different result?


Seed numbers are always integers and it appears that, sometimes, only their low-order 8-bits are used. I wouldn't assume that every use of a seed number only looks at the low-order 8-bits, though. Seed numbers are used in many places in TG. For those of you who are not programmers, 8-bit numbers go from 0~255 and not from 1~256. 256 is a number that won't fit into 8-bits and is basically zero with the carry-bit (out of the high-order bit) set. One of my favorite expressions is "Real programmers start counting with zero and not one". It was a non-programmer who decided to design a keyboard that starts with 1 (on the left) and ends with 0 (on the right after the 9). Human technology is riddled with such imperfections. No wonder V'ger wanted to destroy us. We are "infesting" this planet. ;)

jaf

Similar to the rotation in populations.  The entry fields default to Minimum Y rotation: 0 and Maximum Y rotation: 360.  I always assumed that meant from zero to, but not including 360, since that would be 360 degrees and an entry of 360 would "wrap around" to zero.  I think that's correct.
(19oct19) Ryzen 1800x, 970 EVO 1TB NVME-M.2 SSD, Corsair Vengeance 64GB DDR4 3200 Mem,  EVGA GeForce GTX 1080 Ti FTW3 Graphics 436.48 (02oct19), Win 10 Pro x64, Terragen Frontier 4.4.39 BMark 0:10:18

PabloMack

December 13, 2013, 07:20:07 pm #14 Last Edit: December 13, 2013, 07:24:45 pm by PabloMack
Yes. 0 and 360 are the same orientation. But in animations you have to be careful because if you key an object at 0 then later at 360 interpolation will be done between the two and the object will rotate between the two key frames. If you were to divide an angle (stored as a float) in degrees by 360.0 then the fraction will describe the orientation of an object and the integral part will imply the number of rotations.