The Elite Forum
The Big Three Plus One => GoldenEye 007 => Topic started by: Wyst3r on August 14, 2014, 06:30:24 pm
-
After hearing that AxZ was bringing a gameshark to the Swedish meetup, i started looking for something cool i could do with it. Something i had always wanted to try was to add a timer, similar to what can be done in Mario 64 and that exists naturally in Perfect Dark. Having such a feature could be a great tool for practise runs and could help us determine if an untied on some level is possible or not.
I knew that this was (to some degree) possible through the in-game scripting language, and the Goldeneye Setup Editor provides ways to write your own scripts and modify a ROM. However, for obvious reasons, you can't really change the ROM on an actual GE cartridge (EverDrive is your only option i think). A GameShark only modifies the RAM.
What you can do however, is to modify the scripts after they have been loaded from the ROM into the RAM. In fact, you can change scripts while they are running, and it'll still work. In order to add a timer, you can use 2 simple commands provided by the Goldeneye scripting language. The only additional logic needed is to make sure that you aren't currently in the intro cinema when starting the timer. Fortunately, GE has in-built commands for that as well. The whole script can be seen here:
(https://forums.the-elite.net/proxy.php?request=http%3A%2F%2Fi795.photobucket.com%2Falbums%2Fyy235%2FWyster%2FTimerScript_zps7ec6999e.png%7Eoriginal&hash=fc97d5502f2e2ca8c4b0346a6fe0387ebfc6b3fe) (http://s795.photobucket.com/user/Wyster/media/TimerScript_zps7ec6999e.png.html)
In order to add this to a level, you must add an entry into the level's script table. This is just a list each level has of the scripts it should run, and where the game can find them. An entry simply looks like:
[Address of the script's first byte] [Script number/ID]
Each of these is 4 bytes long. The script ID can be either 0000 04XX, or 0000 10XX. For the purpose of adding a timer, it should be 10XX though, since 04XX are scripts associated with NPC's. The final two digits simply needs to be a number not currently in use by the level.
Different levels will load into different memory locations and take up different amounts of space etc, so the script table will be in different memory locations for each level. I have already written down where these locations will be though, so it's not a problem.
Since most levels have no extra space for adding the script itself, you need to add it somewhere else in RAM, preferably someplace unused by the game. I chose to add my script near the very end of the address range, at 803FFF00. Then you just need the table entry to point towards this location, and the game will be able to run the script.
Only 2 problems remain:
1. Level's that already use a timer, won't work. As our timer gets overwritten when new ones are started. If for some reason you'd want a custom timer on these levels anyway, it's possible to disable the original timers. But i'm not gonna get into that unless there's some actual reason for it.
2. Depot and Statue won't work, as their script tables leave no space for adding additional entries. Not much you can do about this really.
Without further ado, here are the GS codes:
[Adding the script near the end of the address range:]
813FFF00 0200
813FFF02 03CE
813FFF04 01CF
813FFF06 0100
813FFF08 0202
813FFF0A 0101
813FFF0C 0002
813FFF0E 02B9
813FFF10 B503
813FFF12 0102
813FFF14 0400
813FFF16 0000
[Adding an entry into each levels script table:]
[Dam]
811EBCB4 803F
811EBCB6 FF00
811EBCB8 0000
811EBCBA 1008
[Facility]
811D6FB0 803F
811D6FB2 FF00
811D6FB4 0000
811D6FB6 100F
[Runway]
811DD364 803F
811DD366 FF00
811DD368 0000
811DD36A 100B
[Surface 1]
811E69E8 803F
811E69EA FF00
811E69EC 0000
811E69EE 100B
[Bunker 1]
811D5584 803F
811D5586 FF00
811D5588 0000
811D558A 1006
[Silo]
811D1B2C 803F
811D1B2E FF00
811D1B30 0000
811D1B32 1006
[Frigate]
811F0D24 803F
811F0D26 FF00
811F0D28 0000
811F0D2A 1008
[Surface 2]
811F3370 803F
811F3372 FF00
811F3374 0000
811F3376 1012
[Bunker 2]
811E4970 803F
811E4972 FF00
811E4974 0000
811E4976 1005
[Archives]
811D9564 803F
811D9566 FF00
811D9568 0000
811D956A 1003
[Train]
811D08B0 803F
811D08B2 FF00
811D08B4 0000
811D08B6 100D
[Jungle]
811B7B60 803F
811B7B62 FF00
811B7B64 0000
811B7B66 1007
[Control]
811DE3E0 803F
811DE3E2 FF00
811DE3E4 0000
811DE3E6 1007
[Caverns]
811D3C24 803F
811D3C26 FF00
811D3C28 0000
811D3C2A 1006
[Cradle]
811DBD80 803F
811DBD82 FF00
811DBD84 0000
811DBD86 1008
[Egypt]
811D3740 803F
811D3742 FF00
811D3744 0000
811D3746 100A
Edit: Several poeple have reported having issues getting this to work. The solution seems to be to put the level specific code first, *before* the generic code.
Warning: Don't try to use more than 1 of these at once. And don't try to play any other levels than the one that has been activated. Reason for this being that other levels might try and use the frozen areas of memory for its own data, and might end up freezing the game.
Best part about this is that the timer will be perfectly synchronized with the in-game timer. So the last decimal you see on screen will be your exact end time (no "rounding" like in Perfect Dark). To see the results in action, you can check out the vids below. I actually got my first 3:58 with this cheat turned on lol, which is why i later had to dupe it.
-
THIS IS AWESOME
-
what happens on levels which have a countdown timer come up
-
1. Level's that already use a timer, won't work. As our timer gets overwritten when new ones are started. If for some reason you'd want a custom timer on these levels anyway, it's possible to disable the original timers. But i'm not gonna get into that unless there's some actual reason for it.
So yeah, the countdown timer would replace this one, unless you disabled it. It'd still work up until that point though.
-
So do we allow these on the rankings? My vote is for yes.
-
brb buying a gameshark
-
Please if this is allowed im doing the same, I really would like the timer for studying runs and strats in addition to IL grinds.
(screw it im getting a GS anyways this is probably worth it just for that. Also silly question what do people recommend? what would be a nice get online?)
-
So do we allow these on the rankings? My vote is for yes.
I agree, because using this gameshark code does not make it any easier to use another one and cheat the run. The "detectability" of cheating by the use of a gameshark is the same, whether or not the person is using the in-game timer code (although it's not realistic to change the leaderboards to count the decimals, for obvious reasons).
Unless this line of thought is wrong (I hardly doubt it is), the "it's gameshark, this is wrong" is not a logically valid point. So only people with arbitrary moral issues can kind-of-make a case for banning it.
EDIT: Good Job! ^^
-
Also henrik is it possible to change the address for the script instructions in depot or statue so you can fit more instructions say. Over write the first thing as a jump to a free space in memory, have a copy of the orignal scirpt + timer, then jump back to where the game expects the script to end?
I am just guessing how the scripting in GE works.
-
Henrik are you able to get on SKype or Mumble in a bit and walk me through setting this up? I will do it on theelitegaming and make a highlight for everyone to see.
-
Also henrik is it possible to change the address for the script instructions in depot or statue so you can fit more instructions say. Over write the first thing as a jump to a free space in memory, have a copy of the orignal scirpt + timer, then jump back to where the game expects the script to end?
I am just guessing how the scripting in GE works.
That's not quite what the problem is. Basicly here's what it looks like in memory:
[Script #1 bytes]
[Script #2 bytes]
...
[Script #N bytes]
[Pointer to first byte of Script #1][Script #1 identifier]
[Pointer to first byte of Script #2][Script #2 identifier]
...
[Pointer to first byte of Script #N][Script #N identifier]
[One or several WORD's of only zero's, padding the script section to a 16 byte boundary (note that several levels have more padding than is actually necessary, adding extra lines of zero's)]
[Start of another data section, not sure what this actually contains, but it's almost certainly necessary to load the level properly]
The problem is that Depot/Statue only has 2 WORD's of padding after the scripts. And i need exactly 2 words to add the entry for the timer script. If there are no zero WORD's after this, the game won't interpret this section properly (it probably thinks there are more scripts).
A possible solution would be to take the last original script, just before the script table begins, and move it to a free memory location. Then change that script's pointer, and move the entire script table upwards. That would require alot of additional codes though, but is entirely possible.
Henrik are you able to get on SKype or Mumble in a bit and walk me through setting this up? I will do it on theelitegaming and make a highlight for everyone to see.
Yeah i could do this. It's too late for me today though so it'd have to wait til tomorrow.
-
Awesome job Henrik, I'm glad to see someone finally figured out how to make this happen. Wheat had posted a fairly simple GS code a while back that wasn't quite there, but what you've done here seems really solid from the little bit I played around with it just now. Shame about those pesky level timers though..
-
yeah mine had flaws that just weren't practical for speedrunning; if this works out well done. (that timer itself was only a two line code which is why I'm wondering if it can be simplified to a one size fits all except the obvious places)
-
This has prompted some council discussion - heads up. The attitude so far seems to be unanimous - everyone loves the find and loves its potential as a resource, but is concerned about competitive integrity.
-
Do you think we're closer to seeing the decimal places associated with completed runs (as a result of this finding?)
-
Henrik is the man! :pimp:
But using this for actual times on the ranks? Oh man would we be starting to go down a slippery slope. Let's be honest here, this requires a Gameshark to literally hack/modify the actual game code. Um.. yikes! Not so sure about the legitimacy of that.
-
I think the ranks should remain in full seconds if it was accepted. I think people could cheat somehow to gain hundreths if they wanted to. Kinda cool to see a timer for control you can leave when you want to regardless of natalya. Although im kinda in favor of it not being accepted.
-
Regardless if this will be accepted for PR/WR runs or not it still seems like it will be useful and fun.
I should have tried some more Dam agent with this after I got used to a better controller to see if my 53s are as high as I suspect.
-
This is an incredible find, and something that GE have always needed. Great job Henrik!
-
Do you think we're closer to seeing the decimal places associated with completed runs (as a result of this finding?)
I tested this with TAS and the timer should be fully accurate. The last time you see on screen, will have the correct decimals.
Edit: It's possible to view the decimals of a run without using cheats as well, although you still need to run the game through the GameShark. To do this, follow these steps:
1. At the completion screen, press the GS button. (needs Code Generator ON?)
2. Go to Memory Editor, press A, select "Goto Address".
3. Enter 80079A20.
4. Take note of the 4 bytes located here.
5. Bring up the Windows 7+ calculator, and goto View->Programmer
6. Select "Hex" instead of "Dec", and enter the 4 bytes from earlier.
7. Select "Dec", Copy the value, and goto View->Scientific, then paste the value.
8. Divide by 60.
I think the ranks should remain in full seconds if it was accepted. I think people could cheat somehow to gain hundreths if they wanted to. Kinda cool to see a timer for control you can leave when you want to regardless of natalya
There's no way to use the timer for end time anyway, simply because you could get boosts at the end up the run, making the timer invisible.
Another thing worth thinking about: These codes are US-NTSC only. JAP almost certainly requires a slight modification to the codes (?). PAL needs Action Replay as it doesn't work with GameShark.
-
This is really cool and I would love to play with it, however...this does not seem like a good thing to allow on the ranks.
"How come that guy has a timer in his videos?"
"Oh, he's playing with a gameshark."
"Wait, that's allowed in competition at the-elite?!"
"Yeah, but it's totally okay because we trust he's not using it for anything else like changing FR odds or anything."
I know you could argue you can't detect some kinds of gameshark use anyway, but that argument shouldn't legitimize it (and hasn't in the past). What are you going to do? Specify only certain GameShark codes? It would make more sense to legitimize Everdrives with an official "build" with a timer than to allow Gamesharks for timers. It also does give an advantage because you can time certain endings better.
That said, it would make the game more fun to play and watch for those of us who don't have "the eye".
-
Congrats on a really awesome find, Henrik! It's always cool to see how people can break down games.
It does seem like most in the council agree that it shouldn't be used to achieve times on the rankings, however. There's too many issues, including integrity and an inherent advantage which goes against the mission statement of the Elite.
It doesn't mean people shouldn't play around with this, though. Maybe good players can try to duplicate common times to see just how close to the +1 second cutoff they are, or other cool uses.
-
This also should make it easier for people to test out what's faster, whether it be a new strategy vs. an old strategy, strafe direction, lookdown angle, or just your own performance at multiple ways to accomplish the same goal. That new S1 SA/00A hut strat that Goose posted earlier is a great example.
-
This also should make it easier for people to test out what's faster, whether it be a new strategy vs. an old strategy, strafe direction, lookdown angle, or just your own performance at multiple ways to accomplish the same goal. That new S1 SA/00A hut strat that Goose posted earlier is a great example.
except, we already have better methods on emulator for all of these things (well it's really just henrik doing it). Best use I can see is figuring out exactly where you're losing time since tenths aren't necessarily easy to spot but there was already a gameshark code you could check out the lag for w/e you wanted to do.
edit--I've thought about doing some work on the latter for some various levels on console but I haven't been able to set aside the time for that
-
It does seem like most in the council agree that it shouldn't be used to achieve times on the rankings, however. There's too many issues, including integrity and an inherent advantage which goes against the mission statement of the Elite.
Yeah, tbh i was a bit surprised that it was discussed at all.
What about playing through a GameShark without any cheats active? The purpose being to check the exact endtime after already having finished a run. I'm not entirely certain but i don't think the GS affects the game at all if you don't actually activate any cheats?
but there was already a gameshark code you could check out the lag for w/e you wanted to do.
Check out the lag? How?
-
The only way I'd personally agree to having decimal rankings used is if the timer could be used on ALL levels, which it currently can't be. I dunno, what do you guys think?
I already explained that the timer couldn't be used for decimal endtimes no matter what, simply because the timer disappears when you get shot, so how would you rank a run with no final time visible on screen?
You CAN check correct decimals on all levels, by checking memory values after the run is already completed. But it still requires a gameshark.
If it has no affect on RNG, lag, or enemy AI, then I wouldn't consider it as using a cheat.
Technically, it doesn't change any gameplay. But for obvious reasons, things won't be exactly the same. For example, a recorded TAS movie will not synch with this cheat active. But even the slightest differences would cause that to happen so its not surprising at all.
-
Really awesome that you found a way to do this, Henrik. I've also been thinking about this, so it's cool to see it was possible to do.
The other method for finding out the decimals is also interesting, because it doesn't change the code or give any advantages with timing and such, so maybe that could be allowed in WR runs.
-
we don't use modifications that will give us a competitive advantage. A timer is a tool, which can be used for research purposes or pacing strategy.
I dunno, pacing strategy seems like a competitive advantage to me! You'll be able to perform certain strategies with more accuracy than someone who isn't using it, thus gaining an advantage.
I do hope people find cool uses for this in non-PR runs, though.
-
I don't think this should be allowed on the ranks in any form. It's modified game code; it just doesn't seem right. Otherwise, this is awesome. I'd love to see this developed into a modified game ROM that could be used in an emulator or everdrive. Maybe then the there would be space for end level timers to keep the precision along with the saved times?
I must've worded that wrong. What I meant was it doesn't give the player a direct physical advantage in game, in comparison to say, overclocking the N64's RAM would. It would just develop a player's eye for a run more quickly.
There is no way to overclock an N64 to get the game to run to the player's advantage. The gameplay speed is tied to the clock, so the game will run fast. (it will feel like turbo mode, except you can't get faster times with it)
-
Shouldn't be allowed, who know if the player has perfect FRs and Doaks added just like the reason Everdrive isn't allowed, so this is like the same but then with the timer added.
-
Great find, but the acceptance of the GE ranks would hit rock bottom if it was allowed and all rel players ran with a shark. Yes you can argue that disallowing sharks for timer usage doesn't change the detectability of cheating with a shark, but the average viewer doesn't care about such reasoning. Youtube comments and feedback from RL buddies who know my channel reveal that casual viewers hardly even accept a standard 1.2 run with lookdown and strafing. That is because it differs from the GE that they know and they don't understand what's going on. Now if they'd read about a shark being involved, they'd immediately put the speedruns down as irrel cheat-abusing charlatanism.
And it would also severely suck if most eliters would have to get a shark to fit in, i.e. compare splits and decimals. I'd rather not add another gimmick to the list of x/10 sticks, CRT, 2.x, NTSC, PAL, JAP, CC, screen settings, aimdot, 3rd party pads/sticks, rubberbands, gaffer tape, biker gloves, removed R-buttons, active/passive splitters, capture cards, recorders, encoding, stream settings and whatnot. GE running is already gimmicky as fuck.
tldr: Cool but incompatible with ranks.
-
It has already been decided earlier when this was found that any PR/WR with a timer should not be allowed on the ranks.
One question though, is memory viewing with a shark to get a decimal of a time allowed? Its not running any codes or anything like that, just having a game shark connected to the cart.
-
Biker gloves :kappa:
-
Removed R-buttons :nesquik:
-
^L-Lean :kappa:
-
Bump: Added Egypt codes. Aztec had the same issues as Statue/Depot.
-
aww yea dat egypt