Posts for ErisK

Experienced Forum User
Joined: 11/26/2017
Posts: 13
£e Nécroyeur wrote:
This will work. Alternatively, btoads.xml can be manually extracted from CHEAT.ZIP or CHEAT.7Z and then placed in the CHEAT subdirectory. The new XML code can then be appended to the exisiting file.
Alright, I was able to get the btoads cheats to work. However, what text editors are good for writing XML code? I used Notepad but I guess it doesn't really work for XML. MAME-RR actually started, but then an error message appeared, saying something about 'parsing', and MAME-RR closed. I guess that's because of spaces errors? So I couldn't make it work that way, but instead I looked for btoads.xml in the cheat file and copied it to the cheat subdirectory. That did work! Still, for copying XML code, is there some program that has to be used for it to be copied correctly? Now I'm trying to understand what the script means. So far I think I get it, but I still have to do a few tests. The weapons cheat is actually a cheat to get a certain weapon when you press 'Enter' on the cheats select screen, but the RAM Addresses as well as the values from the XML file may be helpful for solving the targeting problem with loading. Speaking of which, I was rereading an old post I had done some time ago asking about RAM Addresses in Haunted Castle. There, you gave me the Stage Select Address, which worked great. But back then I didn't know anything about XML so I couldn't really understand where you got it from. You said that from Pugsy's Database but I still didn't understand. Well, now I can see where you got it from. I took a look at hcastle.xml and indeed, you can tell which is the Stage Select Address (it's not that explicit but you can tell if you understand the script, which I do now). However, you also found an RNG Address. Do you remember where did you get that one? For what I read it seems like you had to search a bit more, but where? (I know it's not really related to btoads, but it's still something that could help me.)
ais523 wrote:
In most 2D games, no objects that are currently onscreen will load into different memory locations as long as the camera doesn't move. (It's frequently the case that there are short-lived objects, like animations as the player's character moves, that load in and out even without the camera moving. But those rarely affect anything that was onscreen already.)
I was thinking about first finding the memory address for the camera. Then, by watching at that address, I may be able to figure out when it is actually moving and thus when objects could begin loading. I'm not sure it could work, but what do you think? I'll also try to apply the addresses/values I found in Pugsy's Cheat Database.
Experienced Forum User
Joined: 11/26/2017
Posts: 13
Well, I downloaded the latest version of WolfMAME (I was recording with that one, but will be using MAME-RR to try and find the RAM Addresses for the 'slots'), which is 0.200, and noticed something a bit weird. First of all, now the game needs an extra file (bmst2000.bin if I remember right), which I had to download to play the game. The game runs a bit faster, has a bit of differences in sounds and graphics but nothing too significant. However, regarding this 'targeting' problem, it looks like now the game has a tendency towards picking one of the objects. I still got the other object a few times, but it looked more random on WolfMAME0.106 (the other version I was using). As for MAME-RR, it seems to run similar to 0.200. Probably due to my MAME-RR version being 0.139, which is when more changes were made for ROMs I think. There are some things that look a bit odd, but as I was saying it's nothing significant and it's probably just me (well, probably). The randomness regarding targetting is still there, too. But I wonder if the loading being faster is affecting this. That could mean that the problem really is loading. By the way, do you know why could this game have low volume on 0.200? It has the right volume even in MAME-RR, but volume is pretty low on 0.200. I tried increasing volume by other means but didn't seem to work. It looks like the game is 'supposed' to run that way, but it shouldn't, since it runs alright on other versions.
ais523 wrote:
ErisK wrote:
Well, while I've done some work on memory watch and was able to find a bit hard RAM Addresses, I'm still new to this and aren't too sure about how to search for such slots/objects. My guess is that I should watch at the changes of values before and after a loading, but is there some clue as to when the loading actually starts? Is it as soon as the object appears onscreen, or could it be before?
There's no hard rule that forces games to do it a certain way, but most 2D games will load an object when it reaches a particular point relative to the camera. That might be the moment the object is visible onscreen, slightly earlier, or in some cases even slightly later (in these games you can see the object loading in). Bear in mind that the view shown onscreen might not go right to the edge of the screen, too (many games will have some sort of frame around the edge of the screen, maybe just a black rectangle, to hide objects that are in the process of loading so that people can't see them suddenly appear). In 3D games, objects are more likely to load based on the player's position than on the camera's position (because otherwise, the console would have huge lag issues if the player decided to spin the camera round quickly).
So in theory, if the camera is always fixed in one place, no other loadings should occur? Well, I'm not sure about the backgrounds and such but... The objects that I want to keep track of (or rather, the 'slots' containing them), they should keep the same value as long as the camera is still in the same place, right?
ais523 wrote:
ErisK wrote:
Also, what numbers do ID normally have? And do objects have their own RAM Address? I guess they do as absolutely everything seems to have a RAM Address (which makes sense considering everything has to be saved somewhere), but I'm just guessing so I ask just in case.
Normally, an object's address will depend on its ID number; there'll be some place in memory that, say, stores information about the object with ID 5. Part of the reason to have a system like this is that not all the objects in the game can fit into memory at the same time, so the ID number system prevents two objects trying to use the same bit of memory. The ID numbers themselves are often just small integers (0, 1, 2, etc.), and might not be stored explicitly in memory (i.e. you determine an object's ID number by looking at the address where its data is stored, rather than the other way round). Actually finding the memory addresses in question can be fairly hard; I can't think of a simple way to do it offhand. On some consoles, there'll be memory addresses reserved for sprite coordinates (e.g. the NES's OAM); you may be able to find the object loading code by monitoring for writes to that, but you'd likely need to decompile the code in order to figure out where it's storing the information about objects.
I think I got it... The game loads the screen. Objects with ID 1 are saved in the memory address that tells information about objects with ID 1, objects with ID 2 are saved in the memory adress that tells information about objects with ID 2, etc. However, the data inside such memory adresses is not necessarily the ID number. It's just a number telling information about the object with such ID. Did I get it right?
£e Nécroyeur wrote:
ErisK wrote:
Is there some post where this is discussed?
A self-fulfilling prophecy! :) Use the command line to create MAME-RR.INI: mame-rr -createconfig or mame-rr -cc This will create MAME-RR.INI in the MAME-RR directory. Modify MAME-RR.INI as follows: cheat 1 Download Pugsy's MAME cheat database. MAME-RR uses MAME 0.139. MAME 0.145 and prior can not use the 7-Zip file format, so MAME 0.145 is the most recent version of the cheat database that can be used with MAME-RR. Extract CHEAT.ZIP from the downloaded file and place it in the same directory as MAME-RR.EXE. Although MAME 0.145 is the most recent version of the cheat database that can be used with MAME-RR, cheats for an individual game can be manually extracted from any newer 7-Zip version of the cheat database and can thus be used with an older version of MAME that does not support the 7-Zip file format. Cheats for an individual game are stored as an XML file within the database. Place a game's XML file in the CHEAT subdirectory of MAME-RR to use it. A game's XML file in the CHEAT subdirectory will override that game's XML file contained within the database.
Haha, a self-fulfilling prophecy, yeah, I guess so :) . Thanks! I really was wondering about how to use these cheats. I didn't try for some days, but now I'll try again. It looks like the reason why they didn't work is because I was using 0.106. I had done everything as explained, but MAME would say I should 'unzip' them. So that's why. As for using MAME0.145 with MAME-RR, what do you mean? If MAME-RR uses 0.139, is it still possible to 'combine' MAME.0145 with MAME-RR? Sorry for the question, I'm still not too used to these things. As for using these cheats, I need to create a file called, for example, btoads.xml, and inside I need to copy all the code from Pugsy's Database? I looked for 'btoads' there and it's where I found an XML code with the cheats. Then, I need to create a subdirectory called cheats (I don't find it so I guess I need to create it), and put 'btoads.xml' there?
Experienced Forum User
Joined: 11/26/2017
Posts: 13
So... To make sure nothing's changing, and that I'm playing the game pretty much as in the original version, I should download MAME again, and not ever use a savestate, so memory is always working correctly?
Experienced Forum User
Joined: 11/26/2017
Posts: 13
Sorry, I think I didn't explain it right. What you replied still helped me to better understand how savestates work though. I didn't fully understand what you meant in a previous reply, but now I understand. What I was wondering was if the loading of savestates affects MAME long-term. In other words, if even after restarting MAME, the results will depend on the previous savestates you loaded in another MAME session, Honestly it doesn't make much sense, but I like having opinions. In theory, MAME completely resets the whole game (including scores and such, so in theory you are playing as if it was the first time), so as long as you don't load a savestate again, loaded savestates from another session shouldn't affect... right?
Experienced Forum User
Joined: 11/26/2017
Posts: 13
Oops, that's bad. Well... for now it won't matter that much though. I'll see what I can do. Thanks. By the way... Could savestates be also bound to randomness even after starting MAME again? That looks really crazy, but... could it be? It's just that when I used to play Haunted Castle, I really had this feeling that at times, I would most of the time get a certain pattern, but then, after some time passed, I would most of the time get another pattern. In the end I got to the conclusion that it was just me, but could it be that loading savestates (or doing other things) messes up with randomness even after closing MAME and starting again?
Experienced Forum User
Joined: 11/26/2017
Posts: 13
ais523 wrote:
Many games use a "sprite slot" system where each sprite on screen has an ID number, but there are only a very small number of possible ID numbers and so they get recycled a lot. When an object loads, therefore, it'll typically be given the lowest ID number that isn't in use at the time (but then that number will stay stable as long as the object stays loaded). This is particularly common on older platforms (like NES) due to the way that those platforms' graphics works. My guess is that the object that's being targeted is always picking the object with the (highest/lowest) ID number, which is why you can't see a pattern but also can't get the results to change. In games where "which object goes in which slot" is important, it's normally a good idea to set up a memory watch to allow you to keep tabs on it; often you'll need to unload specific objects at specific moments to get other objects to load into the slot you want.
That makes sense. Thanks for the reply. Well, while I've done some work on memory watch and was able to find a bit hard RAM Addresses, I'm still new to this and aren't too sure about how to search for such slots/objects. My guess is that I should watch at the changes of values before and after a loading, but is there some clue as to when the loading actually starts? Is it as soon as the object appears onscreen, or could it be before? Also, what numbers do ID normally have? And do objects have their own RAM Address? I guess they do as absolutely everything seems to have a RAM Address (which makes sense considering everything has to be saved somewhere), but I'm just guessing so I ask just in case.
feos wrote:
I guess you're using MAME? Its savestates are non-deterministic, they change the amount of cycles left to be executed basically every time you load them. A certain value doesn't get updated. So if there's some randomness to what you grab, it gets messed up on such state reloads. I had a patch that fixed this, and you could probably try a build with it, but getting around to making it is problematic for me atm. There's a place where interim MAME builds are hosted, if you're willing to look for a commit where this patch is present (if got reverted eventually), I'll give you the clues.
Thanks too for the reply. Yes, I'm using MAME. What you say about savestates makes a lot of sense actually. Before Battletoads (Arcade), I made lots of testing with Haunted Castle (also Arcade), and lots of weird things happened with savestates (including graphics, sound, etc.). Randomness really seemed messed. But... so there's a chance that the picking of objects is actually random? I don't think that's the case, but, is it possible? And yes, while I'm still new at these things, I'd still like to know more about that patch. Could be a nice opportunity to keep learning about emulators and programming in general. So I'll appreciate any information on it. Thanks for telling me about it. By the way, I just decided to look for Battletoads (Arcade) on Pugsy's Cheats Forums, and I found one cheat that is apparently related to the picking of weapons. It might refer to something else, but this could be it. Now the problem I have is that I don't understand how to get these cheats working. They are probably included in the cheats file, but I'd still like to know how to set cheats separately. Could you help me? Is there some post where this is discussed? (I'm reading a post about XML though... that may help a bit, but I'll still appreciate any help.)
Post subject: About games loading objects on screen and targeting
Experienced Forum User
Joined: 11/26/2017
Posts: 13
Hello there. Lately I've been playing Battletoads (Arcade), and there's one thing about memory (well, I think it's memory) that I can't really understand, and I was wondering if you might have the answer... In short words, if you press the attack button near an object that can be grabbed (be it a weapon or an enemy), you grab it, but when there are two possible objects that can be grabbed, there's a logic I can't really understand. If I create a savestate just before picking one of the objects, I will absolutely always pick up the same one. No matter what I do (jump, walk all around the screen then reposition, press combinations of buttons...), I will always continue to pick up the same object. But if I play from an earlier savestate, then there's a chance that now I will absolutely always pick up the other object. My theory is that the game gives priority to the object that was loaded first, but if the screen scrolls automatically, is there still a chance of this happening? Another theory I have is that the objects are loaded in a somewhat random order, but is that also possible? Are there any other possibilities of how the game solves this problem? EDIT: What I mean in other words is if you know why sometimes I pick one object, and other times the other object, being that they should always load the same way and they should always be in the same position, so the priority should always be given to the same object, but that's not the case.
Experienced Forum User
Joined: 11/26/2017
Posts: 13
£e Nécroyeur wrote:
ErisK wrote:
So there was people actually playing the game and even more, studying it... Is there some way I can contact them? Maybe Abystus via PM?
Abystus is a member of the Pugsy's Cheats forum. You may be able to contact him there, or at least post your questions publicly. Pugsy's Cheats forum: http://www.mamecheat.co.uk/forums Haunted Castle thread: http://www.mamecheat.co.uk/forums/viewtopic.php?f=4&t=5719
Well, thanks a lot for all the information and the help!
Experienced Forum User
Joined: 11/26/2017
Posts: 13
Wulf2k wrote:
I have no clue how the emulators implement it, but the actual Game Genie device is something that would run on the hardware itself. It would take up memory, and use up actual cycles on the processor to process the codes. An LUA script would happen 'outside' of the emulated hardware and not use any emulated memory. From the point of view of the emulated system, those changes would happen by magic instead of as a result of in-system commands.
Thanks a huge lot for the reply. I don't really know technical details, although I'm very interested in knowing such things. Maybe that explains why the Game Genie works on ROM addresses instead of RAM ones. As far as I know, the ROM contains some information about the hardware, although I don't know as much so I may be wrong. So, maybe... If the Game Genie does not only change the ROM address but also some hardware related to it... that would explain why Lua Script does not work when trying to do the same thing. I guess Lua Script can only change the value, while the Game Genie does much more. I tried using Lua Script on the same ROM addresses than the Game Genie does but the game simply glitches. I would highly appreciate if you can correct some things I may understand wrong, and/or if you can add more on it. Even though I know little about it, I'm very, very interested in knowing more. Also... Is it possible that you also have a YouTube channel, with the same username? Well, if you want I can send you a PM.
Experienced Forum User
Joined: 11/26/2017
Posts: 13
"I tested Haunted Castle on MAME-RR and FBA-RR to compare them. The only difference that I observed is that the transitions between stages are a few frames longer using FBA-RR. Whether using MAME-RR or FBA-RR, the length of the stages themselves is the same, and the gameplay is identical." (Sorry for not using the quote function; I had a few problems with it. Not used to forums really.) Not exactly. Well, maybe after you mess a little with them. What I mean is, when I tried the Stage Address on both, MAME-RR had a very high tendency towards a certain pattern on Stage 3 beginning. To begin with, that shouldn't be random at all, but if you use the Stage Address, it is. With FBA-RR, it is random as well, but the tendency is different. "Pugsy's MAME cheat database credits 168 contributors (including some members of TASVideos.org), and Pugsy himself does a lot of work, so it is hard to say. However, at least one cheat for Haunted Castle was contributed by Abystus, who is a prolific and knowledgeable contributor to the database. He likely knows as much as anyone who contributed to Haunted Castle." So there was people actually playing the game and even more, studying it... Is there some way I can contact them? Maybe Abystus via PM? And about the Game Genie, theoretically it works changing the Addresses values, but there is a contradiction. If you try to change the same Address using Lua Script, you won't get the same result. That's what bugs me really, why does that happen? Do you have any theory? (Also, Game Genie changes ROM Addresses; does that matter? I think Lua Script can do that the same way, then again, maybe it's not the exact same.)
Experienced Forum User
Joined: 11/26/2017
Posts: 13
First of all, sorry for taking so long in reading and replying. I checked my mail some days after the last post but then stopped doing it, then checked it today, and found this.
I'm glad that you looked into this a bit further.
I try to, yes :) . Sometimes I miss some important details and that makes it look like I didn't make any effort, but no, most of the times, I have worked really really hard, but didn't find/realize something because I simply missed it, but not because I almost didn't try. So thanks for noticing it. This particular case, I think I never worked so hard on a game (when speaking of studying; when speakiing of challenge runs themselves, it is a bit more complex to say). One month has passed, and I was finally able to figure it out. It was a counter, a frame counter, the one determining those 'weird' speed patterns that didn't seem to make any sense. I still haven't got the run because it's a challenge run so it's Single Segment, and it's pretty hard considering I add extra rules. But anyway, that's another subject I guess. And yes, I was using FBA-RR back then. Eventually I decided to use MAME-RR (yes, more things kept happening during this month), which gave me some weird results. But this game is pretty weird. Or perhaps it's because it is an Arcade, and Arcade have other programming. Really, I have almost no experience with Arcade games. But for example... sometimes, it looks like the game has a set pattern, even if I do different things. Some time passes, then the 'set pattern' changes. Like if it was based on dates, total attempts, total time played, or something like that. Loading savestates also produce some weird things, but most of the time is more a graphical thing. About MAME-RR, it seemed to have a different tendency towards RNG. I guess this is the 'weird' one, as MAME0.64, WolfMAME0.106 and FBA-RR they all gave essentially the same results, but not MAME-RR. Or who knows... maybe it's the other way around. I'd have to play the game on an actual Arcade. About the database, does that mean some TAS players actually played Haunted Castle, and actually took their time in finding such Addresses? I mean, it's not that much known, although I guess TAS players play more unknown games than known games. Well, I think. And do you know which players may have built the database for Haunted Castle? They may know a lot about the game and its programming. At this point I think I pretty much got it but I still like to have as many opinions as I can. There are still some weird phenomena I'm not sure about after all. Well, thanks a huge lot for all the information :) . Also, do you have an explanation for why the Game Genie doesn't seem to match with how Lua Script works? That's more or less what I meant with the last message.
Experienced Forum User
Joined: 11/26/2017
Posts: 13
Pokota wrote:
I would expect that any change level routine refers to the 'current level' address for pointers rather than the game instantly changing the level to suit the address. It's what I'd do, at any rate. Are you freezing the address and then attempting to transition levels normally?
Do you mean that, in order to see the change, I'd need to restart the game and then see if it works? If that's what you meant, I actually tried it as well, but 'weird' things happened. Visual glitches occurred for the intro, and then, when the Battletoads screen appeared (I am first trying with Battletoads, to have a clue about how it may work on other games), it just froze. All of this with the Level Address posted on TASVideos (Battletoads Address Set). I tried my own experiments too though, but didn't work either. I haven't tried the Level Config Pointer however. Maybe that's the key. Being honest, I don't know much about what pointers refer to. Although, I just made a bit of research, and maybe it really is the key. As for freezing, sadly I can't do that the 'normal' way on Haunted Castle (I don't know why both the 'Add Cheat' and the 'Cheats' section are 'blocked', that is, they can't be selected). So there I have no choice but to use Lua Script. But on Battletoads, the game either freezes or becomes very glitchy. That makes sense actually, since if it really is the Level Address, then it must glitch when getting to another level. I'll try the Level Config Pointer though. Woah, really weird. I froze it at 81 (Hex, value at Level 1), then took the Warp to Level 3, and this time it actually loaded (unlike with the other Level Address), but it played automatically. That is, the screen was moving all the way to the end. Very curiously, when it reached the final bit of the Turbo Tunnel, the music sped up, as it would normally. Watching the Level Config Pointer, it does change during a level, at least on 3. But the Address that according to the Addresses Sets is the Level one (0010) really seems to be it. It is constant on a level, never changes during them, but it does when switching screens though (like during cutscenes). The problem is how to change it. If I try to, the game just freezes. I also tried without looping, but it was still the same.
£e Nécroyeur wrote:
Level select cheats can be tricky. Even if you know the memory address, it is not always obvious which value to use, or when and how to manipulate the value. I don't know that I can help you to search, but here is an example for you to experiment with: Haunted Castle Stage memory address: 00000806
That's probably the problem. Maybe the 'how and when'. I wonder how the Game Genie does it. Thanks for the Address. I'll experiment with it. By the way, why do you guess that may be it? Is it a 'special' one for most games? I know some Addresses are common in some games (they have the same/similar function). Yes! I haven't tried Haunted Castle yet, but on Battletoads, it worked experimenting with 'when'. It turns out it works if you change the value just when the game tells you: "Level X". If you change it there, when the level loads, it actually loads the value you set. I'll keep this in mind for Haunted Castle, which in the end is my real objective. Woah!!! That Address worked!!! How did you find it? Thanks a lot! (Now let's see if I can find RNG values and some more data that may be useful... This game has a very particular programming I think. I am even starting to think there is no RNG at all.) What I don't understand is why on Battletoads the Game Genie shows me a ROM Address, and one that really isn't the Level one. Is there some explanation for that?[/quote]
Post subject: Question about Addresses
Experienced Forum User
Joined: 11/26/2017
Posts: 13
Hello. First of all, I apologize if this is not the right place to put this topic. I also apologize if this question has been already made and I wasn't able to find it (I've been searching in both the 'main page' and here in the forums). Well, I guess I'll try to be short (I usually write a lot though). It's the first time I register here and write here, but I've been using Tool-Assisted emulators since a while now (probably around 3-4 years). I'm not a TASer though, and actually am, at specific circumstances (that: specific circumstances, otherwise I like TAS) against it. However, that's not the purpose of this post, so I'll get to the point. I'm currently working on a challenge run (not TAS run) on Haunted Castle (a Castlevania game released for the Arcade). Thing is, I've been trying to use some TAS tools to better understand the programming of this game. It's been like 6 months now, and a lot of time inverted on it. I've been able to decipher most of the game's programming without using any advanced TAS tools (only Savestates and a bit of Frame Advance), but at this point, I feel like I'll really need them to verify my theories. Again though, I'll try not to extend myself too much (I guess you prefer long posts, but just in case). So in the last days, I've been doing a lot of research on RAM Search, Lua Scripting, and programming in general. I was able to do some things like freeze my HP and lives at specific values, but now I'm trying to find an Address that allows me to skip levels and... can't find a way. I'm trying to first figure it out on NES games. So I took Battletoads (and Super Mario Bros 1, which seems to be taken a lot for TAS testings). But when I try to change an Address that I think is the level one, many things may happen. With some values, the screen goes completely black, and with others, the level layout remains the same but not the objects there (so sometimes the character gets at the upper section of the screen on an 'invisible floor'). I then tried Game Genie to see which is the Address that is changing the level. But the Address shown doesn't seem to be either (as it doesn't give the result I expect, that is, something 'weird' happens). My question is not really about these specific games. It's more about how level select Addresses work. After the tests with the Game Genie, I got quite confused, and even more after reading a few things about how the encoding (I think that's the word) works. I also got confused about RAM and ROM Addresses (I think after 0x8000). I would really appreciate if someone can clarify me a bit how all of these things work. The good thing is that I have experimented a bit on them, and done research as well, so I have an idea. Well, thanks for reading. And sorry again if this wasn't the right place to put it, and/or if this question was already made.