#GaloreLib
1 messages · Page 1 of 1 (latest)
Some bonus features (planned/implemented);
- Improved automatic property assigmend; localisation properties,
data.RecipePrototype.allow_productivity,data.RecipePrototype.main_product, etc. - A full procuderal icon library. (tiering, overlays, Galore-like icons)
- A enormous amount of high performance prototype manipulating functions. (Optimised for prototypes made through the
vgal.data.extendfunction.)
And a example.
ok so prefixes right
it takes like 10 seconds to write a name function that prefixes things for you
and sure you have to go name("thing") in prototype defs but its easier than typing the prefix every time
But luckily you dont have to type the prefix every time, see linked example
how does it decide when to add the prefix?
And yea while a name function takes a few second to create, it did not take a few second for me to create the inherited prefix and domain system
The prefix on the end of the function call?
(from the example)
becuse surely youre not automatically prepending it to recipe ingredients etc
Nono
Only propotype names that get created in the function call
So the nested prototypes and ofc the main prototype
That sounds great. Might try it in a new project
huh how does it do that? modifying the _G table to store a context variable?
Or does Lua have dynamic bindings that i don't know about
Just table manipulation. With "Only prototype names that get created in the function call" I meant only the names of prototypes created/to-be-extended in the function call, I should probably have worded that better
When does this preprocessing happen? At the end of your mod’s execution of each data stage? A combined preprocessing at some point in data-final-fixed?
E.g. if my mod using this lib adds a ItemPrototype with a recipe field, is the recipe added to data.raw alongside the item?
You also seem focused on performance a couple of times but I’ve literally never run into a case where performance in data stage is an issue. Even naively iterating through data.raw is completely fine in my experience.
during the galorelib extend call
When does this preprocessing happen?
In the function call.vgal.data.extendprocesses the input table and callsdata:extendfor the contained prototypes.
if my mod using this lib adds a ItemPrototype with a recipe field, is the recipe added to data.raw alongside the item?
Yes.
You also seem focused on performance a couple of times but I've literally never run into a case where performance in data stage is an issue. Even naively iterating through data.raw is completely fine in my experience.
Even though Lua's performance is great, I have seen some performance cost originating from looping through prototypes in combination with other actions. My best example is looping through prototypes and figuring out if they belong to a specific mod. Either through icon paths, trying to trim the prefix (if the mod has one) or other methods. (This is not needed for prototypes added by this library.)
But I must say that this library is more of a QOL lib than one focussed on increasing prototype loading performance, the performance improvements are just a bonus.