Jump to content
  • Sign Up

Is loot generated before the chest is or when the chest is clicked?


When is loot generated?  

52 members have voted

  1. 1. When is loot generated?

    • Loot is generated and put in the chest then
      4
    • Loot is generated the moment a chest is looted
      48


Recommended Posts

13 minutes ago, roederich.2716 said:

What you guys think about loot generation?

Is it generated and put in the chest then waiting to be picked up or is loot generated the moment a chest is opened?

People open some loot on mid-level characters specifically to get mid-tier loot. Since you can get a loot container on a level 80 and open it on a lower level character to influence the contents, we know the loot is generated on opening.

Edited by Gibson.4036
  • Like 13
  • Thanks 3
  • Confused 2
  • Sad 1
Link to comment
Share on other sites

For any game loot data will be generated when it is needed unless it must pre-generate for specific mechanics. The reason is performance. If you pre-generate you will end up wasting a lot of resources executing unnecessary code.

Since most games uses a pseudo-random number generator instead of a truly random number generator it also allows for "why not both?"

  • Like 5
Link to comment
Share on other sites

I think it must be when the chest is opened. It's well known that if multiple players open a chest at the same time they won't all get the same thing, which means the game is working out the loot seperately for each person. Doing that in advance would be needlessly complicated - the game would have to know when a chest spawns how much players are going to open it before it despawns again.

It might be possible for things like boss chests which spawn after the fight and can only be opened by players who participated. But it wouldn't work for things like jumping puzzle chests which are always there, or the Silverwastes chests which can be opened by anyone who comes along after they've been dug up. There's no way to know in advance how many players are going to open them, so the game would have to be periodically generating new sets of drops and if it's going to do that it may as well create them as-needed instead of having to store them somewhere.

  • Like 1
Link to comment
Share on other sites

14 minutes ago, Gibson.4036 said:

People open some loot on mid-level characters specifically to get mid-tier loot. Since you can get a loot container on a level 80 and open it on a lower level character to influence the contents, we know the loot is generated on opening.

I believe this is the answer the OP was looking for

  • Like 3
  • Confused 4
  • Sad 1
Link to comment
Share on other sites

On 4/15/2023 at 2:49 PM, roederich.2716 said:

What you guys think about loot generation?

Is it generated and put in the chest then waiting to be picked up or is loot generated the moment a chest is opened?

I'd say it depends on the chest.
If it's affected by magic find, your loot is more than likely generated on interaction as it has to calculate what to drop based on your magic find at the moment. 
If it's not affected by magic find, your loot may just be generated on container spawn. 

However, to keep things simple in the background for development, it may still actually be generated on the spot and just not take into account your magic find in calculating  drop chances.

That's what I think happens anyways; it's generated on interaction and the only difference is if the container takes your magic find % into its considerations for drop calculations.

  • Confused 4
Link to comment
Share on other sites

Most containers are not affected by Magic Find, but some are.

Most containers are affected by the level of character opening them (but some aren't).

The game cannot be sure on container drop on which character it will be opened on.

In case of open world lootable chests (as opposed to container objects in inventory), there's a lot of people looting them, with each person obtaining different drops.

There's no reason to have completely different systems of drop generation (pre-generated and ad hoc) for different containers.

As such, we can be reasonably sure that the drops are being generated on container opening, and not before.

Edited by Astralporing.1957
  • Like 3
  • Thanks 1
  • Confused 3
Link to comment
Share on other sites

Anyone remember the Stone of Jordan farming in Diablo2? There was a random chest you could buy, with a chance to get the Stone. It was genereated before opening, so hackers found a way to determine if it was in the chest by doing a memory search.

The obvious answer is:

It's generated when you click on it. That is the best way to prevent such hacks.

  • Like 4
Link to comment
Share on other sites

10 minutes ago, Albadaran.1283 said:

Anyone remember the Stone of Jordan farming in Diablo2? There was a random chest you could buy, with a chance to get the Stone. It was genereated before opening, so hackers found a way to determine if it was in the chest by doing a memory search.

The obvious answer is:

It's generated when you click on it. That is the best way to prevent such hacks.

Older Pokemon games can have a similar problem. Because they include a lot of 'random' events and the entire game had to fit on a cartridge they used 1 pre-generated string of random numbers for everything. Each time a random event happened the game would take the next number in the sequence to determine the outcome. Which meant once some players found the sequence in the games code they could work out ways to manipulate it. Mainly using easily repeatable actions to move the sequence along until it was at the right point for a rare outcome they wanted (like a shiny pokemon spawning).

A lot of games work on what's most practical, or least demanding for the game to do, because the outcome will be the same either way for players (except when they're trying to break it) and it's easier to code and less likely to go wrong.

That's why I think GW2 generates the loot when a container is opened. Doing it any other way makes it harder to allow for all the variables (like how much magic find the character opening it has), adds extra variables that need to be accounted for (like how many people are going to open it) and means the game needs somewhere to store the data on each set of loot until it's claimed. Generating the loot when the container is open is much simpler and avoids a lot of opportunities to cheat the system.

  • Like 3
Link to comment
Share on other sites

When it's opened of course, doing it any other way is daft. 

 

I had a stack of 100+ Unidentified Items after playing today. This stack could be stored as:

 

A database entry with a single Item ID and a count of100 . This is the minimum amount of data that has to be stored.

 

Or

 

A database entry with a single Item ID and a count of 100. And another entry for each of those 100 bags that details their contents. Of course you also have the bags that can contain more than one item, perhaps containing variable amounts of coin too.

 

Imagine the cost of storing, maintaining and tracking the contents of the, presumably, billions of containers in the game, including those on the trading post. Why incur that cost? I mean, imagine I just vendor the stack because I can't be bothered dealing with it. All the additional effort calculating the contents of the bags would be wasted.

  • Like 6
  • Confused 1
Link to comment
Share on other sites

As already explained, the only sensible way to implement random containers is that loot is generated at the moment of looting the container. This can be tested most directly in relation to a rollback caused by an open world instance crashing. Any containers including those in your inventory and open world chests like JP rewards that you already opened during the period that was rolled back will reset to the unlooted state, and when you open the same containers again (and again and again if the latest update is particularly unstable) you'll get different loot.

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...