Strategies for moving electricity between surfaces?
Posted: Wed Feb 15, 2017 4:11 pm
I'm trying to make a mod which uses multiple surfaces as "floors" and I want to be able to transport things between floors. I've been using the very neat Factorissimo code as a reference for some general strategies for this and I have a working implementation for items and liquids, but electricity is proving tricky.
Factorissimo handles electricity by having the "factory" building be a roboport, which causes the game engine to charge the roboport's energy buffer, and then it reflects the state of that buffer into an accumulator inside the factory to be the energy source for machines inside the factory. This makes sense and works fine for Factorissimo because the type of the building isn't particularly important, and each building is connected to just one surface. It looks like it does the reverse for power generation buildings.
This means you have to decide a fixed "direction" that power can flow for each connection, and there's also no way to see "global" power stats since each surface has its own electric network. Are there any other strategies for transferring power between surfaces that people know of, or have been used in other mods? I suspect it's not possible in the current game engine to have this work "perfectly", but any alternative suggestions would be interesting to compare the upsides and downsides.
Factorissimo handles electricity by having the "factory" building be a roboport, which causes the game engine to charge the roboport's energy buffer, and then it reflects the state of that buffer into an accumulator inside the factory to be the energy source for machines inside the factory. This makes sense and works fine for Factorissimo because the type of the building isn't particularly important, and each building is connected to just one surface. It looks like it does the reverse for power generation buildings.
This means you have to decide a fixed "direction" that power can flow for each connection, and there's also no way to see "global" power stats since each surface has its own electric network. Are there any other strategies for transferring power between surfaces that people know of, or have been used in other mods? I suspect it's not possible in the current game engine to have this work "perfectly", but any alternative suggestions would be interesting to compare the upsides and downsides.
