Pertam has practically no mushrooms
I started looking into this after a few people mentioned they cannot find mushrooms on Pertam even though it's supposed to, PhysicalModelCollections.sbc:
<Definition xsi:type="VR.PhysicalModelCollectionDefinition">
<Id>
<TypeId>PhysicalModelCollectionDefinition</TypeId>
<SubtypeId>PertamForageables</SubtypeId>
</Id>
<Items>
<Item TypeId="ForageableDefinition" SubtypeId="FruitPlant" Weight="0.5"/>
<Item TypeId="ForageableDefinition" SubtypeId="GrainPlant" Weight="1"/>
<Item TypeId="ForageableDefinition" SubtypeId="MushroomPlant" Weight="0.5"/>
<Item TypeId="ForageableDefinition" SubtypeId="VegetablePlant" Weight="1"/>
</Items>
</Definition> I did copy that to a local mod and then removed all other plants which did make me find mushrooms all over the place, so it's confirmed that it can spawn mushrooms and it's the right definition to look at.
I made a mod script to find forageables but because I have to be within some hundred meters from them (probably varies as it's based on sector LOD) I have to go around with spec cam to trigger them. I also marked where I've been with a giant dot billboard and recorded the forageables based on their position, so finding the same location twice would not count it twice.
I'm around the planet's center there with spec cam looking outward towards the surface, the lines are where I've been with spectator camera (only recorded within 300m from the surface, I tried to be around ground level when I flew) and the text is what it found in total... as you can see 1 mushroom, ~170 of everything else, and considering the weight that they have in the above definition, this makes no sense at all.
I also tried replicating how the sampler from MyPhysicalModelCollectionDefinition.Items is used:
> var ids = new List<string>();
> var weights = new List<float>();
> ids.Add("FruitPlant"); weights.Add(0.5f);
> ids.Add("GrainPlant"); weights.Add(1f);
> ids.Add("MushroomPlant"); weights.Add(0.5f);
> ids.Add("VegetablePlant"); weights.Add(1f);
> var sampler = new MyDiscreteSampler<string>(ids, weights);
> void TestSamples()
. {
. for (int num = 0; num < 30; num++)
. {
. float seed = MyHashRandomUtils.UniformFloatFromSeed(num);
.
. string lastRes = sampler.Sample(seed);
. for (int i = 0; i < 1000; i++)
. {
. string res = sampler.Sample(seed);
. if (res != lastRes)
. {
. Console.WriteLine("got different result!!!!");
. }
. }
.
. Console.WriteLine($"#{num} -- {lastRes}");
. }
. }
> TestSamples()
#0 -- FruitPlant
#1 -- GrainPlant
#2 -- VegetablePlant
#3 -- VegetablePlant
#4 -- VegetablePlant
#5 -- GrainPlant
#6 -- GrainPlant
#7 -- FruitPlant
#8 -- GrainPlant
#9 -- MushroomPlant
#10 -- VegetablePlant
#11 -- GrainPlant
#12 -- FruitPlant
#13 -- FruitPlant
#14 -- FruitPlant
#15 -- GrainPlant
#16 -- VegetablePlant
#17 -- MushroomPlant
#18 -- GrainPlant
#19 -- VegetablePlant
#20 -- GrainPlant
#21 -- VegetablePlant
#22 -- MushroomPlant
#23 -- GrainPlant
#24 -- VegetablePlant
#25 -- GrainPlant
#26 -- FruitPlant
#27 -- VegetablePlant
#28 -- MushroomPlant
#29 -- GrainPlant But I don't really understand the number being inputted in the code, it does sound like it never/rarely reaches 10.
Anyway, without a way to easily spawn them on the entire planet I can't really show an accurate distribution, but what I've searched so far clearly has it extremely skewed against mushrooms, so something needs to be fixed.
I can share the modscript I used if needed, but I imagine you (devs) have better tools for these things.
I have the same bug
Found a way to explore the entire planet, here's the forageable results:
In the entire planet there's 11 mushrooms and 1895 fruit plants, both which have the same 0.5 weight and the other two at 1.0 weight have less than the fruit plants... hopefully this highlights how broken that setting is.
EDIT: ops those are 1km radius points, so probably not 100% of the planet but still vast majority of it anyway.
Found a way to explore the entire planet, here's the forageable results:
In the entire planet there's 11 mushrooms and 1895 fruit plants, both which have the same 0.5 weight and the other two at 1.0 weight have less than the fruit plants... hopefully this highlights how broken that setting is.
EDIT: ops those are 1km radius points, so probably not 100% of the planet but still vast majority of it anyway.
Wow Digi, this is amazing work. Thank you for showing me that I'm not completely blind :)
Wow Digi, this is amazing work. Thank you for showing me that I'm not completely blind :)
Hello Engineer,
Thank you for reaching out to us on the forum regarding this issue, and thank you for the comprehensive overview of it and assistance with the mod.
We’ve created an internal ticket for it.
Kind regards,
Keen Software House: QA Department
Hello Engineer,
Thank you for reaching out to us on the forum regarding this issue, and thank you for the comprehensive overview of it and assistance with the mod.
We’ve created an internal ticket for it.
Kind regards,
Keen Software House: QA Department
I did some testing of my own and managed to duplicate similar skewing away from mushrooms.
the numbers on the left are from my duplicating the logic I found inside SE and the ones on the right are from passing a MyRandom straight to Select().
The offending bit seems to be a line inside the GetItemForPosition() function at the end.
Inverting the bits doesn't appear to change the value enough to prevent odd interactions and depending on the number of slots and what slot the Sampler is in the output of Select() becomes skewed. My image above is showing the output if there are 11 slots and the Sampler is in slot 3.Changing the logic to use "~hashCode << 1" appears to make the skewing go away.
Don't ask me why this happens, I suspect I'd need a PHD in math to answer that.I did some testing of my own and managed to duplicate similar skewing away from mushrooms.
the numbers on the left are from my duplicating the logic I found inside SE and the ones on the right are from passing a MyRandom straight to Select().
The offending bit seems to be a line inside the GetItemForPosition() function at the end.
Inverting the bits doesn't appear to change the value enough to prevent odd interactions and depending on the number of slots and what slot the Sampler is in the output of Select() becomes skewed. My image above is showing the output if there are 11 slots and the Sampler is in slot 3.Changing the logic to use "~hashCode << 1" appears to make the skewing go away.
Don't ask me why this happens, I suspect I'd need a PHD in math to answer that.Replies have been locked on this page!