Posts for TheCowness

TheCowness
He/Him
Experienced Forum User
Joined: 6/1/2016
Posts: 3
It hovers around 50% CPU usage. It's on a machine that's only got a dual-core processor, so it's using an entire core. I have other computers I could get involved with this, but I don't know if I want them all running non-stop for a full year. Someone (jokingly) suggested to me setting up a bunch of VMs on AWS last week, but I'd rather not spend more than the cost of electricity. It's sounding like my best bet is just to program a custom battle simulator, so I'll keep that as Plan A. I just figured I'd gone far enough down this path that I should try reaching out to people who know more about using emulators to do more than just play the games.
TheCowness
He/Him
Experienced Forum User
Joined: 6/1/2016
Posts: 3
The fight is pretty long, but the changes I made to the ROM help. After the changes and manually setting the message speed, it's still about half a minute long in-game time. If I turn on the FPS counter, it looks like it's hanging at about 1500 FPS (25x speed) and each fight takes a second on average, so it's about 1500 frames long, give or take. There are some really detailed notes on how the RNG works in the entry for Vaxherd's TAS that was released earlier this year, so I can reproduce the random-generator easily. Reproducing the entire battle is much more complicated, but with his notes it should be doable. I had started programming such a simulator last week, but I only got past the step that determines their starting HP (enemies in DW3 spawn with 75-100% of their max HP). My plan is to follow through on that if I can't find a solution that requires much less effort.
Post subject: Tuning an emulator to run a LUA script as fast as possible?
TheCowness
He/Him
Experienced Forum User
Joined: 6/1/2016
Posts: 3
tl;dr: I'm trying to run a LUA script that will (currently) take about seven years to finish. I'm looking for suggestions on how to get it to run faster. The script I'm running is on a scripted battle in Dragon Warrior III. Everyone muses about whether or not Ortega can defeat King Hydra, but I don't know of anyone having actually witnessed it without editing Hydra's HP to zero. Because of how the RNG works in the game, there are a finite 268,435,456 (65536*256*16) ways the fight can resolve, depending on the initial values of the three variables that affect RNG. I'm trying to test each possibility, but I'm currently only burning through one possibility a second (estimated completion date 2023). Anyway, I've got the speed on FCEUX turned up to 6400%, video size 1x, "Turbo" checked under "Emulation Speed", and on the "Timing" menu I've checked both boxes. Sound is disabled, and I unchecked everything under Config->Display. I also modified the rom itself in the hex editor and removed all of the text from the game, as well as a couple of the battle effects. I could do a little more, but I'm reaching the edge of my assembly-debugging abilities, and I doubt removing any more code could double my speed again. My script also forces the fight to the fastest message speed (the fight normally switches you to a slower speed) and mashes A. I tried running the script on Bizhawk this evening, but it looks like I can't get Bizhawk running nearly as fast as FCEUX. My script is pretty lean; I do have some GUI text I'm displaying every frame, but removing it doesn't seem to help (and I need -something- to display progress, to tell me which year the script will finish in). I'm not really sure what else to try at this point, other than going parallel and running multiple instances of the emulator on multiple machines, or coding my own battle simulator in something like C# and running that instead (which should be doable with the notes I have on the game). I've also considered seeing if I could modify the emulator itself (to remove...things? Maybe video-stuff? I don't need to see the fight.), since it's open-source. Are there any other settings (or emulators) I should check out? (In case you're curious, I've checked 960k possibilities so far and Ortega has never gotten King Hydra under 77 HP, which he did yesterday around attempt 850k. His old PB was 85 HP which he set around 32k... he's not PBing fast enough to convince me he can win.)