Factorissimo2


Factorissimo adds factory buildings to Factorio. Place them down, walk in, build your factories inside!

Content
2 years ago
0.14 - 1.1
206K

g Does F2 eliminate UPS issues with megabases?

3 years ago
(updated 3 years ago)

It's not very clear to me, perhaps you can add this to the FAQ.

Can you use this mod to abstract factories away and move to "simulated" mode? Eg, I would like to reduce UPS consumption by turning large portions of my map into factories. After they've been 'abstracted away' do the internals to the factory still consume UPS or does it just become a large meta assembler with assumed consumption/production rates based on proven history?

I (and others) discuss this concept in this thread. https://forums.factorio.com/viewtopic.php?p=529987#p529987

3 years ago
(updated 3 years ago)

nt. Not sure how to delete.

3 years ago
(updated 3 years ago)

Factory interiors are not abstracted away, since it is a computationally very hard if not impossible problem to figure out what a factory building actually does in a way that makes computing what it does faster than literally just letting the interior exist and seeing what happens.

Using this mod for a megabase will therefore not significantly increase your UPS compared to not using it. There might be very minor improvements caused by shorter robot flight paths, but those are possibly offset by the item transfer scripts.

3 years ago
(updated 3 years ago)

Hmm, computationally hard? Perhaps the APIs are missing, but can't you just measure the inputs/outputs over time? I assumed (wrongly I guess?) that is what the ports were for.

After some configurable period, the mod can decide that's what the factory consumes and produces and turn it into a meta assembler. There might some user abuse edge cases with chests, hand feeding, etc that would have to be handled, but I'm pretty sure the APIs are there for that. For example, just empty everything when the player leaves and start counting from there.

Statistical sampling can be used to reduce CPU usage if the APIs are slow for some reason.

The mod would be rather huge and very compelling in the community if it could allow for practically unlimited megabase creation. As factorissimo fans, I'm sure you appreciate that it doesn't impact gameplay. I think the ideas of factories are cool and would might use the mod just for that, UPS issue aside.

3 years ago
(updated 3 years ago)

I see here you've responded that you don't plan on doing this - https://mods.factorio.com/mod/Factorissimo2/discussion/5f2038b92af6b75871d8f611

I'd be very interested in your insight as to the specific roadblocks to implementation. Any chance I could fork factorissimo2 for this? :) I'll try to do it as an option, so you can take a PR at some later point if you're so inclined.

Some rules around factories would probably have to be devised. For example, a factory can continue working as long as input is within a reasonable statistical range, but will stop producing if it falls out of that range. Production resumes at whatever is easiest to implement, tbh. There would be no impaired production, at least at first.

There would be some very minor loss of accuracy, but at megabase / UPS issues scale, these accuracy issues are near 0%.

I'm asking about this as my base is starting to see UPS issues, and I'd rather not resort to silly UPS optimal factory DI designs. This seems like it would be quite an elegant way to solve it. Since the code is up on github, I'll probably fork this for my personal use, but would want your permission before sharing.

Also, your specific insights on implementation would be greatly appreciated. In particular, some hints to your code where and how the changes should be done would be so very extremely helpful.

A couple of quick questions if you don't mind:

Belt.tick, that is where I would monitor and insert input/output, or is there a better place? Fluid.tick for pipes.

Is there a good api to put a surface to sleep so that it doesn't consume UPS? I couldn't see one.

I think for now, I'd probably just leave the original factory working, and you can't enter the abstracted factory dupes. Not super awesome, but good enough for the purpose here I think. Can you think of a better way of doing that? This can have the advantage of continuing monitoring of parent factory for better long term statistical accuracy.

Speaking of dupes, I don't see that in the feature list so I assume it's not currently supported. Calculating total resource cost for a factory shouldn't be too hard (iterate over surface, count all entities). Some GUI for selecting the factory would be required when placing down. Pulling the resources out of player inventory for the factory should be fine at this point. Ideally bots could place factories, but that will have to come later.

Placing / building delay would be appropriate. Other than some arbitrary progress bar, nothing is coming to me that would be quick and elegant. Any thoughts on this would be welcomed.

3 years ago
(updated 3 years ago)

So did a POC for a simple 45 per minute engine factory, code was very straightforward. Inputs/outputs match the calculator fairly close.

https://kirkmcdonald.github.io/calc.html#data=1-0-0&items=engine-unit:r:45&ignore=steel-plate

