Banner
Views: 236,762,772
Time: 2013-05-25 06:03:03 PM
25 users online: Alcaro, AxemJinx, Dark Mario Bros, o Doopy Buckride, dragon8371, Egadd, EvilGuy0613, Falconpunch, HyperMario, o imamelia, o K3fka, Latios, LimeMaster92, Lui37, MaxodeX, o Mippish, o MVS, Pixels, Purple Rex, RaindropDry, Reaper, SMLink64, Tarek701, Usetheforce, o Yoshi Master - Guests: 41 - Bots: 13Users: 22,892 (1,287 active)
Latest: dragon8371
Tip: Avoid making large, flat, boring stretches of land. Vary up the architecture and spritework in your levels.
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: 29

Menu