Jump to content

Min/max condition bug with custom categories?

Pending 1.2.2

HunterZ
HunterZ

Posted

Just tried using this with Carbon, and discovered what I think is a bug:

I wanted to make vehicle_parts (blue plastic trays) have a chance to spawn medium or high quality parts, so I did the following relevant steps:
1. In CustomLoot.json, set the "lootTable" for "vehicle_parts" to "hz_vehicle_parts", which creates "hz_vehicle_parts.json"
2. In hz_vehicle_parts.json, created "Tier1", "Tier2", and "Tier3" entries under "Categories" with various percentages adding to 100
3. In hz_vehicle_parts.json, created "Tier1", "Tier2", and "Tier3" entries under "LootTypes", copied in the corresponding tiers of vehicle parts from the sibling "Component" entry of "LootTypes", and customized min/max stack & condition values

And here's the bug:
- On first reload of the CustomLoot plugin, the min/max condition values get removed from hz_vehicle_parts.json for my Tier1/Tier2/Tier3 LootTypes entries, but CustomLoot applies them in-game
- On second reload of the CustomLoot plugin, it reverts to using the default 90-100% condition range (probably because the values were no longer in the JSON at the time of plugin load)

I also tried tweaking the condition ranges under the default "Component" entry of "LootTyes". The values stick in the JSON file but are not used when spawning the items from my Tier1/Tier2/Tier3 categories.

I suspect the bug is that CustomLoot is failing to write min/max condition values for custom LootTypes entries in a loot table JSON file.

laodu

Posted

The situation I encountered is the same as yours! Additionally, xmas.present.large is unable to add spoils with custom names

  • Administrator
Steenamaroo

Posted

Hi @HunterZ
This doesn't really sound like a bug, as such.
You're not meant to be able to add new custom categories.

The plugin works from the item categories defined by Rust vanilla game and every item in the game 'knows' what category it is in.

You can have custom items, added via chat commands but, behind the scenes, that's really just assigning unique probabilities to X item with some specific skin., treating that as separate to the vanilla X item. 

  • Like 1
laodu

Posted

Adding through chat commands can also encounter this situation.

  • Administrator
Steenamaroo

Posted

From HunterZ's description it sounds like they're manually adding new categories, which isn't a thing,
whereas the chat commands allow you to add new items which can appear as loot.

The new items, created by you,  have a custom name which you assign when you use the command, and then use existing in-game item name plus a skinID to make them unique, and separate to the original vanilla item.

 

Are you having issue with the loot that you get inside a Christmas present?
If so, CustomLoot doesn't support those, currently, as they work differently to normal lootcontainers,
although I have had a few requests to support them and intend to add that in soon.

  • Like 1
  • Love 1
HunterZ

Posted (edited)

Ah, I see. The default categories are rather arbitrary, so being able to weight those isn't really helpful (especially in my case where the items I'm interested in are all in the same one). I was trying to split some loot into tiers and maintain the vanilla percentages for the contained items. Instead I'll have to do some complex composite probability calculations to implement it at the individual items level I guess.

Edited by HunterZ
HunterZ

Posted (edited)

So I went ahead and fixed things to use only the default categories, and after running for about 17 hours I noticed a massive amount of CPU and RAM usage incurred - about 20x what any other mods (including Raidable Bases) have used:

Mod                      Author                              Version  Hook Time  Memory Usage  Compile Time  Uptime  
CustomLoot               Steenamaroo                         v1.2.2   19329ms    1.1gb         164ms         17h6m40s
CustomLoot v1.2.2 by Steenamaroo
  Path:                   C:\Games\rust\carbon\plugins\CustomLoot.cs
  Compile Time:           164ms
  Uptime:                 17h6m56s
  Total Hook Time:        19332ms
  Total Memory Used:      1.1 gb
  Internal Hook Override: True
  Has Conditionals:       False
  Mod Package:            Scripts (44)
  Processor:              Script Processor [.cs]

  Permissions:            N/A

Hooks:
#  Id          Hook                 Time     Memory   Fires    Subscribed  Async/Overrides
1  1330569572  OnServerInitialized  463ms    9.7 mb   1        True        0/1            
2  646977174   OnLootSpawn          17246ms  1.0 gb   149,057  True        0/1            
3  3757549339  OnEntitySpawned      1623ms   99.5 mb  466,524  True        0/2
Edited by HunterZ
  • Administrator
Steenamaroo

Posted

Hey,
Thanks for the info. That's not good.

I've no doubt performance of CustomLoot could be increased; It's an old plugin but OnLootSpawn is firing 150000 times in your 17 hour uptime which works out at 2.5 per second on average.
That seems excessive.

I'll use debug to check the rate on my own test server but assuming that reveals nothing I'd guess some plugin is mass creating/killing crates,
unless your server has a super fast rate of npc spawn+death?

  • Administrator
Steenamaroo

Posted

Actually, ignore the NPC part.
Corpses are handled by a different hook.

HunterZ

Posted (edited)

I'm not running any plugins that would spawn default containers, but I do run RaidableBases, which uses CopyPaste to spawn in bases with player deployable containers, and then the former populates them with loot from its own tables.

Here is my current plugin list anyway in case you want to look:

