I am wondering about number generator algorithms which are used in video games and other things that require randomness in computer programs. As far as I understand it's a function that creates a sequence. But you always need to pick a first number to start the sequence. You can save the current number of the sequence in memory. But how to pick a first number and what people usually pick. Is it something like the current date and time measured in nano seconds? Or is just some fixed spot in memory, that is varying a lot? For example some spot in the RAM?
The reason I ask this question in the mathematics section is that I'm not sure if the choice can maintain randomness (or as close to it as possible) in a mathematical sense.
To address your question as to whether specific choice of seed value can affect the randomness of a RNG, many random generators use a linear congruential sequence in which we derive $X_{n+1}$ from $X_{n}$ by calculating $$X_{n+1} = (aX_n + c)\pmod m$$ where $a$, $c$, and $m$ are selected constants.
This sequence will always be periodic (since there are only $m$ possible values of $X_n$). It is possible in general that different choices of $X_0$ will generate sequences with different periods. However, we can choose $a$, $c$, and $m$ such that the period length is $m$, meaning that every possible choice of $X_0$ must lie in this $m$-cycle. According to Knuth in Vol. 2 of The Art of Computer Programming, a linear congruential sequence has period length if and only if
Now we are free to choose $X_0$ to be whatever we want and the sequence will not degenerate into a short cycle. Of course, the sequence still needs to pass other tests for "randomness". For example, the sequence $$1, 2, 3,\ldots, m - 1, 0, 1, 2, \ldots$$ has period length $m$ but we would hesitate to call it random. There are already constants that are widely known to generate quite good sequences (passing a wide array of statistical and empirical tests), so if you're just worrying about choice of seed, you're right that the current date and time is quite safe. If a program is run multiple times, starting $X_0$ at the value attained by $X_n$ in the last run is also quite safe.