Posts for MetalStorm

Experienced Forum User
Joined: 4/6/2013
Posts: 7
Wow, thank you everybody for your responses! I think now I have a better idea of what I can try now. I gave up on trying to quote everything I found helpful from your posts since I thought just about everything was helpful. It does seem that at the very least understanding where the RNG is and how to manipulate it is important. However, a couple quotes did stand out to me.
Derakon wrote:
(I believe Lua scripts can register to be informed of when a given memory address changes, which will help).
I think I read that you could do that in the help document for FCEUX. Thanks Derakon I will have to give it a try.
feos wrote:
If you already know the address that is used as RNG by the game, you must set a write breakpoint on it. You would also want to figure out how much it gets hit: once per few frames, every frame, or several times per frame.
You know, for some reason it never occurred to me that it might be changing during the frame. That is something worth keeping in mind. As well as the logging, definitely want to use that. Cool tips feos.
FractalFusion wrote:
If an RNG is volatile, brute-force (such as bots) is worth more than analysis. The opposite applies for well-behaved RNGs. - When doing analysis, whatever you are trying to manipulate should be worth doing the analysis for, such as a rare (say 1/100) and important event. - You can use Lua to forecast the RNG if it follows a sequence and you know its formula.
Yes, I am trying to find why a rare event occurs. I noticed that only certain enemies (there is some kind of formula, and RNG involved) have a semi-rare invincibility drop, something like 1/20. I was thinking that could possibly be used to improve the current movie, so it should be worth it. Thanks FractalFusion.
Post subject: Is Understanding Randomness At Assembler Level Worth It?
Experienced Forum User
Joined: 4/6/2013
Posts: 7
Hello, this is a question for those who have used the debugger to understand how random drops work vs simply observing drops from enemies. I have already spent a couple hours learning 6502 assembly, and couple more trying to make sense of how randomness works in a game or two. Neither game was I able to get a complete understanding of how randomness works so far. I have been wondering if it would be as effective and easier to make a bot and then just observe the results over a couple hundred drops. Is understanding at the assembler level worth the investment?
Experienced Forum User
Joined: 4/6/2013
Posts: 7
Could that little waterfall inside of the slope be considered "water" as well? Yes vote.
Experienced Forum User
Joined: 4/6/2013
Posts: 7
Master Jun's Super Mario World glitched. Megaman 1 with that insane overflow(underflow?) level completion glitch Link's Awakening playaround SNES Mega Man X & Mega Man X2 & Mega Man X3 Pokemon Yellow total control hack Yoshi's Island glitched (another Master Jun one) Family Feud Brain Age Metroid -Reverse boss order Relatively new to Tas videos, but these are my favorites so far.
Post subject: Re: Text on Transparent Background using Lua?
Experienced Forum User
Joined: 4/6/2013
Posts: 7
Ilari wrote:
MetalStorm wrote:
Not entirely sure how to do this, but is there a way to display text without any background?
You mean with the game showing underneath? As for doing that with lua-gd, does specifying the background color using image:colorAllocateAlpha() to be fully transparent work?
Looks you you were right, I was just calling the wrong image creation method...
Experienced Forum User
Joined: 4/6/2013
Posts: 7
Tried that, posted update in first post.
Post subject: Text on Transparent Background using Lua?
Experienced Forum User
Joined: 4/6/2013
Posts: 7
Not entirely sure how to do this, but is there a way to display text without any background? I was trying various functions with the lua-gd, but so far I have not had any luck. Ideally I would like to do it through lua-gd since I want the ability to specify a sexy font. Has anyone done this? Thanks. ------------ UPDATE Believe I figured out how transparency and drawing with gd works a little better. But I still have not figured out how to draw only one object, and have everything else transparent. Next thing I am going to try is a png with transparency already in it just to see if I can even do it, but I do not want to save everything as an image to use that. Any ideas? Here are some funny gi joe pics.
-- fceux gui.opacity sets the transparency on whole image, but colorallocatealpha sets objects in image transaparency

require "gd"
while (true) do


im = assert(gd.createTrueColor(80, 80))
black = im:colorAllocateAlpha(0, 0, 0,126)
white = im:colorAllocateAlpha(255, 255, 255,60)
im:openPolygon( { { 50, 50 }, { 50, 60 }, { 60, 60 }, { 60, 50 } }, white)


gui.gdoverlay(0,
		      0,
			  im:gdStr());
gui.opacity(0.5);

    FCEU.frameadvance();
end;
----------------
--see how the colorAllocateAlpha sets the transparency of images in image relative to each other?
--order of drawing is important as well.
require "gd"
while (true) do

im = assert(gd.createTrueColor(200, 100))
green = im:colorAllocateAlpha(0, 200, 0,0)
red = im:colorAllocateAlpha(200,0, 0,50)
white = im:colorAllocateAlpha(255, 255, 255,40)
blue= im:colorAllocateAlpha(0, 0, 200,10)

 gd.useFontConfig(true)
 im:stringFT(blue, "Arial", 20, 0, 10, 30, "Standard Arial")

im:filledRectangle(0, 0, 100, 50, green )
im:filledRectangle(25, 25, 125, 75, red )
im:filledRectangle(35, 35, 150, 150, white )

gui.gdoverlay(0,
		      0,
			  im:gdStr());
--~ gui.opacity(0.5);

    FCEU.frameadvance();

end;
------------- UPDATE - Got Solution - 5/31 This is what happens when you do not read the documentation carefully enough, and just assume things.
gd.createTrueColor(x, y) Used to create truecolor images, with an essentially unlimited number of colors. Invoke gd.createTrueColor with the x and y dimensions of the desired image to return the new image or nil on error. Truecolor images are always filled with black at creation time. There is no concept of a "background" color index.
require "gd"

	while (true) do
		 im = gd.create(200, 50);--works with transparency
		 white = im:colorAllocateAlpha(255, 255, 255,127);--background
		 black = im:colorAllocate(0, 0, 0, 20);
		 im:string(gd.FONT_GIANT, 1, 1, "transparent background", black);
		 gui.gdoverlay(0,
					   50,
					   im:gdStr());

		 im = assert(gd.createTrueColor(50, 50)) --does not seem to allow transparency...
		 white = im:colorAllocateAlpha(255, 255, 255,127);--background
		 black = im:colorAllocate(0, 0, 0, 20);
		 im:string(gd.FONT_LARGE, 1, 1, "no transparency", black);

		 gui.gdoverlay(0,
					   0,
					   im:gdStr());

		 FCEU.frameadvance()
	end