ZSR Forums
May 01, 2024, 06:26:47 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: ZSR Forums are back - read only!
 
   Home   Help Search Members Login Register  
Pages: [1]
  Print  
Author Topic: RBA and Ganoondoor Full-Depth Explanations!  (Read 8938 times)
CFerens
Deku Scrub

Posts: 10


Email
« on: May 25, 2013, 05:21:28 PM »

Hello again, this time I'm posting to try and figure out the technical, full in-depth details of how these glitches work! I somewhat know how the Ganondoor works. To my knowledge, the warp counts up from Frame 0 to Frame 101, and once it hits Frame 101, it warps you. However, when you use ocarina items on the edge of the warp, you are able to maintain control of Link (which you aren't supposed to have) and are able to move him to the door entering the Deku tree basement (the warp is off the camera, meaning it's not counting frames). This is when it gets confusing for me. When you open the door, it sometimes takes you to Ganon's castle, and this is how I think it works. When opening the door, if done on the 101th frame of the warp, you are taken to Ganon's castle because the game tries to load the cutscene in the Deku tree basement. However, there is no cutscene to be loaded so the closest cutscene relative to the Deku tree basement is Ganon's castle, which is why it warps you there. Now, please correct me if I'm wrong on this, I would really appreciate knowing the full technical details of the glitch.

Now, for RBA, I'm completely lost. If possible, I need a full explanation from how the Bottle on B works, and how RBA works. Thanks in advance.

Lastly, some may wonder why I would like to know all of this. It kinda bugs me when I try and practice these glitches when I don't know how they actually work, which is why I would like technical explanations for how they actually work!

Thanks,

Chris
Logged
mzxrules
Admin
Ultimate Mega Guay

Posts: 901


Wrong warp expert


« Reply #1 on: May 25, 2013, 08:54:53 PM »

RBA is very simple.

Basically, your button inventory is represented by the following sequence, where each value is a single byte big.

B Button, C-Left, C-Down, C-Right, C-Left Slot, C-Down Slot, C-Right Slot

The purpose the slot values serve is they point back into your inventory to show what item you've selected, and in the case of bottle items, what bottle you have equipped (as they are otherwise identical). So if you have a bottle on C-Right, and it's contents are updated, the code that handles bottle items would update the C-Right item, then look into the relevant slot (which is 3 bytes over), and update the inventory of that slot.

With RBA, when you duplicate a bottle on B there is no equivalent B inventory slot value stored, so it reads the C-Right button item as an offset into your inventory, writing the value of the bottle item into some place in memory after the start of where the inventory is stored. And since there are only 24 inventory slots vs 55 possible C-Right items, RBA can overwrite more than just the memory slots used to hold items.

It then becomes a matter of knowing the internal values used to represent the different items, and knowing what address stores what data, and how.

As for Ganondoor (and really wrong warping in general), you are confused on an important (and quite difficult to explain) aspect of the trick. When you touch the blue warp normally (no tricks) when you are to receive the Kokiri Emerald, the blue warp will store two important values into a temporary spot, which the game will then copy over once the game engine is ready to load a new area. They are the following:

  • The first is what I call a Base Entrance Index. It's a two byte index value used to determine what entrance to place you at next.
  • The second is what I call the Cutscene Entrance Offset. It's a two byte value that does a multitude of things. It modifies where the Base Entrance Index places, you and it causes a specific type of cutscene (one which requires different set of assets) to load and play depending on the cutscene number it represents. Values FFF0 - FFFF? represent cutscenes 0 through 15; 0000 represents no cutscene... usually.

You can't quite understand how these two values work together without understanding how the entrance table works. The entrance table is just a table which stores an area to load, and what position to be placed at. The messy part to this is that for each logical entrance (the entrance to the Deku Tree for example), there are at least four different records into the entrance table, one for every combination of day/night and child/adult. Then, if an area has a certain type of cutscene which requires different assets to be loaded, the first logical entrance will also have one extra entrance for every cutscene it has.

This is where our two values come in. The Base Entrance Index is an index value to the first record in the entrance table for a logical entrance (which is the Child Day record). If the Cutscene Entrance Offset is defined, the game will take the logical entrance, and add 4 + the number of the cutscene the Cutscene Entrance Offset represents. Otherwise it uses time/age to determine the entrance record that is chosen.

Back to our Blue Warp, when you touch it when you are to get the Kokiri Emerald, it sets a Base Entrance Index of 00EE (the first entrance record to the first logical entrance into Kokiri Forest), and a Cutscene Entrance Offset of FFF1 (cutscene 1) into the proper temporary values, causing the entrance record at index 00EE + 4 + 1 = 00F3 to be read, which is still Kokiri Forest. Since the Cutscene Entrance Offset isn't 0000, and the Kokiri Forest properly defines cutscene 1, when Kokiri Forest loads it will play the cutscene.

When you perform a perfect Ganondoor, you overwrite the 00EE set by the blue warp with the Base Entrance Index for the door outside Gohma's Room (0252), but still have a Cutscene Entrance Offset of FFF1. 0252 + 4 + 1 = 257 which ends up being an entrance into the inside of Ganon's Tower Collapse, rather than the Deku Tree.

There is still another element to this though.

Within the main header of a scene file (scene is a common romhacking term for the file which makes up a large area like Kokiri Forest or Link's House), there can exist a command (known as the 0x18 command) which defines a table for alternate versions of a scene. These are often known as alternate scene setups (scene setups for short), or alternate headers.

It works like this... Some areas in the game (like Kakariko Village, Lots of Pots, Kokiri Forest) can change depending on your age, the time of day, a combination of both, or by a game event. Rather than hard coding this into an actor, a different scene setup is used instead.

After the playable scene setups. there may also be setups for cutscenes, setups which the Cutscene Entrance Offset is designed to load. Within the headers for these cutscene setups is yet another command, the 0x17 command, which serves to set the cutscene pointer to point at the proper cutscene.

Because of the 0x18 command, there are three possible scenarios that can occur when wrong warping.

Let's go back to the normal Blue Warp. With 00EE as a base entrance index and FFF1 for a cutscene, the game will find entrance 00F3 for Kokiri Forest. Inside the main header for Kokiri Forest is the 0x18 command that defines the table of alternate scene setups. Cutscene 1 is defined, so the scene setup for Cutscene 1 is loaded and the cutscene plays.

Now a new area, Zora's Fountain. With 010E as a base entrance index and FFF3 for a cutscene, the game will find entrance 0115, which is still Zoras Fountain. However, the alternate scene setups table does not define a setup for cutscene 3 (and actually it will read past the table), so the game will crash.

And back to Ganondoor. With 0252 as a base entrance index, and FFF1 for a cutscene, the game will find entrance 0257 for Inside Ganon's Tower Collapse. However, the 0x18 command is not defined, so the game doesn't attempt to load an alternate scene setup, and doesn't crash because of it. Since the main header is still used, the cutscene pointer isn't updated.

HOWEVER, because the Cutscene Entrance Offset is set, the game still attempts to play a cutscene. Since Ganondoor doesn't update the cutscene pointer, and because the cutscene pointer isn't properly nulled, it ends up attempting to play what's left of the last cutscene.

This is why your last cutscene is so important. If your last cutscene is the Deku Tree Intro, the entire cutscene will be overwritten by the file for Inside Ganon's Tower, causing garbage data to be read, resulting in no cutscene. If your last cutscene is the Title Screen cutscene (which is stored in Hyrule Field), the size of the Hyrule Field file will be so great that the cutscene won't be overwritten by Inside Ganon's Tower Collapse, and you'll end up softlocking because the title screen cutscene will place you well out of bounds.
« Last Edit: July 03, 2013, 02:44:01 AM by mzxrules » Logged

Quote from:  Leigh Rogers
Braid
This is art because the music is classical music, and the graphics are done with a pen. The story is something about a woman. I could not understand much of this to be honest, which makes it even more likely to be an art.
ING-X
Site Editor
Mega Guay

Posts: 613


fuck you and the horse you rode in on

562243965 marikthechao@hotmail.com ingx24
« Reply #2 on: May 25, 2013, 09:26:06 PM »

Wow.
Logged

<complex> byan you're doing that thing again
<complex> the thing where everything you say is fucking retarded


<ethandude> http://en.wikipedia.org/wiki/Homosexual cheak this out luxury it might come in helpful when u wright your resime
nathanisbored
Site Editor
Special Guay

Posts: 276


Email
« Reply #3 on: May 25, 2013, 09:50:15 PM »

Well it's been answered, but I'll try to answer the RBA question in my own words:

There are 4 bottle slots in the inventory normally. Because of this, the game needs a way to distinguish them when you have one on C. It does that by using offset values. However, you are not normally able to get a bottle on B, so there is no offset value for B. The values are listed as below:

[B button contents] [C left contents] [C down contents] [C right contents] [C left offset (slot number)] [C down offset] [C right offset]

So, as you can see, when you update a bottle on a C button, it will go 3 down the list and land on its corresponding offset. This way it updates both the C button bottle and the bottle in the inventory together.

The B button bottle also counts 3 down the list when you update it, but it lands on C right's contents instead. Because of this, it uses the value of the item on C right as an offset to find the correct inventory slot. If the item on C right is a Blue Potion (item value 23) for example, when you update the bottle on B, it will try to update the inventory accordingly. So it goes to slot 23 in the inventory (bottom right corner) and updates that slot with the new bottle item.

But what if the item on C right is higher than 23? If you have a Bottled Fish (item value 25) on C right for example, it will try to find slot 25, but there are only 24 normal inventory slots! So it starts checking item ammo instead. Slot 25 is your deku nut amount, so it will change how many deku nuts you have. If you catch bugs in your B bottle with a Bottled Fish on C right for example, it will give you 29 nuts, since bugs are item value 29.

If you start using really high values for the item on C right, like some adult trade items for example, you can update beyond the ammo slots and go all the way to different parts of your inventory, like equipment, quest items, and even dungeon items.

For example, if you have Broken Goron's Sword (item value 51) on C right, and you catch bugs on B, it will try to update slot 51 (medallions+songs slot). This slot is laid out like this:

[Bolero of Fire] [Minuet of Forest] [Light Medallion] [Shadow Medallion] [Spirit Med] [Water Med] [Fire Med] [Forest Med]

Bugs = 29 = 0001 1101

So...

   0             0               0               1                 1                 1              0                1
[BoF] [Min of For] [Light Med] [Shad Med] [Spirit Med] [Water Med] [Fire Med] [Forest Med]

You will have the Shadow, Spirit, Water, and Forest Medallions, but you will not have the Bolero of Fire, Minuet of Forest, Light Medallion or Fire Medallion.

This will completely overwrite what you had before. So if you had the Minuet of Forest before, it will be deleted.




As you can see, all this is caused by having a bottle on your B button. In order to get a bottle on your B button, you must get another item on B that you can bottle dupe over. If you steal the fishing rod from the fishing pond, you can duplicate a bottle over it using the shieldswipe technique. Alternatively, you can get a deku stick on B by skipping the Kokiri Sword, and then doing a series of things involving Ingo's horse riding game. Once you have a deku stick on B, you can then duplicate a bottle over it.
« Last Edit: May 25, 2013, 10:12:14 PM by nathanisbored » Logged
mzxrules
Admin
Ultimate Mega Guay

Posts: 901


Wrong warp expert


« Reply #4 on: May 25, 2013, 11:44:47 PM »

Wow.

And that's without mentioning the space time continuum.
Logged

Quote from:  Leigh Rogers
Braid
This is art because the music is classical music, and the graphics are done with a pen. The story is something about a woman. I could not understand much of this to be honest, which makes it even more likely to be an art.
CFerens
Deku Scrub

Posts: 10


Email
« Reply #5 on: May 25, 2013, 11:49:00 PM »

The B button bottle also counts 3 down the list when you update it, but it lands on C right's contents instead. Because of this, it uses the value of the item on C right as an offset to find the correct inventory slot. If the item on C right is a Blue Potion (item value 23) for example, when you update the bottle on B, it will try to update the inventory accordingly. So it goes to slot 23 in the inventory (bottom right corner) and updates that slot with the new bottle item.

Hi! Thanks both for the RBA explanation, I just had a question involving this part of the post. I now understand that the Bottle on B will move three bytes over, and will land on C right. So now it uses C right's item value (ex. blue potion - item value 23 so it will try to update slot 23). But my question is, what does it try to update it to? What item is going to occupy slot 23 (I hope that's right)? I feel as if I have a better understanding except for that one point.

I think what will really help me is if you explain to me what's happening in this video from 25:34-25:52: http://www.youtube.com/watch?v=o0LqjrkpZ1A. It's one of Cosmo's speedruns, and Cosmo is always great at explaining things, but I'm just confused at what happens here. So the value on bottle B is being changed, so it counts 3 down the list and lands on C right. Now I'm lost, and I need an explanation. Thanks in advance!


As for the Ganondoor explanation, I'm happy you went into such detail! That's exactly what I'm looking for, I'm just a little bit confused though on this part:

You can't quite understand how these two values work together without understanding how the entrance table works. The entrance table is just a table which stores an area to load, and what position to be placed at. The messy part to this is that for each logical entrance (the entrance to the Deku Tree for example), there are at least four different records into the entrance table, one for every combination of day/night and child/adult. Then, if an area has a certain type of cutscene which requires different assets to be loaded, the first logical entrance will also have one extra entrance for every cutscene it has.

This is where are two values come in. The Base Entrance Index is an index value to the first record in the entrance table for a logical entrance (which is the Child Day record). If the Cutscene Entrance Offset is defined, the game will take the logical entrance, and add 4 + the number of the cutscene the Cutscene Entrance Offset represents. Otherwise it uses time/age to determine the entrance record that is chosen.

Back to our Blue Warp, when you touch it when you are to get the Kokiri Emerald, it sets a Base Entrance Index of 00EE (the first entrance record to the first logical entrance into Kokiri Forest), and a Cutscene Entrance Offset of FFF1 (cutscene 1) into the proper temporary values, causing the entrance record at index 00EE + 4 + 1 = 00F3 to be read, which is still Kokiri Forest. Since the Cutscene Entrance Offset isn't 0000, and the Kokiri Forest properly defines cutscene 1, when Kokiri Forest loads it will play the cutscene.

When you perform a perfect Ganondoor, you overwrite the 00EE set by the blue warp with the Base Entrance Index for the door outside Gohma's Room (0252), but still have a Cutscene Entrance Offset of FFF1. 0252 + 4 + 1 = 257 which ends up being an entrance into the inside of Ganon's Tower Collapse, rather than the Deku Tree.

So, this could be wrong, but to what I now understand, the Base Entrance Index will be the first record of the entrance table, and will input Child/Day, as that is what it's supposed to be at that instance of the game. Now what does it mean when a cutscene entrance offset is defined? I don't quite understand what you mean by defined. If you could explain what you mean by defined, I think I will understand this more clearly!

Anyways, thanks both for the excellent responses!

Thanks,

Chris
Logged
mzxrules
Admin
Ultimate Mega Guay

Posts: 901


Wrong warp expert


« Reply #6 on: May 26, 2013, 02:54:54 AM »

Hi! Thanks both for the RBA explanation, I just had a question involving this part of the post. I now understand that the Bottle on B will move three bytes over, and will land on C right. So now it uses C right's item value (ex. blue potion - item value 23 so it will try to update slot 23). But my question is, what does it try to update it to? What item is going to occupy slot 23 (I hope that's right)? I feel as if I have a better understanding except for that one point.

