### Author Topic: (FF7 PSX) Impossible to win all item drops from multiple enemies?  (Read 13318 times)

#### antd

• Fast newbie
• Posts: 49
• Karma: 2
##### (FF7 PSX) Impossible to win all item drops from multiple enemies?
« on: 2011-07-26 09:17:50 »
It seems it is impossible to win all item drops from multiple enemies.

Example:
Fighting two soldiers (shinra HQ) will not allow you to win 2x grenade (1 is max)
Fighting three soldiers will not allow you to win 3x grenade (2 is max)
Fighting three sneaky steps will not allow you to win 3x m-tentacles (2 is max)

I've never seen 100% item drops from multiple enemies. Although it could be that the full drop is quite rare...

#### NxK

• Crazy poster
• Posts: 128
• Karma: 7
• In AI I Trust
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #1 on: 2011-07-26 09:49:49 »
It seems it is impossible to win all item drops from multiple enemies.

Example:
Fighting two soldiers (shinra HQ) will not allow you to win 2x grenade (1 is max)
Fighting three soldiers will not allow you to win 3x grenade (2 is max)
Fighting three sneaky steps will not allow you to win 3x m-tentacles (2 is max)

I've never seen 100% item drops from multiple enemies. Although it could be that the full drop is quite rare...

What is known about the mechanics is that an enemy will never yield more than 1 item. This means that if one were to steal an item from an enemy, that enemy could not drop another item at the same time. So, did you actually steal while doing these drop rate tests?
Apart from that, I would suggest that you calculate the expected probability of all enemies dropping an item. As it probably will not be so low in the cases you are mentioning, you could easily do enough test runs to come across statistically significant deviations from your calculations in case it were in fact impossible for all enemies to drop an item.
What I also find remarkable is that you are referring exclusively to instances of multiple enemies of only one type. Perhaps the peculiarity concerning the drop rate you seem to be experiencing only applies to these cases as well.

#### NFITC1

• No life
• Posts: 2932
• Karma: 73
• I just don't know what went wrong.
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #2 on: 2011-07-26 15:19:09 »
The RNG table in the KERNEL.BIN comes into full force in this one. Those values determine what is capable of dropping. There are slots in RAM for a max of at least four items (might be more) being dropped at the end of a battle, but the RNG values usually don't allow that. The (pseudo)code to determine if an item drops or not is as follows:

Code: [Select]
`ItemDrop ( EnemyData, isDrop, AllowRandom, ChanceMultiplier){   WORD dropped_item = -1; //no item   for ( int i = 0; i < 4; i++ ) //loop through the enemies' held item data   {      if ( ( EnemyData(136 + i) ) AND C0h ) == isDrop )  //if isDrop is a 0 then we're looking for drop items instead of steal items      {         DropChance = AllowRandom ? 256 : ChanceMultiplier * ( ( EnemyData(136 + i) ) AND 3Fh ) / 256; //special battles (like bosses or WEAPONS) have guaranteed drop rates, otherwise we'll use chance)/* *  The multiplier is usually worked like this: * *  ( ( Thiefs_Level + 40 - Targets_Level ) << 9 ) / 100 * * If Targets_Level = Thiefs_Level it turns out to be 204, but the multiplier won't go higher than 200% */         if ( ( RandomRNGByte AND 63h ) <= DropChance )         {            dropped_item = EnemyData(140 + i * 2);         }      }   }   return dropped_item;}`
Basically, in a normal battle, if the random byte AND 63h is less or equal to the item's drop chance * multiplier (which is signed, so you need to be at no fewer than 39 levels below your target enemy to even have a chance) then the item drops. An Eagle Gun (lvl 46) will never drop an X-Potion (rate of 63) if killed by a character at level 7 or below, but a Master Tonberry (Lvl 77) will have a 1:6.452 chance of dropping a Megalixer (rate of for a level 99 character. A few conditions to this:

The first item an enemy holds that drops, drops.
ex.
The Special Combatant enemy from Reactor 5 has two items to drop. He can drop an Antidote at a rate of 8 and a Grenade at a rate of 2. If the Antidote doesn't drop, the game goes for the Grenade. So there's a 0.8:8, or 1:10, chance that an Antidote will drop. If it doesn't, there is another .8:32, or 1:40, chance that the Grenade will drop. There doesn't seem to be anything else that influences drop rates. I don't see where the game doesn't allow all enemies to drop things.

