Alyosha
He/Him
Editor, Emulator Coder, Expert player (3827)
Joined: 11/30/2014
Posts: 2834
Location: US
Since I couldn't find a topic about this I decided to make one to at least document findings / information. This is probably the simplest and clearest case of RAM initialization (aside from the trivial example in NES Cybernoid) that makes a good sandbox model. RNG and RAM: The game uses a counter that increments once per frame (excluding some laggy parts) from power on. This counter is at $09. The important point here is that the game never sets the initial value here, and just constantly INC's it until the screen asking you to press start to play, at which point the solution to the game is decided. As it happens, we have 2 snes emulators that are very accurate (using bsnes 0.85) and otherwise mostly the same aside from initial RAM state. Bizhawk has initial value of #$C3, while lsnes has initial value of #$55. As demonstrated by spikestuff, these lead to very different solutions. Game info: Deign found that the solution is stored in the following form: 7E1048: Culprit 7E104A: Weapon 7E104C: Room Each is one byte, and the following values represent each person: 00 - Col. Mustard 02 - Professor Plum 04 - Mr Green 06 - Mrs Peacock 08 - Miss Scarlet 0A - Mrs White 0C - Knife 0E - Candlestick 10 - Revolver 12 - Rope 14 - Lead Pipe 16 - Wrench 18 - Hall 1A - Lounge 1C - Dining Room 1E - Kitchen 20 - Ballroom 22 - Conservatory 24 - Billiard Room 26 - Library 28 - Study Optimization: Deign in his run mentions that different choices take different amounts of time to load and gave guidelines for which is the fastest / slowest. This was done in snes9x 1.43 and I'm not yet sure how well it translates into current emulators, but there are some solutions which are noticeably slower then others, so this needs to be investigated. There are a relatively small number of solutions and player choices, so a bot would probably be the fastest way to work out what the true optimal run would look like. Judging by Deign's notes I think this should Green accusing Green with the wrench in the ballroom, but I'm not positive. I'll update this with more information as I work on it.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3827)
Joined: 11/30/2014
Posts: 2834
Location: US
http://pastebin.com/Ru5ZKyYB Ok, so I created a lua file to determine the solution for every initial value of $09 given perfect menuing. That pastebin link is the result. Using that, I found that Deign's original solution could be achieved with perfect menuing with seed 90 (0x5A) Using this info, I then made lua run a game with this seed and play to the end. The result is that Deign's run, if played on bsnes with perfect menuing, would be 1615 frames long. This is considerably longer then the snes9x 1.43 version, but is still quite a bit shorter then in Spikestuff's submission. So the 1615 frames can be considered the ideal re-sync of Deign's run, and any run shorter then that would be a true improvement. I'll try to find such a solution, it shouldn't be too hard now that I have some of the machinery in place. For anyone interested, here is the script: http://tasvideos.org/userfiles/info/28726429975577947 You'll just need to make a savestate at frame 0 and save it under the correct name.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3827)
Joined: 11/30/2014
Posts: 2834
Location: US
There are a lot of repeat solutions in the List I posted, so there might be another aspect to the RNG that I haven't accounted for. Also I tested quite a few different possible solutions, and so far Deign's run still wins. The closest in Green accusing himself with the wrench in the ballroom, but the problem is that to get green to be the accuser, all 3 of the lower 3 characters on the selection screen have to be selected. Play in the game starts at Ms Scarlet and proceeds clockwise, so in order for green to be the accuser, he needs to be the first human player in the rotation. This takes 4 frames to set up, and just 2 frames too long to beat Deign's run. I don't think I'll put too much more into this. But, the important point here is that RAM initialization makes Deign's solution optimal, and this cannot be achieved in Bizhawk or lsnes without it.
Former player
Joined: 6/30/2010
Posts: 1107
Location: Zurich, Switzerland
I think your work with this game raises a good question, Alyosha. Should we replace published runs that were done on outdated emulators with newer, slower files that are accurate? I think we definitely should do that, accuracy is very important for TASing!
Current project: Gex 3 any% Paused: Gex 64 any% There are no N64 emulators. Just SM64 emulators with hacky support for all the other games.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3827)
Joined: 11/30/2014
Posts: 2834
Location: US
I definitely agree, which is why I asked for just that in the Umihara Kawase fun by Flagitious. For Clue though I don't think any of the groundwork is in place to make that happen, so it will probably have to lie dormant for a while, even if a real improvement is found, oh well.