You overwrite it with the bottle. That is, the internal representation of a particular bottle item. This is why it's useless to rba over an item slot; all you can ever write are bottle items.

Now, there are only 6 different bottle items can be written with RBA:
  • Empty Bottle (20)
  • Fairy (24)
  • Fish (25)
  • Blue Fire (28)
  • Bug (29)
  • Half Milk (31)

Potions, Full Milk, Poes are put directly into your inventory via interacting with an actor, so the B button will not update.

I also forgot to mention a special case which will result in Half Milk RBAs. If you are updating the contents of a bottle, and the memory address you're trying to overwrite with RBA contains a value of 26 (the item value for a full bottle of Milk), the game will think you are drinking Milk, and both your B button and the memory address will become the value for Half Milk.

Quote
So, this could be wrong, but to what I now understand, the Base Entrance Index will be the first record of the entrance table, and will input Child/Day, as that is what it's supposed to be at that instance of the game. Now what does it mean when a cutscene entrance offset is defined? I don't quite understand what you mean by defined. If you could explain what you mean by defined, I think I will understand this more clearly!

The Base Entrance Index references the first record to a logical entrance, which when the game doesn't provide the cutscene entrance offset will be the entrance record chosen if you are a child and it's day time.

By "If the Cutscene Entrance Offset is defined" what I really mean is if a Cutscene Entrance Offset is passed into a certain memory address (11B9E2 in V1.0) before the game loads a new scene. 11B9E2 typically stores a value of FFEF for no cutscene, and when you touch the blue warp in Gohma's room when you don't have the Kokiri Emerald, this value is updated to FFF1. Then, when the game no longer has Gohma's Room loaded, it passes the FFF1 elsewhere and resets the value to FFEF.
Logged