Like NxK said, the enemy won't drop anything if it has been stolen from.

Back to the issue, this is handled as the enemy dies. So if they don't all die at once the RNG is going to keep moving around. Getting it to cooperate, let alone knowing where the pointer is, is nigh impossible in most cases, but this is relatively easy. Since it just requests a byte the Random Number Set isn't incremented. So you're looking for a certain pattern in the RNGLUT. You need to find a chain of them that all meet that criteria. I'm not certain there are any that do. The RNGLUT may have been constructed in such a way that situations like that are difficult.

Moral is: it CAN produce drops from all enemies (or you wouldn't get drops from single enemy battles like Adamantaimai), but you haven't hit the right string of numbers yet. It would take at least 256 attempts to try all the patterns in the RNGLUT.

#### antd

• Fast newbie
• Posts: 49
• Karma: 2
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #3 on: 2011-12-28 17:16:10 »
Back to the issue, this is handled as the enemy dies. So if they don't all die at once the RNG is going to keep moving around. Getting it to cooperate, let alone knowing where the pointer is, is nigh impossible in most cases, but this is relatively easy. Since it just requests a byte the Random Number Set isn't incremented. So you're looking for a certain pattern in the RNGLUT. You need to find a chain of them that all meet that criteria. I'm not certain there are any that do. The RNGLUT may have been constructed in such a way that situations like that are difficult.

Moral is: it CAN produce drops from all enemies (or you wouldn't get drops from single enemy battles like Adamantaimai), but you haven't hit the right string of numbers yet. It would take at least 256 attempts to try all the patterns in the RNGLUT.
I think this is the point I was missing! I thought ending the battle by a different frame would yield the full range of results. But this is wrong; it is when individual enemies die.

In this case, I will throw a right arm at 3 enemies of the same type. This will ensure all enemies die at the same time, right?

I've set up my script to kill all enemies delaying +1 frame each time, so it should hit each all possible RNG values.

It's tried 1000 attempts already and it has never hit 3 * T/S bomb drops from 3 * Flapbeats.
The most it has dropped is 2 * T/S bomb.

If this runs for over 65536 attempts, will this show that getting all item drops from multiple of the same enemy is impossible?
« Last Edit: 2011-12-28 17:25:12 by antd »

#### NFITC1

• No life
• Posts: 2932
• Karma: 73
• I just don't know what went wrong.
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #4 on: 2011-12-28 20:12:30 »

If this runs for over 65536 attempts, will this show that getting all item drops from multiple of the same enemy is impossible?

Statistically I'd say yes. 256 attempts would be enough given there are only 256 values in the RNGLUT. However, there are eight pointers to it at any given time and I don't know for certain what each of them are for and when the game cycles though them nor at what rate. So 2048 (256 * 8 ) would be enough if you knew where the pointer started and what value was next in the RNGLUT. I'm not convinced that the RNG is shuffled every frame like other RPG games do.
That would only work for consecutive values, however. If you knew what value made an item drop and got the RNGLUT pointer back to that value for every enemy then you could likely get all the items from enemy drops. There is room in the data for four unique items although the quantity is variable. This point is moot because an enemy will only drop one item (if any) and there can only be three enemy types in a battle.

#### Vgr

• Global moderator
• Posts: 2211
• Karma: 35
• If it quacks like a duck, it must be a duck
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #5 on: 2011-12-28 22:43:46 »
A neat way to find out would be to find out which offsets points to the Random Number Generator Look-Up Table then try each value.

#### antd

• Fast newbie
• Posts: 49
• Karma: 2
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #6 on: 2011-12-29 13:26:58 »
Quote
A neat way to find out would be to find out which offsets points to the Random Number Generator Look-Up Table then try each value.
Yep, a good idea. But beyond my skills at the moment. I may try this when I have enough spare time to find the relevant memory addresses!

Statistically I'd say yes. 256 attempts would be enough given there are only 256 values in the RNGLUT. However, there are eight pointers to it at any given time and I don't know for certain what each of them are for and when the game cycles though them nor at what rate. So 2048 (256 * 8 ) would be enough if you knew where the pointer started and what value was next in the RNGLUT. I'm not convinced that the RNG is shuffled every frame like other RPG games do.
That would only work for consecutive values, however. If you knew what value made an item drop and got the RNGLUT pointer back to that value for every enemy then you could likely get all the items from enemy drops. There is room in the data for four unique items although the quantity is variable. This point is moot because an enemy will only drop one item (if any) and there can only be three enemy types in a battle.
Interesting info!

Currently at 44,000 attempts and no maximum item drops. Only, 0, 1, and 2 drops. Not 3.
I'll let this script run until it crashes or until it reaches 1 million attempts. On average, it is currently testing 140,000 attempts per day. So should hit 1 million in just over 1 week.

Surely if it reaches 1 million consecutive attempts it would have tried pretty much all variations of RNG position?
« Last Edit: 2011-12-29 15:42:26 by antd »

#### Vgr

• Global moderator
• Posts: 2211
• Karma: 35
• If it quacks like a duck, it must be a duck
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #7 on: 2011-12-29 17:02:00 »
I can do it for you if you want, given you already do a lot of work to do. I'll do it through Cheat Engine and pSX, but I think you'd probably prefer through psxjin given that's what you use for your TAS. Shouldn't be too hard. I don't know how to manipulate it *in* the game though.

#### antd

• Fast newbie
• Posts: 49
• Karma: 2
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #8 on: 2011-12-29 22:44:19 »
I can do it for you if you want, given you already do a lot of work to do. I'll do it through Cheat Engine and pSX, but I think you'd probably prefer through psxjin given that's what you use for your TAS. Shouldn't be too hard. I don't know how to manipulate it *in* the game though.
oh nice! you can get the relevant memory addresses?
i can write a lua script (psxjin) that automatically changes the values in game and reports the item drop

also: 58,000 consecutive attempts so far and no 3*T/S bomb drop from 3*Flapbeats!

#### Vgr

• Global moderator
• Posts: 2211
• Karma: 35
• If it quacks like a duck, it must be a duck
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #9 on: 2011-12-30 01:34:08 »
Wait, to automatically change might work, but will it work if someone uses the file to replicate the run? Because AFAIK if you want to post it on TASvideos you need replayability (I had read their rules...) so unless the lua script gets along with the emulator movie file, I think there has to be some way around.

#### Livesey

• Crazy poster
• Posts: 148
• Karma: 0
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #10 on: 2011-12-30 16:36:57 »
Please correct me if I'm being dumb but could you not change the drop values of a certain enemy to 255% in ProudClod and then test an enemy formation to see if the can get a 3x grenade drop?

#### antd

• Fast newbie
• Posts: 49
• Karma: 2
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #11 on: 2011-12-31 15:18:04 »
Wait, to automatically change might work, but will it work if someone uses the file to replicate the run? Because AFAIK if you want to post it on TASvideos you need replayability (I had read their rules...) so unless the lua script gets along with the emulator movie file, I think there has to be some way around.
Well I'm just doing this for my own knowledge. This part of the run will not be submitted to TASvideos.
It's purely to find out if maximum item drops are possible on enemies of the same type.

So, I just need to know which memory addresses are related to item drops.

Btw, 100,000 attempts and no 3*T/S bomb drop + the emulator crashed

#### Erzfreund

• Fast newbie
• Posts: 26
• Karma: 1
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #12 on: 2012-01-01 16:30:37 »
I can guarantee that it is possible to get all items as long as there are multiple win slots. For example Garuda at Dao Chao (Far right hand is the best spot for that).
I’ve also won three Eye Drops from six Battery Caps.

Quote
[…]but a Master Tonberry (Lvl 77) will have a 1:6.452 chance of dropping a Megalixer (rate of 8) for a level 99 character[…]

Hard to believe. Megalixer drops are quite common.

#### antd

• Fast newbie
• Posts: 49
• Karma: 2
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #13 on: 2012-01-01 16:55:14 »

I’ve also won three Eye Drops from six Battery Caps.
That's not actually what I'm suggesting. In your example, you will not win an item from all enemies.
I've only seen evidence of winning all items from a single enemy.
I'm suggesting that you cannot win 3 eye drops from 3 battery caps. That's unless 1 battery cap can drop more than 1 eye drop.

Quote
as long as there are multiple win slots
When does this change? Will there be 3 win slots when facing 3 enemies of the same type?

Anyone that can provide a screenshot or video of winning all items from all enemies of the same kind? I don't think it can be done without cheat codes.

#### Erzfreund

• Fast newbie
• Posts: 26
• Karma: 1
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #14 on: 2012-01-01 18:57:13 »
Ah, no I meant, that it could be possible, that the maximum drop for items is two, which is not the case. I believe, that you are right about the general impossibility of winning all items.

Garuda:
(Full List) Win: [ 8] Ice Crystal, [ 8] Bolt Plume, [ 8] Light Curtain,

http://youtu.be/heWRsQG8Vv8

#### NFITC1

• No life
• Posts: 2932
• Karma: 73
• I just don't know what went wrong.
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #15 on: 2012-01-02 13:51:54 »
Please correct me if I'm being dumb but could you not change the drop values of a certain enemy to 255% in ProudClod and then test an enemy formation to see if the can get a 3x grenade drop?

This should be done before any more in-game testing as a proof of concept at least. If it's impossible then this would show it (although it would need to be set to 63 as 255 is a guaranteed stealable).

#### Vgr

• Global moderator
• Posts: 2211
• Karma: 35
• If it quacks like a duck, it must be a duck
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #16 on: 2012-01-02 14:01:25 »
Heck, why did nobody thought of that before? I feel so dumb now

#### NxK

• Crazy poster
• Posts: 128
• Karma: 7
• In AI I Trust
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #17 on: 2012-01-02 23:32:23 »
I have tried out the 3 Sneaky Steps battle and easily won 3 M-Tentacles after having adjusted the drop rate to 63.

#### Erzfreund

• Fast newbie
• Posts: 26
• Karma: 1
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #18 on: 2012-01-03 11:43:39 »
Ah, that's nice, but not really surprising (regarding the Turk battle at Gongaga).

What happens if the drop rate is set to 62? Especially when fighting Battery Caps. I think five of six Eye Drops is the best one can get.

#### NxK

• Crazy poster
• Posts: 128
• Karma: 7
• In AI I Trust
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #19 on: 2012-01-03 16:34:49 »
Even at a drop rate of 62, I got 6 Eye Drops in the 6 Battery Caps battle on my first attempt.

#### NFITC1

• No life
• Posts: 2932
• Karma: 73
• I just don't know what went wrong.
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #20 on: 2012-01-03 18:10:02 »
Try getting three different items from a battle with three types of enemies. I think that's possible too.
...(regarding the Turk battle at Gongaga)...

I think bosses have some kind of 'always drop item' flag to ensure drop. I think even a rate of 63 is less than 100% or can somehow be prevented by certain attacks like Remove of whatever.

#### Livesey

• Crazy poster
• Posts: 148
• Karma: 0
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #21 on: 2012-01-03 18:10:33 »
Isn't 62 over 100%?

#### NxK

• Crazy poster
• Posts: 128
• Karma: 7
• In AI I Trust
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #22 on: 2012-01-03 19:29:08 »
Isn't 62 over 100%?

According to TFergusson the probability is (Chance + 1)/64, which means that 63 would be equivalent to 100% and 62 would definitely be less than 100%.

#### Livesey

• Crazy poster
• Posts: 148
• Karma: 0
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #23 on: 2012-01-03 19:52:33 »
Ahh, alright I must have been getting confused with the 255 thing.

#### Bosola

• Fire hazard!
• No life
• Posts: 1770
• Karma: 15
##### Re: (FF7 PSX) Impossible to win all item drops from multiple enemies?
« Reply #24 on: 2012-01-04 11:16:35 »
The scope of the variable is 6 bits rather than a whole byte. I don't know what those other two bits signify - maybe they're flags for 'always drop' and 'null'?