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:
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))
20 Replies
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 machineAs 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.
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
I'm not sure if this propagates multiplayer or not
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?
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
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.
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
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.
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
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@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 nodesjust 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
Yeah we run that function after the sublevel has streamed in and not on each node spawn
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
Its something different, We place all our nodes in a new level then spawn the level on top of the games level
Ah ok, so you are just calling at at the end of loading them all
Yeah after each sub level is streamed in
We only have like 6 sub levels so not that bad
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
@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?
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.