Quote from:  Leigh Rogers
Braid
This is art because the music is classical music, and the graphics are done with a pen. The story is something about a woman. I could not understand much of this to be honest, which makes it even more likely to be an art.
nathanisbored
Site Editor
Special Guay

Posts: 276


Email
« Reply #7 on: May 26, 2013, 04:14:30 AM »

But my question is, what does it try to update it to? What item is going to occupy slot 23 (I hope that's right)?

It will update based on whatever is on B. If you caught bugs in your B bottle, it will put bugs in that slot. Or if you dropped bugs from your bottle, it will put an empty bottle. If there is already something in that slot, it will simply overwrite it.

Interestingly, if there is a full bottle of milk in that slot already, and your drop bugs from your B bottle, it will put half-milk in that slot, and half-milk on B. You can actually use this to your advantage in the context of ammo. If you have a bottled fish on C right, and you have exactly 26 deku nuts, then when you dump your B bottle to empty, it will interpret the 26 as though it were full milk, and give you 31 deku nuts instead of the 20 you should have gotten from the empty bottle. 31 is the highest value you can write with RBA, the next highest being bugs.

99% of the time, the halk milk method of RBA is useless however, but it is used in the "37 Water Temple keys" puzzle goal run:
https://www.youtube.com/watch?v=OQoqXEk7Sss

I think what will really help me is if you explain to me what's happening in this video from 25:34-25:52: http://www.youtube.com/watch?v=o0LqjrkpZ1A. It's one of Cosmo's speedruns, and Cosmo is always great at explaining things, but I'm just confused at what happens here. So the value on bottle B is being changed, so it counts 3 down the list and lands on C right. Now I'm lost, and I need an explanation. Thanks in advance!

This is a little more confusing. It checks C right, and it sees Pocket Cucco (value 46), so it goes to "slot" 46. In this case, there are actually 4 things being updated, since pocket cucco points to 4 different things. It will update your bullet bag slot, your wallet status, your dive meter slot, and your strength upgrade slot. However, your bullet bag slot is ALSO determined by pocket egg RBA. Since Cosmo didn't do pocket egg RBA, we don't have to worry about that.

Since he dumps out the bugs, it is writing the value of an empty bottle. The byte is laid out like this:

   First 2 bits         Next 2 bits         Next 3 bits                Last bit
[Bullet Bag slot]  [Wallet status]  [Dive Meter slot]  [Strength upgrade slot]

Empty Bottle = 20 = 0001 0100

So...

            (0)00                           01                           010                                       0(00)
[Nothing in Bullet Bag slot]  [Adult's Wallet]  [Gold Scale in Dive Meter slot]  [Nothing in Strength upgrade slot]


The bit in the far left in parentheses is determined by pocket egg RBA. Cosmo didn't do pocket egg RBA or get any bullet bags, so it is 0 by default. The 2 bits on the far right in parentheses are determined by Cojiro RBA or what strength upgrade you already had. Cosmo does Cojiro RBA later, but these bits end up being 00 anyway.


After doing Pocket Cucco RBA, Cosmo switches C right to an empty bottle. Since empty bottle is value 20, it is updating slot 20. Since he catches bugs on B, it puts bugs in slot 20 in his inventory (slot 20 is the 3rd bottle slot). He does this so he can have an extra bottle.


If you watch Cosmo's inventory carefully as this is happening, you can notice some of the effects. Watch his rupee counter when he dumps out the bottle for example, and check his left side equipment when he switches to the equipment screen.
« Last Edit: May 28, 2013, 07:18:39 AM by nathanisbored » Logged
CFerens
Deku Scrub

Posts: 10


Email
« Reply #8 on: May 26, 2013, 07:05:10 PM »

Thanks to both of you again for your responses, I feel as if I understand much more on both subjects. One final thing to ask: how and why do some items (such as the pocket cucoo) point to numerous things? You said that the cucoo updates 4 things, but why? And is that the only item that it's possible with?

Thanks,

Chris
Logged
mzxrules
Admin
Ultimate Mega Guay

Posts: 901


Wrong warp expert


« Reply #9 on: May 26, 2013, 08:10:42 PM »

Because of something called bit packing. It's a way of storing data that represents different things very tightly together.

In programming, you typically want to try to store data in such a way that it can be processed quickly, but at the same time avoid consuming unnecessary amounts of memory. So typically, the smallest data container will be a single byte, as any smaller will increase the number of instructions needed to fetch the data.

However, if you don't have a whole lot of memory to work with (which is the case for the inventory data since it is saved up to 6 times (3 game slots with 2 copies per slot)), bit packing is a good solution. This technique is how the equipment screen/quest items are stored.

So for example, the address updated by the Pocket Cucco on C-Right completely contains 2 bit packed values: Your Wallet and what Diving Scale you own. Since there are three different wallets that you can own, what wallet you own can be represented with as little as 2 bits. Similarly, since there are two different Diving Scales, plus a third condition where you have no scale, the Diving Scale slot can be represented with as little as 2 bits as well (but it's actually represented with 3 bits because Nintend'oh).

With bit packing, these two distinctly different values can be represented with just one byte rather than two. But that's not all. Bit packing also allows for partial portions of a value to be packed within the same byte. For example, three bits are used to represent the gauntlet slot / what gauntlets you have equipped, allowing for 6 different gauntlets + no gauntlets. However, the value for gauntlets is split between two bytes, where one bit is stored in the address represented by Pocket Cucco, while the other two are in the address represented by Cojiro.

So that's why one RBA can affect 4 different items; they are being fully/partially stored within a single byte
Logged

Quote from:  Leigh Rogers
Braid
This is art because the music is classical music, and the graphics are done with a pen. The story is something about a woman. I could not understand much of this to be honest, which makes it even more likely to be an art.
The Tjalian
Deku Scrub

Posts: 3


Email
« Reply #10 on: January 20, 2014, 03:19:57 AM »

<mega cut>

You sir are a very, very legendary person.

A few questions though (and I apologise is this is a little out of the scope of speedrunning!): It sounds like the base entrance index and cutscene entrance offset are used for all loading zones, not just warp points. For example, a door or the entrance to the Lost Woods, would also use the BEI/CEO. Would you say this is true? If so, I guess it's also (sadly) true they also drop their values once the next area is loaded?

Next, I don't suppose you have the in-game memory addresses for the BEI and Entrance Table do you?

Lastly, did you/do you hack the game too, by any chance? Your technical knowledge is... rather comprehensive Tongue
Logged
Jbop
Moderator
Twenty-three is number one! Do you think I'm a traitor?

Posts: 231



« Reply #11 on: January 20, 2014, 08:00:00 PM »

It sounds like the base entrance index and cutscene entrance offset are used for all loading zones, not just warp points. For example, a door or the entrance to the Lost Woods, would also use the BEI/CEO. Would you say this is true? If so, I guess it's also (sadly) true they also drop their values once the next area is loaded?

Well any entrance into a new scene uses an entrance value (surprise, surprise), but no, the cutscene entrance offset is not always set. It's only used when playing certain cutscenes.
Logged

Quote from:  ZFG on March 24, 2008, 8:27:24 AM
Quote from:  Prognosis_4 on March 24, 2008, 8:25:50 AM
Why are you guys so certain it's possible?
Because its OoT.
mzxrules
Admin
Ultimate Mega Guay

Posts: 901


Wrong warp expert


« Reply #12 on: January 20, 2014, 08:30:09 PM »

It sounds like the base entrance index and cutscene entrance offset are used for all loading zones, not just warp points. For example, a door or the entrance to the Lost Woods, would also use the BEI/CEO. Would you say this is true? If so, I guess it's also (sadly) true they also drop their values once the next area is loaded?

Several months after I wrote the post on this thread, I discovered a program that can log the debug messages that are output by the Debug Rom, ones that would appear in a dev console window rather than the normal game window. One of the things that you can see from the output log is step by step how the game loads an area. You can find a link to one such output below.

http://pastebin.com/fbDQhtTT

Now, the variable I call the cutscene entrance offset (and appears as sceneset time variable in the logs) isn't used everywhere. It's only used for setting up cutscenes that require their own set of actors/scene level variables. Under normal circumstances, it has a value between FFF0-FFFF or 0 for cutscenes 0-F, or no cutscene.

Rather, there is another variable called the sceneset counter, or simply COUNTER in the logs which seems to determine what entrance you spawn at with a given base entrance index, and and scene setup loaded.

Sceneset counter values 0-3 are reserved for normal gameplay, usually (not always) 0 = Child Day, 1 = Child Night, 2 = Adult Day, 3 = Adult Night. Then when the cutscene entrance offset is set, the sceneset counter is set to 4 + the cutscene number in order to use cutscene entrances and cutscene scene setups.

In other words, the cutscene entrance offset is more of a "play cutscene #" variable. It's value still affects what entrance you spawn in though because it's value is used as a factor when computing the sceneset counter.

Quote
Next, I don't suppose you have the in-game memory addresses for the BEI and Entrance Table do you?

I do. All the following values are for v1.0

B6FBF0 is the start of the entrance table in a decompressed ROM (not a ram address). It's located in the "code" file.
0F9C90 is the start of the entrance table in ram.
11A5D2 is the Base Entrance Index (also the first value stored in the save).
11A5D8 is the Play Cutscene Number.
11B9E2 is the Play Next Cutscene Number. It's default value is FFEF.
1DA2BA is the Next Base Entrance Index (set when touching a loading zone).

Quote
Lastly, did you/do you hack the game too, by any chance? Your technical knowledge is... rather comprehensive Tongue

I've worked on my own hack. I don't know mips asm so my knowledge is handicapped somewhat, but you can still learn a lot without knowing asm.
Logged

Quote from:  Leigh Rogers
Braid
This is art because the music is classical music, and the graphics are done with a pen. The story is something about a woman. I could not understand much of this to be honest, which makes it even more likely to be an art.
The Tjalian
Deku Scrub

Posts: 3


Email
« Reply #13 on: January 22, 2014, 08:46:15 PM »

Several months after I wrote the post on this thread, I discovered a program that can log the debug messages that are output by the Debug Rom, ones that would appear in a dev console window rather than the normal game window. One of the things that you can see from the output log is step by step how the game loads an area. You can find a link to one such output below.

http://pastebin.com/fbDQhtTT

Now, the variable I call the cutscene entrance offset (and appears as sceneset time variable in the logs) isn't used everywhere. It's only used for setting up cutscenes that require their own set of actors/scene level variables. Under normal circumstances, it has a value between FFF0-FFFF or 0 for cutscenes 0-F, or no cutscene.

Rather, there is another variable called the sceneset counter, or simply COUNTER in the logs which seems to determine what entrance you spawn at with a given base entrance index, and and scene setup loaded.

Sceneset counter values 0-3 are reserved for normal gameplay, usually (not always) 0 = Child Day, 1 = Child Night, 2 = Adult Day, 3 = Adult Night. Then when the cutscene entrance offset is set, the sceneset counter is set to 4 + the cutscene number in order to use cutscene entrances and cutscene scene setups.

In other words, the cutscene entrance offset is more of a "play cutscene #" variable. It's value still affects what entrance you spawn in though because it's value is used as a factor when computing the sceneset counter.

I do. All the following values are for v1.0

B6FBF0 is the start of the entrance table in a decompressed ROM (not a ram address). It's located in the "code" file.
0F9C90 is the start of the entrance table in ram.
11A5D2 is the Base Entrance Index (also the first value stored in the save).
11A5D8 is the Play Cutscene Number.
11B9E2 is the Play Next Cutscene Number. It's default value is FFEF.
1DA2BA is the Next Base Entrance Index (set when touching a loading zone).

I've worked on my own hack. I don't know mips asm so my knowledge is handicapped somewhat, but you can still learn a lot without knowing asm.
That's pretty interesting there's a program that can interact with the Debug ROM directly! I had no idea that existed. I always wondered how the cutscenes worked in detail on a technical level (I always had some semblance of what happened, but never really took the time to look further into it), so thanks!

Many thanks for the addresses, I might have a play around with these soon just for a bit of fun.

Lastly, link to your hack please? I am now curious lol Tongue
Logged
mzxrules
Admin
Ultimate Mega Guay

Posts: 901


Wrong warp expert


« Reply #14 on: January 22, 2014, 09:31:02 PM »

http://forums.zeldaspeedruns.com/index.php?topic=1292.0

The third thing listed on this board.
Logged

Quote from:  Leigh Rogers
Braid
This is art because the music is classical music, and the graphics are done with a pen. The story is something about a woman. I could not understand much of this to be honest, which makes it even more likely to be an art.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!