01-19-2007, 10:58 AM,
|
|
rookie1
Member
|
Posts: 231
Threads: 32
Joined: Nov 2006
|
|
Use of srand()
There is a srand() in src/particles.cpp. The seed value is fixed as 1337. If I change the seed value to time(), will it cause any problem elsewhere? I'd like to race against random AI cars. It wouldn't feel quite random if the AI car always come in the same sequence.
|
|
01-20-2007, 11:15 AM,
|
|
rookie1
Member
|
Posts: 231
Threads: 32
Joined: Nov 2006
|
|
Just to clear things up, the AI algorithm does not use random value. What I wanted to do is changing the car selection code so every time you race against a random opponent car. And to do that, I need to change the srand() to use a non-fixed seed. I'm thinking of just changing the srand() in particles.cpp instead of calling srand() again.
|
|
01-24-2007, 10:26 AM,
|
|
rookie1
Member
|
Posts: 231
Threads: 32
Joined: Nov 2006
|
|
I'll move the srand() call to main.cpp.
|
|
|