Adding new item to merchant store.

Random is random. That you experience worse loot with low luck characters is just... random... or confirmation bias on your end.

Here is a funny story about random from when I first introduced caves with special loot: There was a 35% chance to spawn a cavern encounter instead of mountains, a 5% chance to turn this cave into a mining site encounter, and a 15% chance to spawn a weapon loot crate inside the mining site, which had a 1 in 30 (or so) chance to spawn a Bozar.

So I start a new game, travel to Shady Sands, suddenly get into an encounter, it's a mining site and it has weapon loot containers and in that container is a bozar...... on my first try, at level 1, and I played for less than 5 minutes...... That's the beauty (or curse) of random. This never happened to me ever again.
 
Last edited:
Try 3456 7 times with Luck 8 and Luck 2 character with the difference in STR, PER, END, AGI, same tags.

Record item list of Maida and Sajag in klamath.

The sample is super small and certainly doesnt satisfy my statistic requirement. Still, it confirm something for me.

- Certainly, random is pretty random. I cant say for sure luck affecting all the state of item spawn. I certainly cant say that better luck will spawn better item. Like Sajag's leather armor, I see it very rarely, like 1 in 20 chance overall.
- Interestingly, more item amount will spawn with better luck I think. Like with Maida, all four case show a bigger overall amount of goods in 40-50% of category. The rest doesnt change, and very few will change for the worse. I say this confirm my impression: the more luck you have, the more goods you will find in store

-The ratio of goods affect by luck doesnt change. If this one category got less/more units that push it up/down (which change the ratio), another category got more/less units that turn the other way so that the ratio wont change. Like, Maida got 8 categories that increase units sold with higher luck? Over the reloads that number wont change. If this one category change one way, another with change the other way so that there's 8 categories. In statistic it's an interesting feature.

- If you get in town first time as the game recognize it, the difference between two state of luck seem to show sharper.

EDIT: I get really bored with this statistic thing. If I ever has interest in future, which is possible, I will do more. For now, another mod, please~
 
Last edited:
Personally verified data is a great thing to believe in.

Certainly the data sample currently doesnt satisfy statistic demand, even by the lowest standard.

But what it's been saying so far, doesnt bode well for the "luck does not affect merchant store spawn code" theory.
 
Sorry but "code theory?" Ahahahahahahahahaha.....
.... ahahahhaaahhaaaha.... hehehe... hehe... heh....
okay I'm good now .... *snicker*
*whipes away laughing tears and continues his popcorn*
 
jesus,code does absolutly nothing without specific entries,what in this checks for any stats?

Code:
#define check_restock_item(the_item, min_amt, max_amt, res_perc)                    \
        restock_amt := random(min_amt, max_amt);                                    \
        if (obj_is_carrying_obj_pid(self_obj, the_item) < restock_amt) then begin   \
            if (res_perc >= random(1,100)) then begin                               \
               stock_pid_qty(self_obj, the_item, restock_amt)                       \
            end                                                                     \
        end else begin                                                              \
           stock_pid_qty(self_obj, the_item, restock_amt)                           \
        end
 
I do read those code.

Problem is: when I reload and check five times, data tell me high luck ensure more items in store than low luck.

Here is the excel if you know what to read.

Sorry to all you authority figures here, but hard data check is saying you dont know what you are talking about.

Certainly, it's just 5 reload. I will keep doing it until maybe 10 times. Still small data sample, but at least I know, and other people know if Luck has an effect on merchant store items.
 
TBH I'd consider it has some statistical meaning if it's at least 100 times.
I know, I know. even the least requirement would be around 40 (size of a class doing survey). But I am doing this out of my own play time and without pay. 10 is what I consider my maximum effort on this question and answer.

If a gamer say 10 reload and check data, typing into excel list, doing final conclusion... is not enough to have their own answer of believe or not...
 
This is what arguing with anti-vaxxers feels like.
 
I know, I know. even the least requirement would be around 40 (size of a class doing survey). But I am doing this out of my own play time and without pay. 10 is what I consider my maximum effort on this question and answer.

If a gamer say 10 reload and check data, typing into excel list, doing final conclusion... is not enough to have their own answer of believe or not...

The Trader have a Script code like all other Things, in this code are the items that spawn random with a number from 1to 100 this is a process that makes the game independent from player or his stats.
 
I know the scripts. Problems is we dont know how Luck affect that random number generator.

And over my 5 6 reload and checking, I can say for sure that throwing knives get added more the higher luck you have: a noticeable difference of 7 8 units over 6 reload. Money is total 49/5 52/6 reload, so it's definite. 7 categories got 1 or 2 units over 5 reload, which is a slight increase. First Aid Kit and Combat knife have a slight decrease, in a reverse trend. That was Maida. Sajag has a reverse trend compare to her: he has less cheap categories increase, but more expensive categories (Leather Armor)

if you say Luck has no affect, the increase, decrease should be spread all over the place with slight +/- not definite, noticeable sign like money or throwing knives. The which show no sign of being tweaked in trader code.

If Luck really has no effect, over the next 5 reloads there should be a retweak in the number of throwing knives and money in order to make the difference change back to the lower level of 1 or 2 points.. IN which case we will have two definite trend for these two numbers. We shall see.

This is what arguing with anti-vaxxers feels like.

Wrong. Antivaxxers, overall, are extremely statistic-blind. They dont believe in hard cold number.

I, on the other hand, believe in the power of statistic.
 
Last edited:
I know the scripts. Problems is we dont know how Luck affect that random number generator.
I think it's more appropriate to say "you" don't know instead of "we".
And this is the disassembled code of how the engine does random roll:
Code:
004A30C0 ; int __usercall roll_random_@<eax>(int min@<eax>, int max@<edx>)
004A30C0 roll_random_ proc near
004A30C0            push    ebx
004A30C1            mov     ebx, eax
004A30C3            cmp     eax, edx
004A30C5            jle     short loc_4A30D3
004A30C7            inc     eax
004A30C8            sub     eax, edx
004A30CA            call    ran1_
004A30CF            add     eax, edx
004A30D1            jmp     short loc_4A30DF
004A30D3 ; ---------------------------------------------------------------------------
004A30D3
004A30D3 loc_4A30D3:
004A30D3            lea     eax, [edx+1]
004A30D6            sub     eax, ebx
004A30D8            call    ran1_
004A30DD            add     eax, ebx
004A30DF
004A30DF loc_4A30DF:
004A30DF            cmp     eax, ebx
004A30E1            jl      short loc_4A30E7
004A30E3            cmp     eax, edx
004A30E5            jle     short loc_4A30F9
004A30E7
004A30E7 loc_4A30E7:
004A30E7            push    edx
004A30E8            push    ebx
004A30E9            push    eax
004A30EA            push    offset aRandomNumberDI    ; "Random number %d is not in range %d to "...
004A30EF            call    debug_printf_
004A30F4            add     esp, 10h
004A30F7            mov     eax, ebx
004A30F9
004A30F9 loc_4A30F9:
004A30F9            pop     ebx
004A30FA            retn
004A30FA roll_random_ endp
You can use disassembler like OllyDbg or IDA Pro to check the engine if you don't believe the code above.
But sure, no one can stop you from saying PC's Luck or other stats affect the random number generator. It's better to let other people reading this thread make their own judgement with the script source, engine code, and the result of your statistic [sic].
 
I get really bored with this statistic thing. If I ever has interest again about this in future, which is possible, I will do more testing. For now, another mod, please~
 
Back
Top