Random items not so random?

Goody huts and lairs produce similar items

In playing my games I get a feeling that something is fishy with the algorithm that decides what items I get from goody huts and lairs. My feeling is that items, especially weapons, re-appear over and over in the same game. For example, it is not uncommon that I receive two or even three identical items in the first 10-20 goody huts/lairs I grab.

In my last game I had 5-6 +3 initiative dagger type weapons on turn 80, but no spears or axes. In another game three of the first six huts I grabbed were giant maces.

Anyone else have this feeling/experience?

32,838 views 23 replies
Reply #1 Top


Anyone else have this feeling/experience?

 

YES!!!

XO

 

Resource nodes and monster lairs tend to come in pairs too.

 

Please SD! - can we at least get some word on this?

Reply #2 Top

I've seen this extensively when I modded games. I'm not saying that mods are at fault. What I'm saying is that if the pool of items is much larger, then the chance of getting the same item twice or three times should be smaller. And yet I frequently get the same item drop over and over.

 

Reply #3 Top

Mods are not at fault.  It happens to me all the time. Resources and lairs often come in groups, drops of the same rarity seem almost always identical. I get the impression it refreshes when you find something else.

I could be wrong though. In any case, it would be nice if low level weapons would drop a lot less compared to acessories and armor pieces.

Reply #4 Top

I see this all the time. 

Reply #5 Top

Yeah, I got 3 stone maces my last game.

Reply #6 Top

Yeah, I've walked through the code on this because I've had the same feeling from time to time but it appears to be working.  At about the point where I've gotten 3 Stone Maces in a row I also think that it seems very unlikely.  But it certainly isn't always the mace, and it doesn't mean that I will always get a mace next (it seems like whenever I'm watching for it it never happens).

So looking at the code it seems to just be that sometimes you will randomly roll the same item multiple times.  Though I'll keep my eyes out for it in the future.

One big offender that I have changed for 1.2 is the Shattered Statue goodie hut. Previously it gave out 1 of 5 items (instead of any common item).  Because of that if you got a lot of Shattered Statues around you it was a lot more liekly you would get a bunch of those items (Stone Maces, Escape Scrolls, Hate Stones).

 

Reply #7 Top

Thanks for checking this for us, Derek.

Yeah, I really started to dislike the Shattered Statue. Good to know that one does give specific items. Means I am not completely crazy.

Reply #8 Top

Still wishing you guys would check out the issue I'm having with my mods, where the game will show one item and then award another item in quest dialogs and after-battle reports. Tired of getting hairstyles when finishing a quest, so to speak.

Reply #9 Top

Quoting Heavenfall, reply 8

Still wishing you guys would check out the issue I'm having with my mods, where the game will show one item and then award another item in quest dialogs and after-battle reports. Tired of getting hairstyles when finishing a quest, so to speak.

 

I've seen this.  I was going to see if I could reproduce the bug.  I thought I was crazy.  I saw a death robe as an award, but got a fantastic sword instead.   

Reply #10 Top

I had a game lately where I found 3 hate stones in a row and I frequently get the impression, that i find the same items over and over again. Maybe something in the random number generator is causing this? There are random number algorithms that generate not so random numbers if you always reseed them with a new seed instead of generating several numbers from one seed. I think the Java Random class behaves like that. If you always create a new object to get a new number the numbers are not as good. If you reuse one object to create all the numbers they a better distributed. They don't using Java but maybe a algorithm that behaves similar.

Reply #11 Top

Quoting Derek, reply 6


One big offender that I have changed for 1.2 is the Shattered Statue goodie hut. Previously it gave out 1 of 5 items (instead of any common item).  Because of that if you got a lot of Shattered Statues around you it was a lot more liekly you would get a bunch of those items (Stone Maces, Escape Scrolls, Hate Stones).

 

This explains a lot. Stone Maces and Hate Stones were the items I was most frequently getting multiple copies of. if the chance is 1 in 5 for each three in a row of any is not that improbable. it does not explain the dagger issue though. 

Is the list of possible items per goody hut / lair type available somewhere? it would be nice to learn what huts can be skipped if you are not in need of certain items.

Reply #12 Top

Quoting jonasadolphson, reply 11

...it would be nice to learn what huts can be skipped if you are not in need of certain items.

^This is a layer of strategic depth FE could definitely use.

Reply #13 Top

Yeah, my last game I kept getting shields from EVERY dragon :p (I killed 6+)

We know random is random, but add some forced "randomness" into the algorithm? ;)

Reply #14 Top

I don't know how it is coded so I can make any specific statements...  but I'd have a look at how the code seeds the random number generator.  Is it possible the code is passing the same seed for subsequent calls?

http://www.cplusplus.com/reference/cstdlib/srand/

Initialize random number generator

The pseudo-random number generator is initialized using the argument passed as seed.

