 |
 |
GoldenEye 007 Nintendo 64 Community, GoldenEye X, Nintendo 64 Games Discussion GoldenEye Cheats, GoldenEye X Codes, Tips, Help, Nintendo 64 Gaming Community
|
 |
 |
 |
 |
|
 |
 |
 |
 |
 |
Wyster Agent

Joined: 04 Jun 2007 Posts: 11
 |
Posted: Tue Sep 06, 2011 5:19 am Post subject: TAS'er looking for some memory watching help... |
 |
|
Hi, i'm not entirely sure if this is the right section to ask this, but this was the only one which seemed somewhat appropriate. I guess this might be a bit off-topic since it's not really related to any modding project so I apologize if this is the wrong place.
I don't know how many here knows who i am but for those who don't, i used to be an active speedrunner of this game, though for the last couple of years my focus has been on creating Tool-Assisted Speedruns. For those who don't know what it is, it's basicly a playthrough of a game done on emulator using slowdown/savestates etc to create a "perfect" superhuman playthrough. If you've never seen one, you might wanna check this out: http://www.youtube.com/watch?v=UTafBzc5RcI&feature=channel_video_title
In creating TAS'es, memory watching has proven to be a fantastic help since it not only allows you to watch values such as the timer, Bond's speed and headshot count but also it gives a much better understanding of how the game works and allows you to manipulate it to your advantage. However, while alot of useful values has been found, there's alot more that i wish to find. There's very few poeple over at tasvideos that has any experience at all at hacking this game, so i figured it couldn't hurt asking the poeple who's actually hacked this game for years and even created the Goldeneye Setup Editor for further insight. (The GE Setup Editor has been a great help to me, especially when it came to frigate where i never would've achieved 56 seconds if i hadn't been able to check the action blocks for exactly how the hostages escape routine works.)
I'm currently working on Surface 1 and one major concern on this level is that you need a grenade, which can only be gotten from one of the 4 randomly spawning guards. The problem is that you don't want to go off-path in order to get this nade, but instead have the guards spawn in a way so that they end up at the right place at the right time.
The action block for the spawning of these guards uses a cycle counter and randomly seeded numbers to determine when the guards spawn. Where they spawn seems only dependent on which room Bond is in when a guard decides to spawn. I already found the values for the cycle counters, but i haven't been able to find the randomly seeded numbers.
So basicly my questions are:
Is it possible to view the randomly seeded numbers, and if so, where? (is there an RNG somewhere?) Also is it possible to see whether the expression "is seeded number > xx" turned out true or false?
Any insights into how the randomness of this game works would be a great help  |
|
|
|
|
|
 |
 |
 |
 |
 |
zoinkity 007


Joined: 24 Nov 2005 Posts: 1730
 |
Posted: Wed Sep 07, 2011 11:34 am Post subject: |
 |
|
The seed is alternately read as both a doubleword and as two words from:
80024460 - 80024468
Also, these TLB functions are used to play with the value:
7000A450 V0= random number [80024460]
7000A498 increment random number
7000A4AC V0= rand num, using double at A0 as base
Keep in mind many other routines use these three functions. Also, all actors (including players) have several personal random values assigned to them used for specific purposes. They're built off the generic seed and will usually be the same each run, but they can effect what actions they use.
From what I remember though, guards don't just have grenades. There's an action command (randomly triggered) that generates a grenade for them which they then throw at the player. You could create a statistical advantage to them using the grenades by altering the usage rate, which from what I've seen in the speedruns wouldn't be obvious on account of everyone running face-down. That's one big flaw with GE speedruns--you never see them. Now, the Majora one, that's something ;*) _________________ (\_/) Beware
(O.o) ze
(> <) Hoppentruppen! |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6177
 |
Posted: Wed Sep 07, 2011 12:30 pm Post subject: |
 |
|
Great to hear you're using editor in a unique way, and welcome! And very cool TAS runs. Would it be easier to just view the coordinates of the 4 guards and watch them as soon as level starts so that you know which start they're at? |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6177
 |
Posted: Wed Sep 07, 2011 1:26 pm Post subject: |
 |
|
Out of curiosity what did you learn about hostages in frigate? |
|
|
|
|
|
 |
 |
 |
 |
 |
Wyster Agent

Joined: 04 Jun 2007 Posts: 11
 |
Posted: Thu Sep 08, 2011 1:49 am Post subject: |
 |
