Posts for FatRatKnight

Post subject: I hope to be a one-man angry crowd.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
I am now aware of that which has taken place here. I am rather upset at the loss. Actually, potential loss -- It isn't lost yet, but is certainly headed that direction. I wish to argue for keeping this site running. It may well be possible that everything I say here will not impact the ultimate result (closure of site), but I'm certain that all I say here will be noticed. Your argument (the collective of the admins and judges I observe speaking here before this was opened to public), as far as the concept I have received from reading this thread, is that the site must represent perfection, and the emulation can't achieve this perfection. With conflicting goal and possibility, the site should dissolve. I will soon attempt to attack this reasoning through my own belief of emulation. Through this, I will attempt to inject a different thought, one that no one else has considered. I will also pose a question about emulation of the Next-Gen consoles, which may well reveal that the issue does not show up in that field, or it may end up further confirming what is feared. Finally, I will move on to the community itself. They are as good a reason as anything to bring up, and they do have a large impact even outside of Tool-Assisted Superplays. Now that I said what I will say, I shall go on to say it. The core randomness of the actual consoles. The timing wanders. Reading from uninitialized memory. All sorts of systems for randomness within the hardware itself. Successfully emulating this randomness will prevent movie files from working (without a measure to reproduce the same randomness from the movie file), yet it is this randomness that we don't emulate with complete precision. Hence, everything we do is inherently flawed. But the argument that I see is that the emulator can't match the console without going into the utterly bizarre. Perfectly emulate the sound, video, each and every opcode, defined or not, everything else, but the hardware itself still is random. What I ask is not that we must match the emulator to the console. This is asking for far too much. However, I will ask, is it possible, with all this randomness, that the console itself can match the emulator, however slim? The impression I got from each and every TAS is that, given perfect conditions, how fast we can complete each game. Given perfect conditions! All the randomness lined up to make our input file work, the timing is spot on, and the memory at power-on had initial values that were exactly that. What's so impossible here that the emulator is doing that the console can't do? I will predict one question that comes up that will poke a hole in my argument: Couldn't someone adjust the emulator to a certain, highly favorable randomness that does utterly break some games and lets them complete it far faster than what should be possible? Oh, no, it's not outside the realm of possibility for the console itself. I was just lucky, how can you prove otherwise? My response to that? I have no valid argument. I must concede at this point. But is this point enough to break the rest of my argument? The best I can say is that the emulator should attempt to produce the average case, whatever the average can be defined as. I hear all about the timing crystals and all that for older consoles. What about newer ones? XBox360, Wii, PS3, DSi? Are they subject to the exact same rules of hardware randomness that the older consoles have? Maybe. I don't know the details. If they are more "protected" from hardware randomness, then perhaps these consoles can still be emulated "perfectly." If so, TASVideos can still have a future through those consoles, given enough time for the emulators to finally develop. If not, your original point stands. I have put forth my thoughts on emulation, and a thought that it's not the fact we must match the console, but can the console match the emulation? I have also put forth a question about later consoles. But I don't feel the emulation itself is the whole issue. There is also a community here, and there has definitely been an impact on things that aren't a TAS. I note on the front page: "I've spent the past few days figuring out how to word this, and I still don't know" -- Are words a problem now? A great many people have come. One way or another, someone has successfully brought many people together into one site. Is it right to tell them to leave all because you declare that one concept is flawed? Granted, it's the founding concept of the site, but it is not the sole concept that everyone unanimously shares when coming here. I can say this believing my own concept and reasons may well be different from the site's. There has also been some impact in other areas. Actual speedrunners who actually do runs on the console can use some of the techniques discovered through TASing. Losing this resource (I am under the impression that TASVideos is a significant resource here) will certainly affect them. Obviously, what we're doing here has enough similarity to the actual console, correct? TASing can involve disassembling the game. We develop emulator tools for that. TASing might need assistance from scripts. Lua is added to it. Related communities benefit from our work on these improvements on our road to TASing. Even if the emulation itself is never perfect for TASing, we are a benefit to others that work on their own things. We are worrying far too much over perfection to. If there's a new concept that you want to have for the site, don't make English words a problem. Make it implicit until someone can come up with an especially well-fitting phrase that works for it. If it's all down to a single sentence that determines whether the whole site lives, then that isn't a useful foundation for the site. I suggest that you leave language out of whether the site lives. I have given my thoughts on community. And my thoughts on words with the concept, which I think is silly. Maybe I'm completely wrong about the community. Please correct me if I am. I may have been overzealous in defending the site, to keep it running indefinitely, in spite of my habits not showing the sort of activity that would call for this sort of argument from me. All my writing here can attest to that. I can always turn around and never look back to this site, and my own life will not be impacted much. But fact is, I want to keep the site going. I wouldn't know how to revive the site should it go down. If the decision here is final, fine. I am saddened, but I will simply move on. Scarcely any further mention from me of TASing, and almost certainly no drive to make any further attempts. That is what I believe I will do.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
HHS wrote:
Just use joypad.set with the table returned from joypad.read, with your changes to it.
If it only were that simple. Just how- ... Uh, okay. I put stuff in the main loop and things just magically work. Why, then, am I bothering with registers like emu.registerbefore and gui.register? I think I'd still have the problem with the display on stateload, but the fact the main loop does something I didn't expect is enough to work with. Okay, everything is changed. Everything. I'm working on a new script now! EDIT: It seems to show promise, indeed. Here's the message I had previously written before my further attempts: Suggest how I can make these changes. On any given frame, I can either read from the joypad to figure out what the user is doing, or write to it using what is stored in the script, but not both in the same frame. If I read up what the user is doing, I can't modify it and write to the joypad in the same frame, as far as what I have seen. I have made attempts using emu.registerbefore, and had no luck. Yeah, shrunk because I don't feel so... Eh, forget the word. Keywords in there being that I was using emu.registerbefore. I didn't try to, ya know, not use emu.registerbefore.
Post subject: Port attempt of Multitrack Script to Snes9x.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
This Pastey link contains my attempt. I have something working, but I can't really recommend it as a means for controlling more than 1 player. It's rather clunky, and I don't see any way around it. There are several problems I can not overcome. This is nothing like what I've made for FCEUX. The two major problems are as follows: Snes9x does not run lua through any register while paused. FCEUX will continuously run a function placed in gui.register even while paused. Intentional or not, this provided significant control. This feature allowed me to precisely tune the input list with script-defined keys. The same can't be said for Snes9x, by my experience, so far. Snes9x uses joypad.set in an ALL OR NOTHING basis. To put it simply, if I call this function, all 12 of the specified controller's buttons will ignore the user input, regardless of what buttons I actually want to handle. If there are both "passthrough" and "invert" options I can pick, this will allow me to mesh the user and script controls together, granting a rather fluid control. If just one of these problems are taken care of, I can make a script with far greater functionality. If both are taken care of, one can probably just copy the FCEUX script over, and with a little adjustment to accommodate the 12 buttons, expect it to work without problem. As it stands, there isn't much I can do from the lua side. There might be something more I can do, such as showing a bit more information and adding instructions, but it will not be anything close to what I made for FCEUX. In any case, pastey link up there. Play around with the script, though I sort of forgot to write up instructions for it.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
It syncs fine with me. I see your desync and raise you use Old PPU. I switched on New PPU. Indeed, after the first battle, I spotted our heroes failing to pick up the first Ax. I use [ Config -> PPU -> Old PPU ] again, and sure enough, the Ax is picked up. If that doesn't solve your problem, let us know.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
Now that you're not using MicroStorage, I suggest putting it in a zip whenever you upload something. Much smaller file size and such. Yeah, wow. Still no actual actions besides All-Out? I didn't think it would be that "easy" to do! Keep going! Fu Bing... 50 EXP away? Much closer than I expected! But seeing the run, you recruit Lu Bu, erase Guo Si out of existence, and manipulate most of the smallest Rebel Forces you can. And it's still not enough. I'm not sure if that remaining 50 EXP is possible to drop... Huang Zhong's level up messages should eat up somewhere over 30 seconds from when you pick him up until the end of the whole game. If the strength and growing HP saves those 30 seconds easily from the start, then it would no doubt be worth it to pick him up. Attempting to shove Zhu Ge Liang into the reserve is a bit clumsy, considering that Xu Zhe leaves your party and between then and when you get Zhu Ge Liang, there are no convenient points where you can fill up the now vacant spot. Besides, at the point you stopped, Ji Rou is available, which can help us tank hits much better. Something a dead Huo Hu certainly won't help us with. I guess it is true that you need to know how much TP the An Sha spree is going to use before we can assume we can ignore the bonus MTP. There are also other useful tactics like Ji Rou, Bei Ji, Yi Xin, and Ji Mian. If the manipulation before the An Sha spree requires is eating up too much time, we might want to cave in to one or a few of these tactics. I want to eventually insert input for Yoshi's Cookie myself. I like the idea of having a second game being played, without interfering with what we have for DoaE. I'd rather have the WIP be one with a finalized route, so I don't have to mess with things twice. And lastly, it appears that equipping flails first thing at the start of the game begins the first battle around 6 frames faster than your current run. Apparently, anything that involves dialogue or menus are fastest if you can lump the menus together. Or perhaps it's the area.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
Hmm... The most efficient possible Billeting... I think the best we can do is one trip to the Billet at Nan Yang. It's possible to go with zero until sometime after we pick up Zhu Ge Liang, but that involves things like skipping Han Zhong, Huo Hu, and probably Zhou Cang (maybe grab him anyway and auto-shove Wei Yan into Billeting), as well as being stuck with Mi Zhe for a long time. In any case, if we use Billeting once at Nan Yang, we should leave with the following party: 0 - Guan Yu 1 - Zhang Fei 2 - Liu Feng ? - Guan Ping 6 - Lu Bu We'll have four generals after Lu Bu leaves us on that surprise encounter. No tactician, but we can't get MTP from Fu Bing anyway, and Xu Zhe isn't far off. We can pick up and use Zhou Cang, Wei Yan, and Xu Zhe this way. What I'm thinking is, if we go the Han Zhong route, and skip Huo Hu, we should reach Nan Yang with: 0 - Guan Yu 1 - Zhang Fei 2 - Liu Feng 3 - Mi Zhe 4 - Han Zhong 5 - Guan Ping 6 - Lu Bu Bags 3, 4, and 6 will be open for Zhou Cang, Xu Zhe, and Wei Yan. We lose a potential 5 MTP. Without Han Zhong, we might want to pick up Huo Hu. Partly because we are short-handed from the current Han Zhong-less route with Mi Zhe defeated. We'll end with: 0 - Guan Yu 1 - Zhang Fei 2 - Liu Feng 3 - Mi Zhe 4 - Guan Ping 5 - Huo Hu 6 - Lu Bu Bags 3, 5, and 6 will be open for Zhou Cang, Xu Zhe, and Wei Yan. We get the 5 MTP. A different index, but I can't see how it would change things.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
It seems the most sensible routes so far are: - No Han Zhong, Lu Bu route - Get HZ, no Lu Bu - Get HZ, Lu Bu route The Yuan Shu chapter doesn't seem to have anything of interest that would affect our plans earlier. Skipping Huo Hu will lose us 5 MTP later on, if we want to avoid dropping Han Zhong. According to what I saw in the published run, anyway. What I don't know is how important is it to keep that 5 MTP at the end. If we get MTP from everything besides Fu Bing, we'll have 155 MTP. Skipping MTP from Jie Ce (skip Huo Hu) brings us to 150 MTP. Skipping Li Jian as well (any ideas on who we might want for that level anyway?) gets us down to 145 MTP. If we use Zhou Yu as our tactician like in the published run, we'll have 130 TP in the 145 MTP case, for use at the endgame. What I'm wondering is, how much do we need that 5 MTP from Jie Ce? From that point on until the endgame, is there some tactic-critical strategy that would speed things up then and there that needs this boost? Additionally, if we have someone who can learn tactics in the 7th spot, for whatever reason, we'll need to make sure it doesn't corrupt away important things like brand new shiny weapons or plot-required items on level up. A reminder, in case it's ever needed. By the way, that movie file has player 2 attached. Is there a need for it? Regardless, your program seems to be working out very well, and things definitely seem rather impressive already. It looks as though testing routes aren't incredibly painful when you can simulate battles faster than what mere humans are capable of. Progress is definitely a whole lot faster than I expect, in any case.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
Hmm, I don't think it's the item exploit bug, this time. While I was spending time on GameFAQs watching MeteorStrike unravel the game, it was said that the act of hitting B in battle to back up when you haven't even placed any orders yet will flag a specific general dead. This is done because the game is attempting to clear out general -1's actions, but needless to say, there's no general -1 -- there's other game data there. It doesn't matter what battle you back up in. Watch address 6312, fight the first random encounter that comes, and hit B when figuring out what to do with Liu Bei. Apparently, the life of one general hinges on whether the player isn't too indecisive somewhere in his career. Looking at the various memory addresses, I'm guessing the game, in an attempt at clearing out the TP cost of the "previous action", ends up overwriting a 0 at a spot 255 bytes ahead. I'm guessing this Guo Si just happens to be the particular unlucky general whose life is dictated by the player's will. I don't think you can redirect this wrath to anyone else.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
Won't be long before we can test routes versus unlikely odds. This should end well, especially once Acmlm includes support for enemy using tactics. We'll certainly rely on it to improve this run significantly. If we can fight Zhang Bao (Zhang Fei and Guan Yu ends with 100 HP) then go directly to Zhang Jao (1) and win without losing any of our three generals, that would seem to be a fairly optimal start. If we can't, we might want to hop into Xu Zhou and use Mi Zhe as a spare stack of HP (Survival is optional -- We might only need him to exist for MTP, which being alive isn't a requirement) and see how things work that way. Avoiding one inn trip will save a little time, but Xu Zhou is right along the way between Zhang Bao and Zhang Jao. How much is skipping the inn dialogue worth? We'd have to pay in manipulation time and, in the case we do pick up Mi Zhe, extra attacks that deal almost negligible damage as well as more dialogue when learning a tactic early on. There are three good points where we can pick up Mi Zhe, depending on the level of awesomeness on which we can manipulate luck: Before any fighting, before fighting Zhang Liang, or after we drop Liu Bei. Except maybe a few Elixir A or a Gullwing, I don't foresee any need to worry about the route in the future that we can affect here, other than make sure we can accommodate any recruits during Dong Zhuo's and Yuan Shu's chapters. Power-leveling off the end-game enemies doesn't seem likely that it would save time, given their HP and the fact we can survive without the extra EXP anyway. The map is still handy. I was aware of it, but let it completely slip my mind here. That, and I don't think I could have found it again on my own. It won't hurt to have a few lua scripts that just give information. Having one that dumps out STR * HPdigits * HPdigits * (Wpn or Wpn/2) / 256 on the screen should give us some idea on whether we should bother even allowing the general to exist for attacking stuff. I can work on these scripts for a bit. Anything in particular that might be a good idea to look at? I can try to work something up. Edit: I checked for Jia Xu just in case, as I distinctly recall reading that Liu Bei is the only one that can raise our MTP through Fu Bing. I encountered Jia Xu with an end-game party and didn't get the chance to recruit him. Clearly, we will not get the 5 MTP from Fu Bing without a rather severe grind in the first area. Naturally, plan for, at the absolute peak, 155 MTP.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
Twisted Eye wrote:
For Fu Bing, it's possible that we can pick up Jia Xu after the Dong Zhuo chapter. He's got exactly 220 INT and after the battle we're level 9. The 400 HP would help in the next section as well.
Where can we pick him up and is it worth the 5 MTP and the stack of HP then? We'd get someone who can't deal respectable damage without tactics if we do pick him up. I'm curious what the route should be against the Yellow Turbans. Picking up the Song brothers doesn't seem worth it -- There's the dialogue, their extra attacks that deals almost nonexistent damage (low strength, lack of Flails at the time), and an extra trip to the billet for room for more useful generals. What we get are meat shields that has a chance to save us a trip to the inn. Song Ren can't learn Cheng Nei, losing us 5 MTP if we skip Mi Zhe. So I'm guessing the route might look like this: - Zhang Bao + Get Ax + Use inn + Pick up Mi Zhe, fix up formation and equipment here - Zhang Jao + Get Ax - Han Zhong? + Use inn - Zhang Liang + If we get Han Zhong, Zhang Jao, cave version. Possibly skip Ax - If no Han Zhong, fight Zhang Jao at castle. Definitely no Ax + Usual plot advancement + This is the closest we'll ever be to the first item shop I'm starting to feel elixirs aren't worth it. How much use can we get from them? They offer the out-of-battle healing, but Chi Xin heals at the cost of a slow battle round, assuming we can afford the TP. Elixirs cost us shopping time and menu time when using them. If they can help avoid a detour to an inn, it's a possibility, but I get the impression it would have to be a significant detour that we avoid. We can still see if adding them to our shopping list while purchasing Gullwings can save time, though.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
I want to make sure what I'm looking at and what you're looking at is the same run. The one I see says Ma Chao and Zhao Yun are picked up and used in the active party. The screenshot is especially incriminating. At the moment, I'm mildly confused.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
The problem with Song Ren is his lacking intelligence. Sure, his 100 int is greater than his 80 strength, allowing him to learn tactics, but it isn't enough to learn Cheng Nei (120 int), a level we're getting before Huo Hu becomes available, losing us 5 TP. Better than no tactician, since between losing Liu Bei and gaining Huo Hu, the published run gains two levels, and would miss out on 10 MTP if we had no tactician. Each level up message for generals that gain HP takes around 80 frames. The published run (according to the .avi I have here) finishes at level 39. It recruits Zhao Yun at 15 (24 levels), Zhu Ge Liang at 16 (23 levels), and Ma Chao at 19 (20 levels). In total, that's roughly 5360 frames, close to 90 seconds. Will avoiding them eat up less time than the level up messages they bring? We're looking at roughly 30 seconds per general. Having more than one tactician in the party will eat up slightly more time for the messages to scroll through each one that learns the same tactic. Just to summarize what I see in the .avi here:
Tactic      Lv   Int  Published run's learner
Lian Huo     2    60  Liu Bei
Wuo Jian     3    80  Liu Bei, Mi Zhe
Shui Tu      4    70  Liu Bei, Mi Zhe
Chi Xin      5    70  Mi Zhe
Cheng Nei    6   120  Mi Zhe
Qi Shou      7   140  Mi Zhe, Huo Hu
Ye Huo       8    90  Huo Hu, Mi Zhe
Shui Jian    9   110  Huo Hu, Mi Zhe
Shui Xing   10   100  Huo Hu, Mi Zhe
Jie Ce      11   160  Huo Hu
Fu Bing     12   220  *MISS* (needs Liu Bei...)
Tong Xian   13   160  Xu Zhe
Yan Re      14   120  Xu Zhe
Shui Lei    15   130  Xu Zhe
Yin Xian    16   200  Xu Zhe
Ji Rou      17   200  Zhu Ge Liang
Bei Ji      18   240  Zhu Ge Liang
Yi Xin      19   180  Zhu Ge Liang
Li Jian     20   140  *MISS*
Hong Shui   21   160  Zhu Ge Liang
Da Re       22   180  Zhu Ge Liang
Wan Fu      23   220  Zhu Ge Liang
Ji Mian     24   200  Zhu Ge Liang, Zhou Yu
Tui Lu      25   140  Zhu Ge Liang, Zhou Yu
Gui Huan    26   150  Zhu Ge Liang, Zhou Yu
An Sha      27   180  Zhou Yu
Jin Xian    28   252  Zhu Ge Liang
Shui Long   29   220  Zhu Ge Liang, Zhou Yu
Huo Shen    30   220  Zhu Ge Liang, Zhou Yu
Ce Mian     31   240  Zhu Ge Liang
Keep in mind that the amount of available TP we can use is MTP * INT/256, the INT coming from our acting tactician's INT stat, naturally. If we learn every tactic, the highest MTP gets is 160, but we're obviously going to skip the MTP gain from Fu Bing, so 155. Zhou Yu's INT is 230, so the final segments will have us maxed at 139 TP to use. Skipping two MTP gains, leaving us with 145 MTP, will set us at 130 TP. I'll see what else I can pick at from the route. I'm still wondering if elixirs are worth it.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
Wow, that's pretty good progress! Soon, every battle will be taken apart thoroughly and with grace! The battles are a fairly significant portion of this run. But so is planning routes. Obviously, walking to various places is going to happen, but the battles themselves are still important. Just in case it is needed, here's the .fm2 of the "equip Flail first" run. Apparently, the Rebel Force's starting HP can be manipulated... I feel as though I should try to start up a discussion of the route... I mentioned elixirs. Some things that would be useful to know is how much time it takes to get to the first shop, how much more to go through the dialogue, and then menu transitions in the field to actually use those things. Is it too much to beat going to an inn or using Chi Xin? Is it possible to make use of purchasing a Gullwing as well while at the first shop? In Dong Zhuo's chapter, should we make a detour to the Gold Key and Gemsword so we don't have to fight Lu Bu until after we kill Yuan Shu? I note in the published run that there are three encounters with Lu Bu that we can practically erase using the Gemsword, and Lu Bu was definitely the focus of that run's attacks in the Yuan Shu battle. Another plus is we get a general with 255 strength, for a while, which can't be bad. It's a bunch of walking to get the Gold Key, and a bit more for Gemsword, so is it even worth the trip, even with a Gullwing on hand? And which generals can we skip? Mi Zhe seems like someone we're stuck with, assuming we want to keep building max TP until the next tactician rolls around, like Huo Hu. Are there anyone we're forced to grab that we don't want in our party? Something simple like having 7 generals in our current party might be of help, but is it worth dropping Zhao Yun or Ma Chao just so we can skip some level up text? In any case, the published run doesn't seem to manipulate the +5 TP on every level where a tactic is gained. Some mild testing seems to show that before the last "level up" general's text is displayed, you can manipulate the max TP. Any spots where this extra TP will come in handy? What about the TP we save by using elixirs instead of tactics? Will it ever be worth fighting a random battle for an earlier level-up? An Sha is certainly nice to have for just one battle earlier. But for that to happen, it looks like one would need over 3000 EXP from somewhere. Can that even happen from a single random battle? It helps to have a bunch of questions. Hopefully, this provokes further thoughts in other areas I fail to cover, seeing as there are less things to cover after this. I still plan to make attempts at including input for Yoshi's Cookie, seeing as we don't need the controller for a fairly large margin of time. Even walking around in the field, I seem to have 7 frames out of every 8 I can spend on things like double up on another game. More like an easter egg like what happened with this run...
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
I found my notes on physical damage I took while reading through GameFAQs. They're... Rather few, but I did effectively get this: Damage formula: * Strength * HP digits ^2 * Weapon power /256 * One of four random numbers (20, 23, 25, or the critical 51) /256 * (255 - enemy defense) /256 * (255 - enemy "castle defense") /256 Multiply them all together, in order and round down each step, and hope it works out. I'm not sure how accurate my notes are, but I'm somewhat sure all the factors are in there. EDIT: Hrm... Forgot the defend option. Unfortunately, my notes doesn't cover that. Thankfully, the displayed defense is actually what we're getting! Unfortunately, wearing just a Robe won't even let us last 10% longer... As for memory addresses that isn't already found on that guide's Memory Map, here's what I found so far:
61B4 -> 61BF - Agility
61D0 -> 61D9 -   0x40 - Done for the turn!
61E4 -> 61EE - Who's being targeted?
61EF -> 61F7 - Turn order
Also, address 00F3 looks promising -- Checking it for the value 8 seems like a good indicator whether we have access to the battle menu. I'll see what I can play around with in terms of scripting. Yours is definitely a start, especially since it already found something better than what I did, but I want to see if I can teach the bot how to back out of All-Out and re-initiate it. Maybe allow some basic win and fail conditions for the bot to watch out for. EDIT: Created a promising function...
local JoyEscape= {B= true}