For every different seedvalue used in a call tosrand, the pseudo-random number generator can be expected to generate a different succession of results in the subsequent calls torand.

Two different initializations with the same seedwill generate the same succession of results in subsequent calls torand.

If seed is set to 1, the generator is reinitialized to its initial value and produces the same values as before any call torandorsrand.

In order to generate random-like numbers,srandis usually initialized to some distinctive runtime value, like the value returned by functiontime(declared in header <ctime>). This is distinctive enough for most trivial randomization needs.

Reply #15 Top

Seed is randomized because a static seed allows you to predetermine the sequence of returns, not because the returns would be the same numbers without randomizing the seed. Unless they have chosen a static seed that just so happens to give a sequence of results where pairs are probable, changing seed will have no impact on this.

Reply #16 Top

Correct. But a predetermined sequence of turns is sometimes desired; for example it may be desirable to seed the RNG with the same seed after reload. This could be done to ensure a sequence can be repeated if desired and to prevent the most simple form of reload-until-you-get-what-you-want.

The hard way to prevent it is to randomize all drops on map creation and keeping it as part of the map save.

If I could make a wish I would like to have both options: (1) Same RNG seed on reload , and (2) Save loot items with map.

 

Reply #17 Top

Quoting jonasadolphson, reply 16

Correct. But a predetermined sequence of turns is sometimes desired; for example it may be desirable to seed the RNG with the same seed after reload. This could be done to ensure a sequence can be repeated if desired and to prevent the most simple form of reload-until-you-get-what-you-want.

The hard way to prevent it is to randomize all drops on map creation and keeping it as part of the map save.

If I could make a wish I would like to have both options: (1) Same RNG seed on reload , and (2) Save loot items with map.

 

k6

 

Contrary to initial impressions, I don't believe the small number of threads on this subject is indicative of it having little impact on the overarching game-play experience; but rather just how elusive the true cause of an undesired effect can be.  In my personal opinion, this thread is pointing out the elephant in the room: the one single aspect of the game's design that is hindering it's claim to immortality (even more than the UI).  This elephant may have been brushed under so many beautiful rugs that it is practically indistinguishable from functional game mechanics which actually produce the psychological experiences they intend, but the massive ball of wool in the room still has a trunk and tusks.  I honestly don't consider this to be a strategy game, but a randomly generated grand rpg - the sheer degree of randomness tips the scale from strategy TO role playing.  The fact that a saved game plays out differently after a reload practically obliterates any feeling that decisions have lasting power.  However, now that I no longer sit down with the expectation of developing grand strategies, and instead look forward to a nice ride, I find the game much more enjoyable... it's like a one stop rpg maker.

Thanks again SD for hearing my thoughts. ^Here's to turning an 85 into a 95.

Reply #18 Top

Perhaps a more-elegant solution would be to have the system pull items from a table without replacement; e.g. once you get the stupid stone mace once it doesn't pop again so you never, ever, ever, ever have to look at the damn thing and read the joke, mildly funny the first time, annoying the second, and now as horrible as an innocent little girl in a scary movie who you just know is demon-possessed...

Sorry, I get carried away sometimes.  Point being, pull items from a table and flag 'em as passed out already.  If that's too restrictive for generic bits of armor, put multiple copies in the table.  

Reply #19 Top

I don't think there are enough low level items in the game to make them all unique. You need to get a duplicate every once in a while.

Like I said earlier, it would be nice if completely useless items, like the stone mace, are less common than more useful ones, like accessories.

Reply #20 Top

Quoting Fallenchar, reply 19
I don't think there are enough low level items in the game to make them all unique. You need to get a duplicate every once in a while.

Like I said earlier, it would be nice if completely useless items, like the stone mace, are less common than more useful ones, like accessories.

But how difficult would it be for SD to increase the number of low level items, thus decreasing repetition?

It would be pretty easy low hanging fruit IMO. They don't have to be very creative either. For exmple, a variety of low level swords or staffs each with a different minor benefit. One would have +5% magic resistence, another might have ignore 20% of opponents defense, another might have +2 dodge, etc, etc.

If I can create stuff by adding/altering the xml files, it should be a very easy thing for SD to do.

Reply #21 Top

Double post, sorry.

Reply #22 Top

I have seen this as well a lot.

Reply #23 Top

Quoting Heavenfall, reply 15

Seed is randomized because a static seed allows you to predetermine the sequence of returns, not because the returns would be the same numbers without randomizing the seed. Unless they have chosen a static seed that just so happens to give a sequence of results where pairs are probable, changing seed will have no impact on this.

If they reseed the generator every time they call it but call it with the same seed every time they will get the same results.  I'm sure they intend to seed it with a different value each time but could possibly using the same value by mistake.  I admit it seems so obvious that it should be quickly caught, but in my experience often bugs turn out to be the painfully obvious things.  Just sayin'!