|
Thanks alot for the replies!
Quote: | Would it be easier to just view the coordinates of the 4 guards and watch them as soon as level starts so that you know which start they're at? |
The problem is that the guards don't spawn when the level starts, but rather they have a cycle counter and each time it gets to 120 they seed a random number, and based on this, they can spawn(or not). Finding their coordinates was my first idea but the position is as far as i can tell, not static addresses so it's diffrent each time. And there are 4 guards so i don't even know which guard is which.
Quote: | Out of curiosity what did you learn about hostages in frigate? |
I learnt that the exact moment their hostage taker has finished fading out, they choose 1 out of 6 presets which will be their "escape point". When they reach this point they simply make a check that Bond isn't watching them, and then escapes. So manipulation became pretty easy for me since i just had to manipulate their choice of escape point when hostage taker died.
Quote: | From what I remember though, guards don't just have grenades. There's an action command (randomly triggered) that generates a grenade for them which they then throw at the player. You could create a statistical advantage to them using the grenades by altering the usage rate, which from what I've seen in the speedruns wouldn't be obvious on account of everyone running face-down. That's one big flaw with GE speedruns--you never see them. Now, the Majora one, that's something ;*) |
Altering the usage rate? Is that related to the personal random value? Btw i've decided to not use lookdown at all in this run for entertainment purposes. (and yeah, majora's mask TAS is amazing )
Quote: | The seed is alternately read as both a doubleword and as two words from:
80024460 - 80024468
Also, these TLB functions are used to play with the value:
7000A450 V0= random number [80024460]
7000A498 increment random number
7000A4AC V0= rand num, using double at A0 as base
Keep in mind many other routines use these three functions. Also, all actors (including players) have several personal random values assigned to them used for specific purposes. They're built off the generic seed and will usually be the same each run, but they can effect what actions they use. |
Thanks alot! Found the seed now and it's probably gonns be incredibly useful!
Edit: So the seeded values are indeed 16-bit words, but in the GE Setup Editor, the values are always compared with values below 255, so it seems the game converts the value to a byte before comparing it. Any ideas of how this is works exactly? |
|
|
|
|
|
 |
 |
 |
 |
 |
zoinkity 007


Joined: 24 Nov 2005 Posts: 1730
 |
Posted: Thu Sep 08, 2011 7:55 am Post subject: |
 |
|
Action commands use the first byte from the word grabbed by the V0=rand function there. _________________ (\_/) Beware
(O.o) ze
(> <) Hoppentruppen! |
|
|
|
|
|
 |
 |
 |
 |
 |
mistamontiel 007


Joined: 17 Apr 2011 Posts: 849 Location: Miami, FL, CUBA  |
Posted: Thu Sep 08, 2011 5:16 pm Post subject: |
 |
|
Wyster, you've got to promote your joint effort with 3iikka on your completely superhuman Perfect Dark TAS.
I L0VE Y0U MAN ! Damn.
http://www.youtube.com/watch?v=18jZHOwdYME |
|
|
|
|
|
 |
 |
 |
 |
 |
PaRaDoX 007

Joined: 17 Oct 2009 Posts: 713 Location: Grid  |
Posted: Thu Sep 15, 2011 6:10 pm Post subject: |
 |
|
That TAS Run was simply....amazing |
|
|
|
|
|
 |
 |
 |
 |
 |
Wyster Agent

Joined: 04 Jun 2007 Posts: 11
 |
Posted: Fri Sep 16, 2011 1:56 am Post subject: |
 |
|
I'm glad you enjoy it :)
Lately i've been researching Streets a bit trying to figure out how it's random guards work. It'll be a long time before i get there but since it was a pain in the ass the last time and i never figured it out then, i thought that i'd try and change that this time around.
So basicly what i'm curious about is what decides when a random guard spawns, where he spawns and with what weapon(the goal here is to get a guy with a grenade launcher to spawn in a good spot, preferably 2!).
My action block reading skills are not exactly good but as far as i could tell, there are 4 guards spawning, and when they spawn are decided by action blocks 1002, 1003, 1005 and 1006. It first waits for a cycle counter that goes to 1200 but after i couldn't get much further. Anyone here have a good idea about how it all works? |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6177
 |
Posted: Fri Sep 16, 2011 3:16 am Post subject: |
 |
|
If you check block 1001, it looks like it sets 2328 preset of spawned guards to certain presets, depending on what room you step on! This should help you quite a bit. The action block editor does tell you which spawned guard action goes to which preset. The guards are spawned using an action block 0403, which jumps to 040A, which uses a random number to choose gun.
Also, interestingly enough, 1004, 1007 and 1008 are clearly missing, and clearly should be a spawned guard as you can see from 1001. Guess made it too difficult or something. |
|
|
|
|
|
 |
 |
 |
 |
 |
oldyz 007

Joined: 02 Dec 2009 Posts: 607
 |
Posted: Fri Sep 16, 2011 10:53 am Post subject: |
 |
|
Ollllo here:
Wyster: we have some weird sound issue using the avi recording of mupen,
do you know if this is common & if there is a fix to this?
Oldyz is on vancation: eating fermented green bananas gives hallucinations |
|
|
|
|
|
 |
 |
 |
 |
 |
Wyster Agent

Joined: 04 Jun 2007 Posts: 11
 |
Posted: Sat Sep 17, 2011 3:52 am Post subject: |
 |
