Post subject: Help me become to Advanced please :)
NhatNM
He/Him
Experienced player (718)
Joined: 6/17/2009
Posts: 600
Location: Vietnam
Hi ! I'm a newbie gamer only, I don't know any Advanced technical. I want learn them for improve my TAS. Please help me :) 1/ Please help all about script/memory/ram/etc in easiest ways (example how to show my HP character on screen, how can detect it....). I have already read tutorials about them but I don't unserstand. My silly brain not work at all :( 2/ I know Bizhawk is powerfull tool for TAS, but I can't use TASStudio, tried alot way, it's not same TASEditor I knew. Please help me how can use TASStudio for edit each frame I want. p/s: my english isn't well, please don't say to me too hard understand, please don't tell me need learn englisgh more than or need learn technologies,etc. I don't have too much free time for them, just love TAS and want make some TAS for relax my life :) Please make capture screen for help me, a newbie. If you don't know what soft can capture screen then try use SCREEN2EXE, it's a free soft caupture screen :)
A man come from Vietnam My YouTube: https://www.youtube.com/c/NhatNM/playlists
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
What game do you need those things for, at first? I could go step by step and you would follow and repeat those steps yourself.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
NhatNM
He/Him
Experienced player (718)
Joined: 6/17/2009
Posts: 600
Location: Vietnam
I don't know You can make any game you think can easiest for me understand :) Thanks your help :D
A man come from Vietnam My YouTube: https://www.youtube.com/c/NhatNM/playlists
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Okay. Let's take SMB, pretending it doesn't have all the addresses you need already. Finding your character's X coordinate. Note that all values are present as BYTES, one byte is 256 units (from 0 to 255). NES screen width is 256 pixels, so Mario has 256 possible places where he can be on screen horizontally. But the level is LONGER than one screen, so there is another byte that counts how much whole screens you are far. Maximum level length is not 255*255. So there are usually 2 bytes to represent your full position in level. It's like a 4-digit number. But instead of using 9 as a biggest value, we use 15, or F in hex. One byte is from 00 to FF. Two bytes present a machine WORD, and look like a number from 0000 to FFFF (0 - 255*255). It works just like having a number from 0000 to 9999. One byte is called high (the left one) in this 2-byte number, another is called low (the right one). Okay, so once the low byte (1 whole screen) overflows, the high byte increases by 1 (another screen starts). Once you reach position 255 and keep moving, your low byte becomes 0, and high byte increases by 1. Now you know how X positioning works in nearly all 2D games. Let's find the addresses. Go to the leftmost position in the first level, open RAM Search. Data type - set Unsigned. Compare to - set Previous value. 1. Comparison Operatior - set to Greater than. 2. Move a little bit right. 3. Press Search button. 4. Move a bit more right. 5. Press Search again. 6. Don't move, just wait. 7. Comparison Operatior - set to Equal to. 8. Hit Searh. 9. Move left. 10. Comparison Operatior - set to Less than. 11. Hit Search. 12. Move more left. 13. Hit Search. This way you will find the address that changes just along with your movements. And if you go right far enough, it overflows and starts from 0 again. That is the low byte of your X position. EDIT: Press Watch button. Type "Xpos low byte" and then OK. Now you need to find the high byte of X position. At first high byte is always Zero, then after the first overflow of the low byte it becomes 1. 1. Reset Search. 2. Comparison Operatior - Equal to. 3. Compare to - Specific value - type 0. 4. Move right so that low byte is almost 255. 5. Search. 6. Move right so that low byte overflows. 7. Compare to - Specific value - type 1. 8. Search. 9. Move a bit more right. 10. Search. This way you will find the address that increases when low byte overflows (255, then 0 and higher), and decreases when low byte goes from 0 to 255 and lower. Press Watch button. Type "Xpos high byte" and then OK. Now you have a full value of your position in level.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Skilled player (1176)
Joined: 5/11/2011
Posts: 427
Location: China
Study a computer language first, for example C, C#, C++, java or some other scripting language. This is the easiest way. Are you willing to study?
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Finding Camera X coordinate. You know now how RAM Search works, apply your knowledge to camera movements. Camera moves along the level map and always shows your character, but it doesn't move equally to him. You must move right enough to make camera move. But not too far, to not let its low byte overflow. 1. Walk around the left side of the first screen, not letting the camera move. 2. Search for value that does not change. 3. Advance the camera right a bit. 4. Search for the value that increased a bit. 5. Advance it a bit more and repeat the search. 6. Then go left and search for the value that decreased. Find camera high byte the same way you found player's X high byte. Make camera low byte overflow and search for the value that increases by 1. Add both values to RAM Watch and sign them accordingly. If you have full camera X position (2 addresses) and full player X position (2 addresses), you can calculate the exact position where Mario is on the screen. It is needed to draw something with Lua. But at first you need to find your Y position (height). Note: Y position may work in 2 ways. It either increases as you get lower (indicating the exact pixel on the screen your character is at), or it increases as you get higher (counting your position from the very bottom). Let's try the first way at first. 1. Pause the game. Reset search. 2. Press jump and advance some frames. 3. Search for the value that becomes LESS than the previous value. 4. Keep holding A and advance some more frames, as Mario gets higher. 5. Repeat searching for the value that decreases. 6. When Mario reaches the ground again, search for the value that became GREATER than previous. 7. Walk left and right, searching for the value that was EQUAL to the previous one. I'm getting MANY addresses here, but you can add the first 2 that show different values (0002 and 00CE) to RAM Watch and then check what is more correct. Drawing something over your character's sprite. Download MarioDraw.lua
Language: lua

