Posts for viren

Experienced Forum User
Joined: 2/5/2011
Posts: 9
It's been a while. Last year a lot of heavy things happened in real life and I completely forgot about this. I plan on resuming this run now when I have free time.
Experienced Forum User
Joined: 2/5/2011
Posts: 9
Well I certinaly botched my May goal! When it's done, etc. Jungon, download this: http://tastools.googlecode.com/files/jpcrr-streamtools-r11.2-win32-bin.zip Playdump is in there. Just drag the file I uploaded onto playdump.exe.
Experienced Forum User
Joined: 2/5/2011
Posts: 9
It's in the /streamtools directory of the JPC-RR archive.
Experienced Forum User
Joined: 2/5/2011
Posts: 9
Not since the last one I posted. I've been kinda busy. I found a new time saver last month and then tried to code a prog to splice sections from an old replay to a new one, but that turned up dead because D/Gen has updates on odd frame numbers. I looked at some other DOS TAS's like Hocus Pocus and noticed that run had a solid 3 frames/sec update (from memory) which could facilitate splicing, but some other runs didn't have an even number of frames. I guess I should have picked an easier game for my first TAS but whatever, I'm still working on it. Since my free time isn't set in stone I can't say when the run will be done. I'm setting a personal goal for it to be before May though. I could release a half assed run and, realistically, no one would challenge it unless they loved D/Gen. But I want to make the best run that I physically can. Otherwise why bother making a TAS right?
Experienced Forum User
Joined: 2/5/2011
Posts: 9
If that's the memory watch that came with the latest JPC-RR I tried it and it crashed a lot, which is why I tried to find another way. It seemed to narrow down values very well but once I tried to watch something everything got very unstable. I tried it a few times and the same deal. Is this known or maybe it's just on my end? Edit againnn: Ok reading the source it obviously isn't. But it's still worth it to bring up the mem watch script that comes with JPC.
Experienced Forum User
Joined: 2/5/2011
Posts: 9
Thanks for that, especially about the chunks. Edit: It's 7am here and I completely misinterpreted what you said. Edited out the dumb stuff :)
Experienced Forum User
Joined: 2/5/2011
Posts: 9
When I first started with JPC-RR I used CheatEngine to look at values, but wondered how I could get those addresses CE found into a lua script JPC could understand. So I made a small tutorial with lots of pictures for newbs like me. If you have a better method please share it. Ok so for this example I'm using D/Generation and CheatEngine. Any game will work but I'm not familiar with things other than CheatEngine. Your mem hacker of choice will work if it has the same capabilities. First off we start the game and start CE. Attach CE to java.exe. For this example I'm going to be using the Y position of the main char. I'm going to assume you know how to find stuff in CE or whatever. If not, what I did was start with an unknown value, ran down the screen a few pixels and scanned for an increased value, repeated that a few times, then ran up the screen and scanned for decreased values. Here's what I came up with after enough iterations. 54 hits? That's too many. Well, we know the game is running in mode 13 320x200 because we're old and bitter, so surely the Y position of the player can't be over 200. Let's clamp the scan to "smaller than 200". (Jokes aside. if you can't eyeball the resolution a good thing to do is build or get a debug version of Dosbox and put an interrupt breakpoint on 10h, then look at Ralf Brown's interrupt list and sift through the calls to the VGA to determine what is happening. Thankfully 90% of DOS games are just straight mode 13 320x200. Also this is about a one screen game. If it's a scrolling game, use your intuition about how the value is stored of course). 8 hits. That's more like it. So double click the first value and change it. Hopefully this is the Y position of our character. If it is, the character should snap across the screen. If it's not, it will be one of the others. Ok, it turns out it was the first value. Don't you love it when things just work out? So... now we know where the player Y position is in the memory of the JPC-RR process running. How are we going to translate that to something practical? JPC doesn't see memory the same way that CheatEngine does. It has its own internal RAM. Let's assume you installed JPC-RR to "C:\JPC-RR\". Open notepad and write jpcrr.ram_dump("ram.dump", true) print("Dumped") and save it as "dump.lua" into "C:\JPC-RR\lua\". To be honest I don't remember why the "true" is there and I can't be bothered to read the docs. So just do it! Or don't and write "false" and see what happens. Live on the edge! So the script is in the default location now, let's run it. JPC has a lua window you can't get rid of, so bring it up and type "dump.lua" into it and click run. If all goes well it should say "Dumped" in the window. If not make sure the script is where JPC wants it. Now we have a binary dump of JPC's RAM called "ram.dump" inside the "JPC-RR\lua\" folder. There's no question that what we found in CheatEngine is inside that RAM dump, but how do we find it? Easy... maybe. Go back to CheatEngine and rightclick on the address you determined the player Y position was. Select "Browse this memory region" Hmm there's a lot of crap here. We need something unique that we can match up to the RAM dump. All those 00's won't do, so scroll up one row. Ah there's some unique characters! Select as many unique characters as you can *while still containing the value you are interested in* and copy them. In this example, the value we're interested in is the very last byte, 0x27. (of course you can select whatever you want as long as you know where your target byte lies in it and it's unique enough). So now if all is well we have a string of hexadecimal characters copied to the clipboard, which is hopefully unique and not repeated elsewhere. Open up the ram.dump file in your favourite hex editor and search for the hex string that you've got copied. Great! Only 1 match in the entire file. We've established that this is the string in CheatEngine, and CE was looking at JPC-RR's memory albeit in a virtual space. So if we can see the same string in the dump of JPC's RAM, we're looking at it exactly how JPC sees it! Good stuff. Since our target value was the byte on the end, the player's Y position, let's find out what that is. Put your cursor over it and find out that it's at offset 0x2B0D8. (This will be a diff address for you likely). So the detective work is done! We know that JPC, internally, sees the player's Y position in its RAM as that very address. Let's confirm this. Open notepad and write ypos = jpcrr.read_byte(0x2B0D8) print(ypos) and save it as whatever you want as long as it's in the lua directory. When you run it, it should print the Y position. And that's that! It was a simple tutorial but hopefully it can help someone.
Experienced Forum User
Joined: 2/5/2011
Posts: 9
I skip 82 completely because you get a bomb from talking to a man on 81, and since 82 has the exit on the same screen as where you start it's the poster child for a bomb skip. After that there are 3 item boxes on the fastest route possible. The first two boxes both have 8 items in their cycle before they repeat, and the third box has a cycle of 5 days. The first two boxes only have a bomb during one day of their cycle and they're not lined up, so you have to make a choice. You can either get a grenade and a bomb, or a bomb and a shield. Since the third box cycles every 5 days you can manipulate it to a bomb regardless of the other boxes. With these two bombs you can skip the majority of floor 87 and the first half of 88. I toyed around with grabbing another bomb on the last half of 88 rather than getting the final key to open the exit, but it was slower by several hundred frames because you have to wait for a bomb to detonate. I tried throwing grenades at it and shit but no dice. So the question of route comes down to whether you want a grenade or shield. Shield is the smart choice because when you activate a shield and run through laser barriers you pick them up and can deploy them later. They kill C/Gens just like a grenade and where I use the shield it saves a bunch of frames not waiting for barriers to move. Also you can grab 2 barriers which saves you grabbing a gren on 88, ~30 frames saved. With that said I haven't disassembled the game to find out the actual arrays that item boxes use. I just changed the date a bunch of times and observed, seeing if the patterns I jotted down coincided. They've coincided to my predictions but I certainly don't deny I could be wrong.
Post subject: D/Generation
Experienced Forum User
Joined: 2/5/2011
Posts: 9
Hey. I noticed on the wishlist a few people mentioned D/Generation. I wanted to make a TAS for a while and I love this game, so I'm in the process of taking a stab at it. So far I've only done a WIP of the 1st floor. Unfortunately I had to do it over (for the 3rd time...) and lost the savestate so I can only give you a dump to use with playdump.exe. It's ~50mb so keep that in mind if you want to see it. http://www.mediafire.com/?cce60ac98or0ty0 If a veteran of the site watches the dump could you please tell me if I'm on the right track to an entertaining run or it's boring. Thanks. So, with that out of the way, let's discuss techniques! The main technique for saving frames is corner boosting. Now comes a shoddy diagram... |_ ^ Ok the caret is the direction the player is running, and hopefully the corner is obvious. What happens when you run into a corner like that is you get pushed to the left (along the horizontal plane of the corner) and get pushed back (along the vertical plane of the corner). You will always get pushed further along the horizontal plane than the vertical plane. Depending on the orientation of the corner it will be 3px across and 1px back, or 4px across and 2px back. Sometimes it seems beneficial to corner boost but it isn't. I will detail how to make a lua script to track the player's x/y position so you can find out how corner boosts are working in your favour but maybe in another post to keep this one on point. The next technique is going OOB. There is a certain wall prop the designers used in levels that allows you to get around a wall and into no man's land. However screen transitions work by a designer explicitly marking an edge of the screen to go to a certain room, so you can't get crazy game breaking glitches this way i.e going from floor 80 to floor 87 or whatever. You can see me using this glitch in the dump I posted. In the room I collect the laser I skip getting the key, because I can go OOB in the next room and get around the lock. Later on in my planned run I use this twice more. The last technique is about luck manipulation. If you've played this game before you know there's item boxes you can collect and they give you random items. Turns out it's really not that random. In fact the boxes only change their contents on DAYS. Not hours mins or seconds, and input has nothing to do with it... Anyway I will elaborate on routes and stuff in other posts if people are interested. I'll leave you with a map I made of the game. The pictures are just collages and you need to refer to the txt file for scene numbers, items, etc. http://www.mediafire.com/?6xot5gomky43iqu