#Beacon interface - Factorio Mods

1 messages ยท Page 1 of 1 (latest)

unique lantern
#

#mod-dev-showcase message
How was this implemented? I ask because one of my mods (modular beacon power) modifies a beacon's power consumption at runtime, but it does it in a janky way by making lots of different beacon entities in the data stage and switching between them as needed once in game.

If there's a better way that you're using here, that could be quite useful.

uneven saddle
unique lantern
#

Ah, gotchya

shadow ermine
#

I've also toyed around with inserting modules into beacons (https://mods.factorio.com/mod/promethium-crafting-rework). I do even have more plans involving this mechanic. I'm skimming through the source code for the beacon interface, and I don't see how you're doing it? I am always looking for ways to improve how I do it

uneven saddle
shadow ermine
uneven saddle
#

yeah 16 per effect

#

that way i can make up any combination under the sun

shadow ermine
#

Seems to be a lot more clever than how I did it. I also did it in powers of 10 rather than binary. I think binary would be easier to do, but powers of 10 definitely do allow the inventory to remain small greatly reducing time needed to insert? Awesome to see

uneven saddle
#

i wouldn't really be worried about insertion speed

shadow ermine
#

Let me reword that: the performance impact of accessing a beacons inventory and inserting/removing modules with several thousand slots vs just a few.

uneven saddle
#

for each effect i only need 16 slots in a beacon

#

15 if you're only going positive

shadow ermine
#

Oh true, yeah that's much smarter lol

uneven saddle
#

how many slots does yours have?

shadow ermine
#

400 lmao. The performance is actually not bad, but I have definitely seen that there is room for improvement. I knowingly didn't put as much effort into that optimization as I could

uneven saddle
#

damn that's a lot trianglepupper

shadow ermine
#

Hey it started off as like 32767 or something, and the only module I had was a prod mod that adds +1%.

I knew I would be optimizing that, and just wanted to get it functional but maaaan it was laggy

uneven saddle
#

๐Ÿคฃ

#

the joys of the prototyping stage

#

interesting mod though ๐Ÿ˜‡

#

ps, the beacon interface mod also has an api in case you want to use it directly, but i can understand your desire to tinker with your own setup ๐Ÿ˜‹

shadow ermine
#

I will definitely draw inspiration (the binary modules is genius) but yes tinkering will be great to expand my skills. Being self taught I know I have a lot to learn still ๐Ÿ˜

uneven saddle
#

fully understandable

shadow ermine
#

I do learn best from example though, so this is awesome

uneven saddle
#

let me know if you're running into issues or wondering why i did things a certain way

shadow ermine
#

๐Ÿซก Will do, I appreciate the offer

uneven saddle
#

authorized to ping ๐Ÿ””

hexed anchor
#

have you stress tested this mod for performance?

#

im thinking of running similar types of effects for a different mod, not quite fully controlled beacons but still having variable effects

shadow ermine
#

Not OP but I have been working on a mod that involves updating modules in a beacons inventory (with possibly hundreds of beacons) every 15 ticks. I implimented Quezlers way of doing the effects, and with 100 beacons updating each quarter of a second (without any extra optimizations) it uses about 0.02ms

shadow ermine
hexed anchor
#

๐Ÿค”

#

thats not bad

shadow ermine
#

And I could slow it down further if I wanted, and impliment staggered updating but it feels pretty unnecessary as it stands. Even have another idea I could do if I felt like it

hexed anchor
#

how involved are your effects? like tens of modules per beacon or just a couple?

shadow ermine
#

The main bottleneck seems to be the range of the effect strength. If your range is only like +200% of something, then that requires very few modules, but if it's 30000%, that involves a couple more

#

Quezler does it by generating modules where the effects scale by powers of 2, effectively using binary in modules lol. I don't have any negative effects so I only use 15 modules max myself, but a 16th could be used to make it all negative

hexed anchor
#

do you use multiple effects per beacon or just one type?

shadow ermine
#

For my use case I just put the effects onto one module, but if I wanted fine control over each individual effect it would probably require another beacon or more inventory slots, whichever is least laggy

hexed anchor
#

aight, thanks

shadow ermine
#

Np!

uneven saddle