Banner
Views: 236,766,557
Time: 2013-05-25 06:30:32 PM
24 users online: Alcaro, o BlackEagle766, o BZM, o Doopy Buckride, Dylancd5010, Egadd, ErikAlay, Fierce Deity Manuz OW Hacker, HyperMario, Ice Man, leod, Lightvayne, Lui37, MarioBros980, o Mippish, o MVS, notgoodwithusernames, phenolatukas, ShadowDragon121, silverthundr, Sokobansolver, thefallingninja, o Tokiko, o Undy - Guests: 34 - Bots: 12Users: 22,892 (1,286 active)
Latest: dragon8371
Tip: Unique level names aren't necessary, but they're a plus.
Random Number Generator
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Random Number Generator
Pages: « 1 »
I need one.

This one by 1024 is perfect, because you can do a random value from x-y. However, it's based off SMW's, and thus doesn't really give a good random value. Inserting LSRs/ASLs and/or stuff involving $13/$14 will not help because the value MUST be between two values in my case (any # 1 to x)

Help?
SMW's random number generator has a reputation of sucking, but it's also often misused as well. $148B, which is commonly used as a random number, is the internal state of the RNG, not the output.
Use $148D instead.
My personal RNG throws in the entire scratch RAM and a bunch of other often changing values (like mario's x/y). Works pretty well.

Anywho if you need a number from 0 to X, just use the multiplication register and times your RNG's output by X + 1. Then take the high byte of the multiplication output. Boom, any number between 0 and whatever.
You can try this one. It's basically a modified version of ALTTP's, but it works pretty good.
Combining wiiqertyuiop's with 1024's seems to give decent values. I might add in more to the mix if I feel it's inadequate.

Thanks!
Look at several sprites already submitted. Depending on what you want to do it should you could even look at the Lemmy/Wendy disassembly
Pages: « 1 »
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Random Number Generator

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2013 - SMW Central
Legal Information - Link To Us


Total queries: 27

Menu