Resource Node Related Knowledge (Vanilla and Modded)

AFGResourceNode Classnames Could be handy for making custom spawners/despawners or randomizing node locations etc Vanilla Resource types:
Gas - EResourceForm::RF_GAS:
Desc_NitrogenGas_C

Heat - EResourceForm::RF_HEAT:
Desc_Geyser_C

Liquid - EResourceForm::RF_LIQUID:
Desc_LiquidOil_C
Desc_Water_C

Solid - EResourceForm::RF_SOLID:
Desc_SAM_C
Desc_Stone_C
Desc_OreIron_C
Desc_OreCopper_C
Desc_OreGold_C
Desc_Coal_C
Desc_RawQuartz_C
Desc_Sulfur_C
Desc_OreBauxite_C
Desc_OreUranium_C
Gas - EResourceForm::RF_GAS:
Desc_NitrogenGas_C

Heat - EResourceForm::RF_HEAT:
Desc_Geyser_C

Liquid - EResourceForm::RF_LIQUID:
Desc_LiquidOil_C
Desc_Water_C

Solid - EResourceForm::RF_SOLID:
Desc_SAM_C
Desc_Stone_C
Desc_OreIron_C
Desc_OreCopper_C
Desc_OreGold_C
Desc_Coal_C
Desc_RawQuartz_C
Desc_Sulfur_C
Desc_OreBauxite_C
Desc_OreUranium_C
Modded (Currently only FF and RP - please let me know of other ones and I'll add to list. OFC these are subject to change more frequently than vanilla))
-- Ficsit Farming --
Solid - EResourceForm::RF_SOLID:
Desc_FF_Dirt_Fertilized_C
Desc_FF_Dirt_C
Desc_FF_Dirt_Wet_C

-- Refined Power --
Liquid - EResourceForm::RF_LIQUID:
Desc_RP_Deanium_C

Solid - EResourceForm::RF_SOLID:
Desc_RP_WaterDamNode_C
Desc_WaterTurbineNode_C
Desc_RP_Thorium_C
-- Ficsit Farming --
Solid - EResourceForm::RF_SOLID:
Desc_FF_Dirt_Fertilized_C
Desc_FF_Dirt_C
Desc_FF_Dirt_Wet_C

-- Refined Power --
Liquid - EResourceForm::RF_LIQUID:
Desc_RP_Deanium_C

Solid - EResourceForm::RF_SOLID:
Desc_RP_WaterDamNode_C
Desc_WaterTurbineNode_C
Desc_RP_Thorium_C
20 Replies
Beef
BeefOP•5w ago
Spawning Nodes After spawning your custom nodes, don't forget to call GenerateNodeClusters mentioned in FGResourceScanner.h in your C++ or Blueprint to update the scanner pings (thanks MrHid6 I saw you mentioned this previously) Just a heads up that GenerateNodeClusters is very heavy method. It took as long as 880ms to run on my machine
Mrhid6
Mrhid6•3w ago
As a FYI This is only for the pings. The client will not see the nodes on the map when playing on a dedicated server or multiplayer.
Beef
BeefOP•2w ago
To get nodes showing up on the map properly at the moment (which are found by the radar towers), I am calling the following just after spawning in nodes
for (TActorIterator<AFGBuildableRadarTower> It(GetWorld()); It; ++It)
{
AFGBuildableRadarTower* RadarTower = *It;
if (RadarTower)
{
RadarTower->ClearScannedResources();
RadarTower->ScanForResources();
}
}
for (TActorIterator<AFGBuildableRadarTower> It(GetWorld()); It; ++It)
{
AFGBuildableRadarTower* RadarTower = *It;
if (RadarTower)
{
RadarTower->ClearScannedResources();
RadarTower->ScanForResources();
}
}
I'm not sure if this propagates multiplayer or not
Robb
Robb•2w ago
from what you have seen, is there a point at which it is "too late" to spawn a resource node? for example, what if there was an in-game event that caused a meteor to land somewhere and you could put a miner on it - is anything getting in the way of that?
Beef
BeefOP•2w ago
Nope, I spawn and destroy nodes the middle of the game just fine when re-rolling. Assuming you intend for them to persist, the only time I would imagine you run into issues of being too late is on re-init the game if you don't re-associate a resource extractor/miner/portable miner with that custom node and it throws an error. I don't save the actors for my nodes at all and instead re-spawn them newly on every load, saving only some characteristics about them (position/rotation/etc) into a struct instead so its absolutely doable
Beef
BeefOP•6d ago
If you do call this method by the way for pings, you're welcome to adapt my rewrite. I haven't done anything to get it working with multiplayer (and I'm not sure it's needed as it may just be needed client-side?) as I've been working on just singleplayer functionality for now, but its significantly faster and I believe it has all the same functionality. Just needs access transformers to write to the scanner. https://github.com/TheRealBeef/Satisfactory-Resource-Roulette/blob/491155f49203075108157af9c20dcc540a05806d/Source/ResourceRoulette/Private/ResourceRouletteUtility.cpp#L758
GitHub
Satisfactory-Resource-Roulette/Source/ResourceRoulette/Private/Reso...
Contribute to TheRealBeef/Satisfactory-Resource-Roulette development by creating an account on GitHub.
Robb
Robb•6d ago
Just needs access transformers to write to the scanner.
sanity check, it looks like said access transformers are in the repo already? https://github.com/TheRealBeef/Satisfactory-Resource-Roulette/blob/de130123384197508fa9d208ad330780271bdf41/Config/AccessTransformers.ini#L16
Beef
BeefOP•6d ago
I'm linking to a specific method within the mod from my utility class that can be called instead of GenerateNodeClusters() to achieve the same goal of refreshing the resource scanner pings - I don't imagine he's going to use the whole mod to adapt a single method 🙂, and its useful information for whoever else may desire to use it in the future.
Mrhid6
Mrhid6•6d ago
So looks like since I added the radar tower stuff the scan will only ping the closest node and not go further. Need to investigate further @Beef
Beef
BeefOP•5d ago
FGResourceScanner has an int32 mNrOfClosestClustersToMark which controls the max number of nodes that get pinged. It's possible this is initialized to a different value? so far as I understand, radar towers store their representations separately from the ResourceScanner clusters that get pinged One small change as it was also grabbing deposits :Sadge: its fixed now and I've updated the link
Mrhid6
Mrhid6•4d ago
@Beef Something that I have just found is that the GenerateNodeClusters function doesn't clean out the mNodeClusters variable on the scanner. We call that function after each sublevel has spawned that contain our resource nodes
Beef
BeefOP•4d ago
just be conscious as it's pretty heavy method in my testing it may also be why I don't run into the issue as my custom method is overwriting mNodeClusters directly
Mrhid6
Mrhid6•4d ago
Yeah we run that function after the sublevel has streamed in and not on each node spawn
Beef
BeefOP•4d ago
I assume by sublevel you're referring to the world partition? or this is something separate? I only run the Generatenodeclusters (both the vanilla one and now my own variation of it) once on savegame load and it works everywhere on the map afaik
Mrhid6
Mrhid6•4d ago
Its something different, We place all our nodes in a new level then spawn the level on top of the games level
Beef
BeefOP•4d ago
Ah ok, so you are just calling at at the end of loading them all
Mrhid6
Mrhid6•4d ago
Yeah after each sub level is streamed in We only have like 6 sub levels so not that bad
Beef
BeefOP•4d ago
ok, i only warned because it took like 880ms to run GenerateNodeClusters on my machine :NOOOO: - it single-handedly made my mod feel heavy since worst methods otherwise are like 120ms in total when loading the save vs that custom method which you can adapt, even with additional logging steps, is way faster
ScannerGenerateNodeClusters: Generated 765 clusters across 21 threads.
Desc_RP_Deanium_C: 3 clusters
Desc_SAM_C: 19 clusters
Desc_NitrogenGas_C: 7 clusters
Desc_OreBauxite_C: 15 clusters
Desc_OreUranium_C: 5 clusters
Desc_OreCopper_C: 54 clusters
Desc_RawQuartz_C: 11 clusters
Desc_RP_WaterDamNode_C: 48 clusters
Desc_Geyser_C: 25 clusters
Desc_Stone_C: 54 clusters
Desc_FF_Dirt_C: 40 clusters
Desc_RP_Thorium_C: 31 clusters
Desc_Water_C: 12 clusters
Desc_FF_Dirt_Wet_C: 38 clusters
Desc_LiquidOil_C: 30 clusters
Desc_Coal_C: 61 clusters
Desc_OreGold_C: 17 clusters
Desc_FF_Dirt_Fertilized_C: 34 clusters
Desc_Sulfur_C: 9 clusters
Desc_WaterTurbineNode_C: 138 clusters
Desc_OreIron_C: 114 clusters

UResourceRouletteUtility::ScannerGenerateNodeClusters executed in 1.424 ms
ScannerGenerateNodeClusters: Generated 765 clusters across 21 threads.
Desc_RP_Deanium_C: 3 clusters
Desc_SAM_C: 19 clusters
Desc_NitrogenGas_C: 7 clusters
Desc_OreBauxite_C: 15 clusters
Desc_OreUranium_C: 5 clusters
Desc_OreCopper_C: 54 clusters
Desc_RawQuartz_C: 11 clusters
Desc_RP_WaterDamNode_C: 48 clusters
Desc_Geyser_C: 25 clusters
Desc_Stone_C: 54 clusters
Desc_FF_Dirt_C: 40 clusters
Desc_RP_Thorium_C: 31 clusters
Desc_Water_C: 12 clusters
Desc_FF_Dirt_Wet_C: 38 clusters
Desc_LiquidOil_C: 30 clusters
Desc_Coal_C: 61 clusters
Desc_OreGold_C: 17 clusters
Desc_FF_Dirt_Fertilized_C: 34 clusters
Desc_Sulfur_C: 9 clusters
Desc_WaterTurbineNode_C: 138 clusters
Desc_OreIron_C: 114 clusters

UResourceRouletteUtility::ScannerGenerateNodeClusters executed in 1.424 ms
Mrhid6
Mrhid6•4d ago
@Beef Why dont you make a hook for the function then just override the base game function, then create a mod so others can use it?
Beef
BeefOP•4d ago
That seems a clever idea. I did some hooks in my first mod and its pretty straightforwards. For the randomization mod its easier to use a custom method as I'm replicating much of vanilla functionality separately anyways in order to have control over it and calling one vs the other is same same. At some point I could get to it but it won't be a priority for me at all. My code is all open source anyways.
Want results from more Discord servers?
Add your server