Jump to content
  • 0

Random numbers in OoT?


DeathBasket
 Share

Question

5 answers to this question

Recommended Posts

  • 0

That might be good to look at in free play, thanks, but if Link isn't spawned then they'd all be zeroes. At least one thing I was thinking of trying out would be in a situation where Link is not present and all actors on the map would be controlled by one main actor, so position/rotation would largely be constant. I could try using z-target arrow coordinates though, as they seem to be changing every frame, or maybe have a function that will put 'random' numbers at a certain address and then read them from there. I will see what I can find first and then what would be the best way to do it.

Anyway, thanks for the suggestion.

Link to comment
Share on other sites

  • 0

You could try building your own random numbers function.

 

I know of one method in C++ that uses the "ctime" header file as a seed for an algorithm which seemingly generates random numbers. The time is always changing so there are different results each time. You could also give certain ranges as to how little or how big of a number is generated.

 

In OoT's case, you could take the "Hyrule Time" value as the seed and then optomize the common random number generator to be used with OoT's engine.

 

Here's the info I first watched a couple of years ago on random numbers and the header files that are used (in C++):

http://www.youtube.com/watch?nomobile=1&v=PZZUJ1fxG04

Link to comment
Share on other sites

  • 0
Guest sakura

The only reason I didn't pitch in to this thread is because I don't remember the details, but seriously, don't go writing a custom random numbers function when it's already built in to the game. To the best of my recollection, it's done based on part of how long the game has been running, which is kept track of. I'm OoT obviously has some way to generate random numbers already, I'm sure you can find a function for it.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.