function Draw() -- prefix 0x before the number means it is not decimal but hex. MarioXlow = memory.readbyte(0x86) MarioXhigh = memory.readbyte(0x6D) MarioX = MarioXlow + MarioXhigh*256 CameraXlow = memory.readbyte(0x71D) CameraXhigh = memory.readbyte(0x71A) CameraX = CameraXlow + CameraXhigh*256 MarioScreenX = MarioX - CameraX MarioScreenY = memory.readbyte(0xCE) gui.text(MarioScreenX, MarioScreenY, "Hi!") end emu.registerafter(Draw)
Download the script, drop it right onto FCEUX window, while SMB game is loaded. We see that the Y position we used is a bit wrong. So just change one line in the script:
Language: lua

MarioScreenY = memory.readbyte(0xCE)
to
Language: lua

MarioScreenY = memory.readbyte(0x2)
Press Restart button on the Lua Script window. Now as you move, you will see that sometimes your "Hi!" text jump up for a few frames. It means that the same addresses is used for something else, so we must find the one that ONLY indicates Mario Y. However we notice that 0x2 is exactly where Mario is vertically, so we just search for an address whose values are identical to 0x2. If you repeat your Y position search you will see them all again. Let's try 0x4AF, and put it into the script instead of 0x2... Works for me! I think that all those addresses that were changing identically with Mario movements, but were a bit shifted towards each other, indicate the whole Mario's HITBOX. Because 0x4AF indicates his bottom, that can collide with floor.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
NhatNM
He/Him
Experienced player (718)
Joined: 6/17/2009
Posts: 600
Location: Vietnam
Thanks feos very much for tutorial ! But I really can't understand, sorry :( I tried read this many times, do step by step but still not work... I'll try more than, slowly slowly slowly...
A man come from Vietnam My YouTube: https://www.youtube.com/c/NhatNM/playlists
Experienced player (588)
Joined: 2/5/2011
Posts: 1417
Location: France
Add me in Skype: got4n123 . I can help you sometimes
Current: Rayman 3 maybe? idk xD Paused: N64 Rayman 2 (with Funnyhair) GBA SMA 4 : E Reader (With TehSeven) TASVideos is like a quicksand, you get in, but you cannot quit the sand