Code Name: Viper TAS Improvement
I'm happy to announce an 81-frame improvement in Code Name: Viper! This TAS project began in early 2023, and I discovered new tricks to enhance gameplay.
Breakdown of Improvements:
  • 57 frames saved through gameplay optimizations
  • 15 frames gained from faster cutscene skipping
  • 9 frames gained from emulation differences between FCEUX and BizHawk (FCEUX is not accurate at emulating Code Name: Viper so that shouldn't be a concern)
New Techniques:
  • Despawning enemies
  • Manipulating loading frames between levels to control luck
The grenade door location (stored at RAM address 0x00A2) is frame-dependent, meaning it varies based on the exact frame you exit a level. Previously, this required sacrificing frames at the end of a level. However, the new loading frames technique eliminates this need.
This technique involves manipulating loading frames between levels to significantly impact:
  • Enemy behavior
  • Grenade door location
  • Cutscene duration
Additionally, RAM addresses 0x350, 0x380, and 0x3B0 store enemy type bytes from the ROM, enabling:
  • Enemy spawn and despawn manipulation
  • Tracking of off-screen enemies causing lag.
Detailed Level Improvements:
Level 1: Saved 10 frames through careful optimization.
Level 2: Gained 15 frames from improved enemy behavior and reduced lag.
Level 3: Found a 3-frame improvement through better grenade door placement.
Level 4: Lost 3 frames due to unfavorable enemy behavior and lag.
Level 5: Saved 3 frames to maintain a 28-frame improvement.
Level 6: Saved 15 frames by despawning enemies and reducing lag, but missed optimal grenade door placement by 1 frame so I had to sacrifice 5 frames resulting in a 10-frame improvement here.
Level 7: Gained 3 frames, but lost 2 due to bad luck.
Level 8: Applied all new tricks to save 18 frames.

nymx: Claiming for judging.
nymx: It's very impressive that you took that much time to try and optimize your own work even further. It reminds me of a game or two that I've redone myself, that yielded a small chunk of frames. From my experiences, it is more rewarding to dig for those "hard to find" frames than to find places that enough effort wasn't given on an original attempt. I congratulate you on your work, as this appears to be a complicated game to optimize.
Btw, I'm just now noticing the "Sync" contributors to the submissions. I want to thank adelikat for offering a confirmation on the syncing of this movie. Accepting over [5166] NES Code Name: Viper by Pankaj in 10:46.80.
fsvgm777: Processing.


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15576
Location: 127.0.0.1
This topic is for the purpose of discussing #9246: Pankaj's NES Code Name: Viper in 10:45.45
Bigbass
He/Him
Moderator
Joined: 2/2/2021
Posts: 193
Location: Midwest
Was curious if moving to BizHawk would be enough to console verify this game, but alas, it isn't. Even more convinced now that this game likely requires initializing memory in order to verify, which I don't have the equipment to do. While I managed to get the movie syncing in emulator, the ROM hash (SHA1) from the movie file doesn't match anything I have. It synced for me using:
"Code Name - Viper (USA).nes"
without header: 220939191A48FB2CF3A73C8FD713A60AD2EE34DF
   with header: 4C86AE577454B6DE9A3FE48ACBB7F095C8B82D3B

with a different header: 3F7428865EA2E95632E32E8C3638207FED12BB52
TAS Verifications | Mastodon | Github | Discord: @bigbass
Editor, Skilled player (1439)
Joined: 3/31/2010
Posts: 2108
Very nice improvement once again. Yes vote.
Reviewer, Experienced player (920)
Joined: 11/18/2011
Posts: 312
Location: Morocco
Nice run! Love the consistent improvements! Yes vote!
I still learn more about English. https://www.youtube.com/user/McBobX100
I wrote:
Working is the best way to achieve goals in speedruning. Hardworking is a pain.
DrD2k9
He/Him
Editor, Judge, Expert player (2213)
Joined: 8/21/2016
Posts: 1090
Location: US
Bigbass wrote:
Was curious if moving to BizHawk would be enough to console verify this game, but alas, it isn't. Even more convinced now that this game likely requires initializing memory in order to verify, which I don't have the equipment to do.
Would poking a random value (instead of the emulator default) into all RAM at frame zero (after the emulator initializes RAM but before the game code does any changes) help determine this? I’m thinking if RNG changes in such a case, then we’d know it’s based off uninitialized RAM seed instead of a game defined seed. If the RNG stays the same with different poked RAM values at frame zero, then the RNG must come from something the game code specifically sets.
Bigbass
He/Him
Moderator
Joined: 2/2/2021
Posts: 193
Location: Midwest
DrD2k9 wrote:
Would poking a random value (instead of the emulator default) into all RAM at frame zero (after the emulator initializes RAM but before the game code does any changes) help determine this?
Not necessarily no. I've already thought of this idea. Theoretically yes it could work, but I'm not certain RAM (or WRAM in particular) is the only place games use to generate randomness. Also, I'm not sure if the test is even possible. I did some brief experiments awhile back with a game I thought required WRAM initialization for console verification (based on someone else having verified it), but modifying the RAM state as suggested didn't seem to have any effect. Don't recall which game it was though. More research and testing is needed.
TAS Verifications | Mastodon | Github | Discord: @bigbass
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Link to video I got it work on console, took quite a few tries though,
Pankaj
He/Him
Active player (284)
Joined: 10/20/2022
Posts: 61
Location: Rajasthan, India
ThankYou for all your efforts! I'm happy to see my tool assisted speedrun got verified.
XTREMAL93
He/Him
Active player (446)
Joined: 1/6/2012
Posts: 586
Location: Azerbaijan, Baku
Good job! You have squeezed out all frames of this game)
Post subject: Movie published
TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15576
Location: 127.0.0.1
This movie has been published. The posts before this message apply to the submission, and posts after this message apply to the published movie. ---- [6155] NES Code Name: Viper by Pankaj in 10:45.45