Mod                      Author                              Version  Hook Time  Memory Usage  Compile Time  Uptime  
AdminRadar               nivex                               v5.3.4   341ms      3.9mb         17ms          7h40m24s
AirDropMarker            AhigaO#4485                         v1.1.1   92ms       8.0kb         35ms          7h40m24s
BetterChinookPatrol      WhiteThunder                        v0.2.0   34ms       72.0kb        59ms          7h40m24s
CopyPaste                misticos                            v4.1.37  10ms       2.7mb         430ms         7h40m24s
CustomVendingSetup       WhiteThunder                        v2.10.3  91ms       8.0kb         277ms         7h40m24s
EntityOwner              Calytic                             v3.4.1   2ms        16.0kb        637ms         7h40m24s
EternalPlants            0x89A                               v1.0.1   0ms        0.0b          14ms          7h40m23s
Finder                   MON@H                               v3.1.1   1ms        16.0kb        66ms          7h40m23s
Godmode                  Wulf/lukespragg/Arainrr/dFxPhoeniX  v4.2.14  8ms        348.0kb       92ms          7h40m23s
ImageLibrary             Absolut & K1lly0u                   v2.0.62  72ms       11.6mb        328ms         7h40m23s
InventoryViewer          Whispers88                          v4.0.6   1ms        52.0kb        76ms          7h40m23s
MagicAirdropPanel        MJSU                                v1.0.2   82ms       260.0kb       38ms          7h40m23s
MagicBradleyPanel        MJSU                                v1.0.2   63ms       20.0kb        54ms          7h40m23s
MagicCargoShipPanel      MJSU                                v1.0.2   69ms       4.0kb         29ms          7h40m23s
MagicCh47Panel           MJSU                                v1.0.2   66ms       16.0kb        29ms          7h40m22s
MagicClockPanel          MJSU                                v1.0.3   13ms       1.6mb         29ms          7h40m22s
MagicEasterPanel         MJSU                                v1.0.3   65ms       16.0kb        41ms          7h40m22s
MagicFpsPanel            MJSU                                v1.0.2   2ms        272.0kb       26ms          7h40m22s
MagicGridPanel           MJSU                                v1.0.7   2ms        12.0kb        41ms          7h40m22s
MagicHalloweenPanel      MJSU                                v1.0.3   66ms       8.0kb         28ms          7h40m22s
MagicHeliPanel           MJSU                                v1.0.4   70ms       16.0kb        31ms          7h40m22s
MagicHostilePanel        MJSU                                v1.0.10  3ms        44.0kb        38ms          7h40m22s
MagicJoiningPanel        MJSU                                v1.0.3   1ms        28.0kb        28ms          7h40m22s
MagicLastWipePanel       MJSU                                v1.0.1   1ms        8.0kb         25ms          7h40m22s
MagicPanel               MJSU                                v1.0.8   118ms      3.4mb         162ms         7h40m22s
MagicPingPanel           MJSU                                v1.0.5   6ms        144.0kb       40ms          7h40m22s
MagicPlayersPanel        MJSU                                v1.0.3   1ms        116.0kb       29ms          7h40m22s
MagicRadiationInfoPanel  MJSU                                v1.0.4   3ms        16.0kb        39ms          7h40m22s
MagicRadiationPanel      MJSU                                v1.0.3   58ms       744.0kb       39ms          7h40m22s
MagicSantaPanel          MJSU                                v1.0.2   76ms       28.0kb        28ms          7h40m22s
MagicServerTimePanel     MJSU                                v1.0.6   1ms        24.0kb        26ms          7h40m22s
MagicSleepersPanel       MJSU                                v1.0.3   1ms        8.0kb         26ms          7h40m22s
MagicWipePanel           MJSU                                v1.0.5   1ms        8.0kb         28ms          7h40m22s
MapMyAirDrop             ColdUnwanted                        v0.1.0   122ms      16.0kb        80ms          7h40m22s
MonumentAddons           WhiteThunder                        v0.15.0  116ms      1.0mb         899ms         7h40m22s
MonumentFinder           WhiteThunder                        v3.1.2   23ms       488.0kb       126ms         7h40m22s
NavMeshErrorFix          Ryz0r                               v1.1.1   0ms        0.0b          14ms          7h40m22s
OfflineRaidProtection    realedwin                           v1.1.7   169ms      596.0kb       307ms         7h40m22s
RaidableBases            nivex                               v2.8.5   469ms      8.9mb         557ms         7h40m22s
SortButton               MON@H                               v2.2.0   3ms        12.0kb        108ms         7h40m22s
Telekinesis              WhiteThunder                        v3.2.1   0ms        0.0b          82ms          7h40m22s
UpdateChecker            tofurahie                           v4.1.3   835ms      0.0b          163ms         7h40m22s
WipeInfoApi              MJSU                                v1.1.0   1ms        0.0b          28ms          7h40m22s

Edit: And here is the subset that contain `Spawn(`:

AirDropMarker.cs
CopyPaste.cs
CustomVendingSetup.cs
InventoryViewer.cs
MapMyAirDrop.cs
MonumentAddons.cs
RaidableBases.cs

 

Edited by HunterZ
1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.3k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.