middle value is per minute

rate is now engine-unit:3.75:45:450
rate is now iron-plate:15.060505085935:180.72606103122:1807.2606103122
rate is now steel-plate:3.8117001828154:45.740402193784:457.40402193784

just added this code to belt.tick

if t1.insert_at(conn.insert_pos, {name = t, count = 1}) then
f1.remove_item{name = t, count = 1}
tslast = game.tick - (timing[t] or 0)
timing[t] = timing[t] or game.tick
sampling[t] = (sampling[t] or 0) + 1
sff = (game.tick - timing[t])/60
amps = sampling[t]/sff
ll("rate is now "..t..":"..tostring(amps5)..":"..tostring(amps60)..":"..tostring(amps*600))
if tick_count % (60 * 60 * 10) == 0 then
last_copy = shallowcopy(sampling)
sampling={}
ll("last copy")
prt(last_copy)
ll("--")
end
end
factory pics here:

https://imgur.com/a/QXiaGxA
https://imgur.com/a/OlzIvVm

the rest (duping / production) should be just a matter of calling lua apis. let me know if you see any potential blockers.

I won't have much time this week, but will play with it over time and send a PR once it's relatively polished. Cool mod. Need much bigger factory buildings though :)

would like to figure out bots and a good placement / construction experience. all suggestions on the latter appreciated

3 years ago

Suppose you build a factory building that initially contains a million iron plates and slowly lets them out through a belt. This will make the factory appear to produce iron plates from nothing. What would you do about that?

3 years ago

yeah.. this is laden with exploits.

3 years ago
(updated 3 years ago)

As I said above: "There might be some user abuse edge cases with chests, hand feeding, etc that would have to be handled, but I'm pretty sure the APIs are there for that. For example, just empty everything when the player leaves and start counting from there."

But really, when you get to megabase scale the last thing you care about are 'exploits', whatever that means when /editor is a console command away.

I't s likely you're not encountering significant UPS issues and therefore don't empathize with the value here. I have hit the upperbound and without my changes, can't expand my factory in any sane way.

I have some thoughts on creating a new mod based on my ideas. Rather than creating a new surface, I think I'll just let the player identify an area that is abstractable. Also, I think I'll only allow for cargo train / fluid wagons to be used. So, no pipes or belts.

My goal is really different from this mod. I just want a way to eliminate UPS issues.

3 years ago

if you're hitting UPS issues, then involving factorissimo2 was your first mistake. that Lua script you have there isn't free.

3 years ago
(updated 3 years ago)

Well, for my purposes it definitely is. Forking and sharing, I agree, I need to get permission.

3 years ago

no, you don't with MIT license but it damages the ecosystem to have two parallel competing implementations. you should post it on the forum thread instead.

3 years ago

Morally and ethically, getting permission is important. I'm not a lawyer, so have no clue as to the legality. Forking doesn't necessarily damage the ecosystem, but if the parent contributor is not on board, it can be messy due to miscommunication.

3 years ago
(updated 3 years ago)

Yes, that link pretty much confirms what I just said.

ptx0, I'm sensing an animosity in your posts here and in other places. I'm going to refrain for awhile replying to your comments in various settings. I hope at some point in the future we can resume dialogue.

That aside, without further input from MagmaMcFry this thread is moot. It's his mod, and it doesn't appear he wants this feature as a PR, which I can respect. Forking and sharing, probably wouldn't be optimal from a functionality POV, regardless of permission and legality.

3 years ago

i think you're confusing a rejection of your idea with a rejection of you, but it's just your idea i don't like. i don't think it's a good idea, i don't think it will help with UPS at all to have more Lua running, and it's a waste of Magma's time to review it.

3 years ago
(updated 3 years ago)

I'm not the only one who has used negative terms to describe this tension between us two -

https://forums.factorio.com/viewtopic.php?p=529863#p529863
https://forums.factorio.com/viewtopic.php?p=529899#p529899

I am beginning to agree that it is unhealthy and unnecessarily polluting the forums.

3 years ago

well you can shift the focus onto that comment which was made after you continued a mess that you refused to drop even after I said I was.

do you want to talk about the merits and problems of your idea, or do you want to dissemble and shift blame?

for what it's worth, yes, I think what you've been doing is unhealthy.

3 years ago

Fair enough point, sir. I am dropping.

New response