local function WaitForRound(Escape)
--Will advance frames until the end of the round is found.
--It does so by checking 007E for the value 10.
--It won't leave before the round ends, so one might want to modify
--this function to place savestates in a spot just before the round
--ends if one wants to speed up brute-forcing.
    local WhoWent= 10
    while true do
        if Escape then  joypad.set(1,JoyEscape)  end
        emu.frameadvance()

        local temp= memory.readbyte(0x007E)
        if (temp >= 10) and (temp ~= WhoWent) then  break  end
        WhoWent= temp
    end
end
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
Well, I did successfully initiate the first battle several frames faster than the published run now, by equipping the Flails first thing after the introductory text, before I even take the first step. Having a little trouble manipulating the battle like I did before, but I haven't made thorough searches yet, been lazy. For now, I'm just scanning through the game's memory for things like the RNG (possibly 0x00AC to 0x00AF), data related to character stats, items, formation, and so forth (0x6000 and beyond). Alas, I so far have no idea about the RNG except for the suspected memory addresses, and I've only begun my search through these things. I'm curious what I can create with lua scripts. Even if it's as simple as displaying the hidden agility stat or telling you which one of the 7 "bags" the general is carrying, it's still something. Being able to read the necessary information at all is still useful for a brute-force bot, where we can successfully tell our bot that "total defeat" is not a desired outcome. A script that would calculate out an entire round of All-Out with a given starting RNG value and display the results and frames taken would be lovely, but that requires knowing some serious stuff about the game mechanics.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
From what I read, tactics damage is based off strength or intelligence, whatever is greater. Geniuses with no strength are still going to hurt stuff with a good tactic, I believe. Chi Tu Ma improves the hidden agility stat just by having it in the general's inventory. This gives a higher chance that said general goes first and possibly destroy something before it attacks, maybe even save a little time on manipulation of turn order. Whether that saves enough time to beat the menu transition to get it is hard to tell, but Chi Tu ma shows up early, giving it significant opportunity to be useful, even if you never bother trading it around. The damage advantage of having 1000 soldiers vanish if you take damage and go below 1000. Might turn out to be too high a maintenance just to maintain the increased damage potential, but this is something that should be checked, as usual. I'm curious if some time could be saved by picking up a few elixirs instead of having to backtrack to an inn at certain points, or as a replacement for that Chi Xin against Xu Rong and Guo Ji, preferring to All-Out the whole way through then heal with items after the battle. Naturally, this involves a trip to a shop and lots of shopping dialogue, but the advantages of skipping an inn trip and avoiding use of Chi Xin is something to be considered. Apparently, my run is a few frames slower than yours at initiating the first battle. That should be fixed, but I wonder if the luck manipulation will work out if I fix that difference. Even if not, I should be able to, theoretically, waste exactly enough time to get the same sort of luck as I did.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
Eh, all I did was the first battle. Over 200 frames faster than the published run at this point through better manipulation of that first battle. I seem to like visiting the GameFAQs boards. MeteorStrike had dug into the game coding a bit. One measure of damage is how many digits of HP (Okay, soldiers. Happy now?) each general has. It multiplies damage by the square of the number of digits, so if you have 172 HP, your damage is multiplied by 9. The multiplier is still 9 even if you have 913 HP. But once you hit 1000, that's when you get a nice jump in damage. Additionally, weapons are important. They're a pretty big factor in how much damage you deal. Heck, if you went weaponless, you'd deal less than a third of the damage than if you actually took the time to equip the starter Flails. Some of that information might be nice to have here, though...
    1~    9 HP : x 1 damage  (Uh... Nice knowin' you...)
   10~   99 HP : x 4 damage
  100~  999 HP : x 9 damage
 1000~ 9999 HP : x16 damage
10000 and up   : x25 damage

( NONE )     12
Dagger       25
Flail        38   (Note, this has nothing to do with
Ax           56    the displayed attack power.)
Club         84
Spear       128
Sabre       192
Trident     435 (Good grief, that's a big jump!)
Bow         289 Two hits! (effectively 578)
Sword       655
Battleax   1024
Scimitar   1280
Crossbow    768 Two hits! (effectively 1536)
Lance      1536
Wan Sheng  1792
Bo Ye      1792
Qing Guang 2048
Nu Long    2048
Qing Long  2048
Halberd    4096
For those who actually looks at the input display, you may note mysteriously placed input. That would be me adding in a little something for Yoshi's Cookie without messing with the main run here. I wonder if I can squeeze one more game in there without interfering with what I have...
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
No frame advance or save states, but script-assisted off-map glitching. It's... Hard to see what's going on. I need to make several trips back and forth because, apparently, the game is reading a different tile to find out if I can put down a power line. First, the quick pan using the A button puts the cursor in the non-glitch area. There are specific increments I can go to in order to put the cursor back into glitchmode, but I can't maintain the TAS-like building speed like in my WIP. Second, I can't move the cursor to the right. Up, down, and left are possible, but moving the cursor to the right isn't possible. I can pan to the right, but it gets the cursor out of glitchmode... Except in those specific increments I talked about. I'm a bit vague about those "specific increments," but at the moment, I'm not sure how to explain it. When I get a clearer idea, I'll try explaining it. Without any script helping you watch my movie, you'll be rather surprised at finding perfectly dry power lines where there was once water, when I finally scroll back. With a script, you can actually tell what's happening while I'm glitching stuff! Here's a script much like the one I used if you want to see what I was looking at:
local c= {}
c[0]= 0x808080FF -- Open land
c[1]= 0x000080FF -- Water
c[2]= 0x000080FF -- Water
c[3]= 0x00000080 -- ... I don't know...

for z= 0x0004,0x0013 do -- Shores!
    c[z]= 0x008080FF
end

for z= 0x0014,0x0026 do -- Forests!
    c[z]= 0x008000FF
end

local addrStrt=  0x7F0200 --Start of everything.

local CamX,CamY= 0x7E01BD,0x7E01BF -- Memory where camera position is stored
local CsrX,CsrY= 0x7E01EB,0x7E01ED -- Position of cursor by pixel
local IsBox=     0x7E0201          -- Is the cursor a box?

local CursorX, CursorY, CameraX, CameraY, BoxMode, TileLoc, TileVal

--*****************************************************************************
function RefreshScript()
--*****************************************************************************
    CursorX= math.floor(memory.readwordsigned(CsrX)/8)
    CursorY= math.floor(memory.readwordsigned(CsrY)/8)
    CameraX=            memory.readwordsigned(CamX)
    CameraY=            memory.readwordsigned(CamY)
    BoxMode= (memory.readbyte(IsBox) ~= 0)

    TileLoc= CameraX+CursorX + 120*(CameraY+CursorY)
    TileVal= memory.readword(addrStrt + TileLoc*2)
end

--*****************************************************************************
function DumpStats()
--*****************************************************************************
    gui.text(  1,  1,CursorX)
    gui.text(  1, 11,CursorY)
    gui.text(  1, 21,CameraX)
    gui.text(  1, 31,CameraY)
    gui.text(  1, 41,TileLoc)
    gui.text(  1, 51,string.format("%X",TileVal))
end

--*****************************************************************************
function TileOverlay()
--*****************************************************************************
    for i= 0, 31 do
        local ThisTileX= i+CameraX
        for j= 0, 27 do
            local Temp= j+CameraY
            Temp= Temp*120 + ThisTileX

            local color= false
            if (Temp >= 0) and (Temp < 12000) then
                local TileID= bit.band(memory.readword(addrStrt+Temp*2),0x0FFF)
                if c[TileID] then
                    color= c[TileID]
                else
                    color= 0xFFFFFF80
                end
            end
            if color then
                gui.box(i*8,j*8,i*8+7,j*8+7,color,color)
            end
        end
    end
end


--local LastLoc= 0
--local JoyPress= {}
--JoyPress["B"]= true
gui.opacity(0.5)

while true do
    RefreshScript()
    TileOverlay()
    if BoxMode then
        DumpStats()
        if (CursorX + CameraX) < 0 then
            gui.text(15,1,"Glitchmode",0xFF0000FF)
--            if (TileLoc ~= LastLoc) and ((TileVal == 1) or (TileVal == 2)) then
--                joypad.set(1,JoyPress)
--            end
        end
--        LastLoc= TileLoc

    end
    emu.frameadvance()
end
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
Limne wrote:
I don't suppose anyone could do an encode of the sample posted just above, could they? I'd love to give it a look.
I'll throw in my own request as well. I will appreciate it as much as you would should someone encode and upload to YouTube. I have little knowledge of how to create decent media files. In particular, could someone run that script of mine, and explore the "START NEW CITY" for a bit? Just scroll through the maps with the script active. Hopefully create a .avi .mkv .mp4 or whatever media file while you're at it.
Limne wrote:
Personally, I'd recommend doing the $999,999 trick; [...]
No question about that. I'm going to use that trick. No one would want to wait forever for silly things like taxes!
snorlax wrote:
I just thought of something: if you do plan on panning around the city during wait periods, you should try to show the formation of as many "TOP"s as you can.
Alas, the number of TOPs I'll likely end up getting on the fast road to Megalopolis would be zero. I simply won't have the needed Land Value for those things anywhere! Messing around some more with lua scripts. Now we can directly alter any tile! (pastey link) Mainly, I want to see what sort of city I should build if I have no water to worry about. Basically, I wanted to create a shortcut for myself when planning things out.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
Messing around with lua scripts some more. Actually, I wanted an ongoing mini-map, in order to help reveal the watery mess I'm removing while I'm glitching around in the black zone. However, it's also fun watching how the game actually generates maps! The map script is slow, as its reading from 12000 locations, working out what each means, and then painting 12000 pixels. Every single frame. I'll be looking over some other functions looking for something that might speed things up. If not, the slowdown isn't too unbearable. I'll throw a piece of the script here. Do sit there mesmerized while watching the game itself generate a map, revealed by the script!
local addrStrt=  0x7F0200

local c={}
c[0]= 0x808080FF -- Open land
c[1]= 0x000080FF -- Water
c[2]= 0x000080FF -- Water
c[3]= 0x00000080 -- ... I don't know...

for z= 0x0004,0x0013 do -- Shores!
    c[z]= 0x008080FF
end

for z= 0x0014,0x0026 do -- Forests!
    c[z]= 0x008000FF
end


function ShowMap()
    for i= 0, 119 do
        for j= 0, 99 do
            local color= 0x00000080
            local V= bit.band(memory.readword(addrStrt + (i + j*120)*2),0x0FFF)
            if c[V] then
                color= c[V]
            end
            gui.pixel( 48+i, 89+j,color)
        end
    end
end

gui.opacity(0.5)
while true do
    ShowMap()
    emu.frameadvance()
end
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
Rediscovering glitches I can use. It'll take a while, but I can replace water tiles this way. I can also shrink everything down, making real efficient zone-stacking. Stuff like that. I'm not exactly for this glitch, but a TAS is generally about breaking the game if it allows one to push it to the limits. And do so in a timely manner. Having the cursor planting power lines in the black gunk, then scrolling over to see all these horizontal power-lines where there once existed water will certainly have an unusual WTF factor. Thinking about this convinces me I should do it anyway, especially since it likely can reduce the in-game time to 600k population a bit. This will also affect my planned layout -- The city center will shift thanks to the fact I can have new zones where there previously was water instead. This shift causes a change in Land Value in many places, which will prevent certain areas from allowing R-zones to reasonably grow while allowing other areas to do so. I've created a simple script that identifies what the cursor is pointing at. (CursorX + CameraX) needs to be a negative value if replacing tiles is going to happen. Recommend you use a "small" tool like parks or power lines.
local addrStrt=  0x7F0200 --Start of everything.

local CamX,CamY= 0x7E01BD,0x7E01BF -- Memory where camera position is stored
local CsrX,CsrY= 0x7E01EB,0x7E01ED -- Position of cursor by pixel
local IsBox=     0x7E0201          -- Is the cursor a box?

local CursorX, CursorY, CameraX, CameraY, BoxMode, TileLoc, TileVal

function RefreshScript()
    CursorX= math.floor(memory.readwordsigned(CsrX)/8)
    CursorY= math.floor(memory.readwordsigned(CsrY)/8)
    CameraX=            memory.readwordsigned(CamX)
    CameraY=            memory.readwordsigned(CamY)
    BoxMode= (memory.readbyte(IsBox) ~= 0)

    TileLoc= CameraX+CursorX + 120*(CameraY+CursorY)
    TileVal= memory.readword(addrStrt + TileLoc*2)
end

function DumpStats()
    if BoxMode then
        gui.text(  1,  1,CursorX)
        gui.text(  1, 11,CursorY)
        gui.text(  1, 21,CameraX)
        gui.text(  1, 31,CameraY)
        gui.text(  1, 41,TileLoc)
        gui.text(  1, 51,string.format("%X",TileVal))
    end
end

while true do
    RefreshScript()
    DumpStats()
    emu.frameadvance()
end
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
I've been working on some lua scripts. Mainly reworking the one that Dammit made (It's proved helpful. Thanks) and milling around with subtitles. If I'm going to wait out for the city to grow, I'm going to make a script that will teach you how to create fully functional cities with absolutely no sense in them. Complete with simple animation involving boxes! I know, subtitles shouldn't determine whether the run will be published. What the viewer sees should go unaided if we want to be fair. But I may as well try to be impressive with those subtitles while I'm at it. Maybe even train a few veteran senseless city builders while I'm at it! I'll pan the camera around to help support the subtitles. This will be done minimally, however, as little as I can get away with, since each frame I'm holding a button freezes time. Besides, you won't be stuck seeing the same part of town for the entire 3 minutes we're stuck waiting for the first year to pass, so at least the unaided viewer gets to see something else for a little while.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
kwinse wrote:
I don't know if you already know this, but you can slowly move the camera around just by moving the cursor towards the edge of the screen. I don't think it pauses the city like the quick pan does...
FatRatKnight wrote:
At the moment, I'm wondering if I should just sit there until the end of the year or pan the camera around the growing city and slow things down (holding any button on the controller freezes time) for entertainment. [...]
I say it will slow things down. Else holding down the L button wouldn't work for things like the Boston Nuclear Meltdown or the money trick. EDIT: Although, I never did check for frame-precise cursor movements to see if I can ever move that cursor or something without, you know, freezing the simulation for a frame.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
arflech wrote:
The population goes up just above 70000 before settling around 46000, largely because of transportation decay.
The transportation decay happens because I didn't do the money trick to give myself $999,999. I didn't do the money trick because I ended input rather early. Mostly, I'm demonstrating the speedy construction. At the moment, I'm wondering if I should just sit there until the end of the year or pan the camera around the growing city and slow things down (holding any button on the controller freezes time) for entertainment. I show a sizable portion just sitting there, but seeing the same thing for a few minutes isn't exactly the most entertaining thing I can think of. However, I did decide what to do at the end. Once I hit 600k population, I will let the message that shows up play out fully. After the message disappears, I will show the map (Comprehensive, Pop. Density, Pollution, Crime rate, Land Value, then Police Radius), Voice, Totals, and History. After everything is said and done, I will end it all by selecting end and showing that sleepy moon. Causing disasters and leveling the megalopolis is also considered. But basically, I want to know these: - Slow down the game by panning the camera around, or sit there and let time pass a little faster? The difference isn't likely more than several seconds anyway. - Destroy my city of non-sense with a few select disasters? I will be crafting up a lua script to point out mechanics of this game for all the waiting. Never hurts to have something, but I don't intend for the script to affect the judging process. If the unaided viewer finds it boring, I don't want the informational aid to change the opinion of whether it should be published, even if the now-aided viewer is quite interested.
Editor, Experienced Forum User, Published Author, Skilled player (1174)
Joined: 9/27/2008
Posts: 1085
Whoops, wrong file! The first part might look something like this. Cheers for hyper speed building! Game-play begins at around frame 1900. On a side note, there are exactly two R-zones that are not satisfied with transportation. The TAS's only advantages are building at this speed and luck manipulation, if there's anything that can be manipulated. Again, the senseless layout is possible unassisted, and very easy if you're careful enough not to misplace any buildings. For obvious reasons, the building phases would be slower in an unassisted run. But that's about it. Waiting for time to pass involves not touching the controller. I can't pan the camera around without slowing down the passage of time, as far as I know. I may have picked a good spot to stop at, considering how much of the growing city I show. A lot of time is spent on waiting and doing nothing in particular. Just look at how long it takes to get to the tax screen at the end of the year. That's going to put a dent in entertainment... I may like subtitles, but I don't want them to be the exclusive source of entertainment during these parts.