Optimization idea: abstraction

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5283
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Optimization idea: abstraction

Post by Klonan »

eradicator wrote: Wed Mar 11, 2020 2:47 pm I have a very faint memory of @Rseding mentioning he actually did that once and decided it was too overpowered to release to the public. (faint == possibly false)
False memory, but close

Its a really complex item, he/we still would like to have it in the game, but other things have taken our focus for the last while
Nemo4809
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Thu Jan 16, 2020 10:49 am
Contact:

Re: Optimization idea: abstraction

Post by Nemo4809 »

eradicator wrote: Wed Mar 11, 2020 2:47 pm @Nemo4809
@StephenLynx

I think you're (willingly?) ignoring the visual aspect. Currently all the animations of belts, inserters, etc represent the exact state of the factory. So if you want to "abstract" then the exact state doesn't exist anymore and thus can not be visualized. It's a classical "keep the cake or eat it" problem.

So even if you give the player the ability to create strictly defined closed systems that stop all work when anything goes wrong, then you're basically talking about a very large but singular assembling machine in all aspects except for how difficult it is to build. Thus the blackbox would actually be pitch black.
I'm fine with it having no visual - maybe a greyscale static image of the "insides" (like what you see in the blueprint preview) so players will know what each abstract factory does; this also means it will take up the same space as what it's replacing.

As for difficulty of building ... it's the same as using a blueprint IMHO. You still have to design the thing to produce the products you want. Its efficiency will still be measured via the initial simulation. Also just make it so it cost you the same components to put down as if you placed it by hand in a "native implementation".

With all its restriction, it will probably be slightly less efficient throughput-wise vs using a "native implementation" but it can be an option for megabase building players - where by choosing to use an abstract factory they are deciding to sacrifice throughput for the meta-benefit of higher UPS.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Optimization idea: abstraction

Post by Deadlock989 »

So it won't work when there isn't fully compressed unvarying flow, it won't work when there's fluctuating power, and it won't work when you use your meat eyeballs to look at it on the screen, and furthermore it will take extra CPU time to unbundle hundreds of these "optimisations" every time you change zoom level or move around your factory or there's a one inch gap in a belt somewhere because a biter coughed.

When will it actually work to any benefit? With the game running on a headless server with no players attached?
StephenLynx
Inserter
Inserter
Posts: 31
Joined: Thu May 04, 2017 10:55 pm
Contact:

Re: Optimization idea: abstraction

Post by StephenLynx »

Deadlock989 wrote: Wed Mar 11, 2020 3:35 pm When will it actually work to any benefit? With the game running on a headless server with no players attached?
First of all, I don't think it would need full belts to work. Second, most of bases that start to choke on UPS run at full power all the time and players can easily plop down as much power as they want at that point. Third, these same large bases will only have a fraction of their structure near players. Fourth: the abstraction data can be easily cached. So after the initial processing it would be trivial to restart and stop the simulation. And unless the player changes something relevant to the area, the cache can be kept.

PS: specially for single player, you will always have one player looking at one place at a time. And zoom shouldn't matter if you only abstract things really far from the camera.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Optimization idea: abstraction

Post by eradicator »

StephenLynx wrote: Wed Mar 11, 2020 2:58 pm
eradicator wrote: Wed Mar 11, 2020 2:47 pm I think you're (willingly?) ignoring the visual aspect. Currently all the animations of belts, inserters, etc represent the exact state of the factory. So if you want to "abstract" then the exact state doesn't exist anymore and thus can not be visualized. It's a classical "keep the cake or eat it" problem.
I am not. I have stated before that when you have to show the abstracted area, the game should stop abstracting and organize the buffered items inside the area.
Sorry, must have misremembered who said that. But as i (and other people) have stated before: switching in and out of the emulation state for a large amount of entities would be too costly to do it on-the-fly just because somebody looks at it. As the whole concept hinges on it being "one" thing you can't "partially unemulate" it either, so you're stuck with either lag spikes or limiting the allowed size of emulated areas.
______
Klonan wrote: Wed Mar 11, 2020 3:08 pm
eradicator wrote: Wed Mar 11, 2020 2:47 pm I have a very faint memory of @Rseding mentioning he actually did that once and decided it was too overpowered to release to the public. (faint == possibly false)
False memory, but close