|
Yeah that's pretty much as far as i had gotten ^^
There's still alot that i don't get though. For instance, when i selected the preset's of the "optimal" spawn position where i know for sure guards can spawn, the only guards actually using them are the ones with "Invalid ID" and those guards seem to be deleted! (The missing 1004 block...)
According to action blocks, only 2 regular guards are spawned and 2 civilians. but i'm pretty sure there's more than that?? (i might be confused since they respawn if dead)
Anyway, it's always seemed very very random where guards spawn yet there's no randomness in their spawn function! It should be easy to manipulate them but in my experience they are the most difficult of all guards in GE to manipulate. Considering that in TAS and speedruns, Bonds position should be roughly the same when the cycle reaches 1200, so in theory, guards should be spawning in very similar positions. But they don't.
So i must be missing something in their spawn function... Here's my attempt at decoding it:
1002:
8E2A Change Guard ID (2A)
AE Reset Cycle Counter And Enable It
024E Resume If Return Value Loop Met
03 Leave The Routine, But When Return Continue From Spot
B40004B003 If Cycle Counter > Value, Return Value Loop B4 (0004B0 #1
014E Go To Beginning, Then Return Value Loop
0203 Resume If Return Value Loop Met
9C0000020009 Check If Objective Value, Return Loop If So (00000200) #2
AE Reset Cycle Counter And Enable It
0208 Resume If Return Value Loop Met
03 Leave The Routine, But When Return Continue From Spot
B400012C2C If Cycle Counter > Value, Return Value Loop B4 (00012C) #3
0108 Go To Beginning, Then Return Value Loop
022C Resume If Return Value Loop Met
31202C If Bond In Room With Guard ID, Return Value Loop (Russian Soldier: Olive Drab) #4
0103 Go To Beginning, Then Return Value Loop
022C Resume If Return Value Loop Met
AD737061776E31 = spawn1
F306 If Player Pickups Disabled, Return Value Loop
BD02FF232804030000001006 Spawn Guard (Russian Soldier: Olive Drab) (Random Head) #5
AD2D3E6661696C = ->fail
0103 Go To Beginning, Then Return Value Loop
0206 Resume If Return Value Loop Met
AD7331204F4B21 = s1 OK!
0103 Go To Beginning, Then Return Value Loop
0209 Resume If Return Value Loop Met
03 Leave The Routine, But When Return Continue From Spot
9C000001002C Check If Objective Value, Return Loop If So (00000100) #6
0109 Go To Beginning, Then Return Value Loop
022C Resume If Return Value Loop Met
0103 Go To Beginning, Then Return Value Loop
04 Terminator
In Pseudocode:
1. Loop around #1, simply wait for cycle counter to reach 1200
2. If something about objective value(#2)
2A. Goto line #6 and wait for objective value to change into something, then goto #4
3. Else
3A. Loop around #3, wait 300 cycles then goto #4
4. If Bond in room with guard ID(#4), then spawn the guard(#5), else redo some steps.
The last line here is wierd, why does bond have to be in the same room as one of the guards guarding the tank for a guard to spawn? Seems very arbitary. And what's the objective value it keeps checking?? |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6177
 |
Posted: Sat Sep 17, 2011 4:54 am Post subject: |
 |
|
If you look at those spawns, they use the 2328 preset, which is a dynamically assigned preset. It's default value is in object, then in this case, it gets set by guard id in the 1001 block. So it works like, in 1001 block, whatever room you walk in, it changes the 2328 preset to preset XXXX. So in spawn, even though it doesn't seem random, it is, because its spawning you to dynamically set 2328 preset.
In the spawn blocks, look like they spawn after a set # cycles, then goes to top again. It works with block 1001 and uses 00000200 and 00000100 objective bits as variables in the process. But basically just spawns every so many cycles if in the rooms in the block 1001. |
|
|
|
|
|
 |
 |
 |
 |
 |
Wyster Agent

Joined: 04 Jun 2007 Posts: 11
 |
Posted: Sat Sep 17, 2011 12:43 pm Post subject: |
 |
|
I did some memory watching on my old run and here's basicly how the spawning goes for guard with ID 2E:
1. Wait 1200 cycles (no spawning yet)
2. Wait 540 cycles, repeat until Bond is in room with guard with ID 22. This was repeated 3 times in my old run before the guard actually spawned.
So in the end, what determines when he spawns is the line: "31222C If Bond In Room With Guard ID, Return Value Loop (Russian Soldier: Olive Drab)"
I don't understand this line at all. Why is spawning dependent on this 1 guard? Seems completely arbitary. And what happens if he's dead? Is it possible to block spawning completely by never being in the same room as this guard? I guess i haven't completely understood how this line works.
The specified guard has the same ID that is given to the spawned guard later btw which is wierd, they can't have same ID can they? |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6177
 |
Posted: Sat Sep 17, 2011 12:58 pm Post subject: |
 |
|
You can have more than one of same id, but I think in spawn block, it oddly changes the id after initial creation, not sure why.
If that's what the block says, and no other paths to that return value loop, it is possible not going in that room he won't spawn. I haven't analyzed it enough to know. |
|
|
|
|
|
 |
 |
 |
 |
 |
|
 |
 |
 |
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
 |