Its a really complex item, he/we still would like to have it in the game, but other things have taken our focus for the last while
All hope is not list then! :D
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
StephenLynx
Inserter
Inserter
Posts: 31
Joined: Thu May 04, 2017 10:55 pm
Contact:

Re: Optimization idea: abstraction

Post by StephenLynx »

eradicator wrote: Wed Mar 11, 2020 6:14 pm As the whole concept hinges on it being "one" thing you can't "partially unemulate" it either, so you're stuck with either lag spikes or limiting the allowed size of emulated areas.
______
I have to disagree on that. Once you have a cached model for the area, stoping it's simulation is more or less as costly as a single UPS cycle. The game is already able to run one cycle for all those entities and the items they are handling 60 times per second. Why do you think it's that hard to start and stop the simulation once you know what's supposed to be simulated? Besides, how often you have to start and stop simulations depends on what metric the game uses to do so. It's not hard to apply a similar logic to the one mmos use to show and hide players to each other.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Optimization idea: abstraction

Post by Deadlock989 »

I mean, clearly it's a doddle and well worth the time spent on it.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Optimization idea: abstraction

Post by eradicator »

StephenLynx wrote: Wed Mar 11, 2020 11:00 pm
eradicator wrote: Wed Mar 11, 2020 6:14 pm As the whole concept hinges on it being "one" thing you can't "partially unemulate" it either, so you're stuck with either lag spikes or limiting the allowed size of emulated areas.
______
I have to disagree on that. Once you have a cached model for the area, stoping it's simulation is more or less as costly as a single UPS cycle. The game is already able to run one cycle for all those entities and the items they are handling 60 times per second. Why do you think it's that hard to start and stop the simulation once you know what's supposed to be simulated? Besides, how often you have to start and stop simulations depends on what metric the game uses to do so. It's not hard to apply a similar logic to the one mmos use to show and hide players to each other.
I don't get the MMO comparison. There's nothing emulated there, the server does not abridge any calculations, it merely doesn't show you all the results. In factorio "unemulating" would require you to calculate the state of all machines from 0 instead of iteratively like it is done in a normal game, which is more expensive (very simplistic: i=i+1 vs i=n*m where n and m also have to be calculated first).
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
StephenLynx
Inserter
Inserter
Posts: 31
Joined: Thu May 04, 2017 10:55 pm
Contact:

Re: Optimization idea: abstraction

Post by StephenLynx »

eradicator wrote: Thu Mar 12, 2020 9:48 am I don't get the MMO comparison.
You completely missed the point. MMOs have to choose when to hide and show other players. It would be impossible to tell every player in the world where every other player is. So they have a method of loading and unloading players around you as you move. Change loading players by abstracting areas.

PS: no, it wouldn't have to simulate literally everything when it would stop simulating. It could infer the state from where the abstraction currently is. How many materials are bufferd? How many produced items are buffered? And so on. By knowing how fast the area produces item and how long it takes for items to start coming out from the area, it would be perfectly possible to quickly arrange items inside the abstracted area in a place that wouldn't affect production at all.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Optimization idea: abstraction

Post by eradicator »

StephenLynx wrote: Thu Mar 12, 2020 12:34 pm
eradicator wrote: Thu Mar 12, 2020 9:48 am I don't get the MMO comparison.
You completely missed the point. MMOs have to choose when to hide and show other players.
No you did. Hiding a bit of graphics that has no effect on anything isn't difficult. The client doesn't do any game-state relevant calculations. And hiding players on the client doesn't stop them from being calculated on the server. Anyway, the old rule still stands: if you thinks it's oh-so-easy to do write a mod to demonstrate. Or post other evidence. You're "because i say so" attitude doesn't make for an interesting discussion beyond this.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
StephenLynx
Inserter
Inserter
Posts: 31
Joined: Thu May 04, 2017 10:55 pm
Contact:

Re: Optimization idea: abstraction

Post by StephenLynx »

eradicator wrote: Thu Mar 12, 2020 1:58 pm No you did.
If you can't see where you were wrong even after I explained it, there is no way to argue with you. Your text comprehension is severely lacking. The FIRST part of the issue is figuring what must be put in which state. The SECOND part of the issue is what to do when it switch states. MMOs have to do the same thing for the FIRST part or the issue, but not the SECOND part of the issue. Do you understand that now? Do I have to draw it for you?

Also, point out where I said it was trivial. I opened saying that it would be challenging. My whole point is that it's POSSIBLE.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5283
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Optimization idea: abstraction

Post by Klonan »

StephenLynx wrote: Thu Mar 12, 2020 2:04 pm My whole point is that it's POSSIBLE.
Well yea, its programming, anything is possible.

But its not practical.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Optimization idea: abstraction

Post by eradicator »

StephenLynx wrote: Thu Mar 12, 2020 2:04 pm If you can't see where you were wrong even after I explained it, there is no way to argue with you. Your text comprehension is severely lacking.
Funny. I feel exactly the same about you.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
netmand
Filter Inserter
Filter Inserter
Posts: 302
Joined: Wed Feb 22, 2017 1:20 am
Contact:

Re: Optimization idea: abstraction

Post by netmand »

Abstraction. I guess this popped up on the Programmer's word of the day calendar...
What's next? machine learning?

Do you really mean you want them to abstract the game more? No Thanks. There's a cadre of players that will rebel if the game is made any simpler.
StephenLynx
Inserter
Inserter
Posts: 31
Joined: Thu May 04, 2017 10:55 pm
Contact:

Re: Optimization idea: abstraction

Post by StephenLynx »

netmand wrote: Thu Mar 12, 2020 3:50 pm There's a cadre of players that will rebel if the game is made any simpler.
You should read the thread. I opened by saying this wouldn't change anything at all as far as features or mechanics go.
netmand
Filter Inserter
Filter Inserter
Posts: 302
Joined: Wed Feb 22, 2017 1:20 am
Contact:

Re: Optimization idea: abstraction

Post by netmand »

StephenLynx wrote: Sat Mar 07, 2020 1:08 am Only calculate what's coming in the area and how much it should come out.
Maybe you should re-read your own original post. Are you really calling this not a change and not a simplification?
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Optimization idea: abstraction

Post by Deadlock989 »

Blockchain. Add some blockchain.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Optimization idea: abstraction

Post by darkfrei »

netmand wrote: Thu Mar 12, 2020 4:21 pm
StephenLynx wrote: Sat Mar 07, 2020 1:08 am Only calculate what's coming in the area and how much it should come out.
Maybe you should re-read your own original post. Are you really calling this not a change and not a simplification?
The endplayer cannot see any difference, just the production will be precise only near the player, all another stuff just as middle/nominal production speed. Is it really easy?
netmand
Filter Inserter
Filter Inserter
Posts: 302
Joined: Wed Feb 22, 2017 1:20 am
Contact:

Re: Optimization idea: abstraction

Post by netmand »

I'm trying to derive some value out of this. While I don't think abstraction in-of-itself is a good idea, The thought of combining large parts of the factory has some appeal.

I just can't think of a way where this helps UPC. To me this sort of ask will hurt UPC and require more processing power.
Nemo4809
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Thu Jan 16, 2020 10:49 am
Contact:

Re: Optimization idea: abstraction

Post by Nemo4809 »

netmand wrote: Thu Mar 12, 2020 6:33 pm I'm trying to derive some value out of this. While I don't think abstraction in-of-itself is a good idea, The thought of combining large parts of the factory has some appeal.

I just can't think of a way where this helps UPC. To me this sort of ask will hurt UPC and require more processing power.
It depends on how it’s done. If we use the black box model, you can save a lot of UPS.
Post Reply

Return to “Ideas and Suggestions”