Optimization idea: abstraction
Moderator: ickputzdirwech
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Optimization idea: abstraction
One big box that feeds in ore and outputs rockets.
Wow, fun.
Wow, fun.
Re: Optimization idea: abstraction
The mod must check if the internal factory on the inside surface has the true 100% productivity. Without this flag the internal factory cannot be started at all.Deadlock989 wrote: ↑Wed Mar 11, 2020 10:16 am One big box that feeds in ore and outputs rockets.
Wow, fun.
Build compact, but effective and there is another type of game success. Yes, it can be fun.
Re: Optimization idea: abstraction
Blueprint your entire factory)Deadlock989 wrote: ↑Wed Mar 11, 2020 10:16 am One big box that feeds in ore and outputs rockets.
Wow, fun.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Optimization idea: abstraction
I'm 100% sure that similar ideas have occurred to the clever people actually working on the game over the last 7 years. As pointed out by eradicator, the colossal amount of checks you would need to perform periodically would blow any so-called "optimisation" savings this could possibly generate completely off the map. This would still be the case if it was in the C++ engine. If it was done in Lua by a mod, you might as well make Factorio into a turn-based game.
But in the highly unlikely event that you managed to finesse things so that it wasn't a monster lag-spike generator and didn't produce a torrent of fudge, in the end it would all be about reducing your factory units to their lowest common denominators. You may as well hand out a post-rocket technology that gives you a special rocket silo that produces purest Win out of raw ores, water, and crude oil - it would "simulate" the same logical conclusion.
Is it an interesting systems analysis problem? Yes, if you like that kind of thing. Would it produce any performance improvement? Hell, no. Would it make a qualitatively better game? Doesn't sound like it.
But in the highly unlikely event that you managed to finesse things so that it wasn't a monster lag-spike generator and didn't produce a torrent of fudge, in the end it would all be about reducing your factory units to their lowest common denominators. You may as well hand out a post-rocket technology that gives you a special rocket silo that produces purest Win out of raw ores, water, and crude oil - it would "simulate" the same logical conclusion.
Is it an interesting systems analysis problem? Yes, if you like that kind of thing. Would it produce any performance improvement? Hell, no. Would it make a qualitatively better game? Doesn't sound like it.
-
- Inserter
- Posts: 31
- Joined: Thu May 04, 2017 10:55 pm
- Contact:
Re: Optimization idea: abstraction
Optimization. Imagine reducing UPS usage by 90%. Suddenly megafactories don't require an extremely potent rig.
Completely missing the point. Is not about removing complexity, is about taking shortcuts to process it.Deadlock989 wrote: ↑Wed Mar 11, 2020 10:16 am One big box that feeds in ore and outputs rockets.
Wow, fun.
About the issues with discovery of endpoints, the game doesn't have to scan everything all the time. Not talking about all the people that derailed into a mod, but still about an optimization: the game can perform initial checks on inserter placement. If it takes or places stuff into a track, that's a starting point. Now check where all that stuff goes and stops until something that will not be optimized is found, like a combiner, or the end is found. Then cache that information so the area is abstracted again when the player is not looking and check it again if the optimized area is changed.
Do you remember when someone remembered them that threads existed and could be used to optimize fluid simulation? Because I do.Deadlock989 wrote: ↑Wed Mar 11, 2020 11:38 am I'm 100% sure that similar ideas have occurred to the clever people actually working on the game over the last 7 years.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Optimization idea: abstraction
No, I don't. Source please.StephenLynx wrote: ↑Wed Mar 11, 2020 11:41 am Do you remember when someone remembered them that threads existed and could be used to optimize fluid simulation? Because I do.
Re: Optimization idea: abstraction
This excuse of yours is getting kind of old. The developers maybe be smart, at least IMO, but they aren't all-knowing gods.Deadlock989 wrote: ↑Wed Mar 11, 2020 11:38 am I'm 100% sure that similar ideas have occurred to the clever people actually working on the game over the last 7 years.
These are the same guys than didn't realise the obvious optimization of offsetting the start of a buffer, a very old trick, and instead wasted precious memory bandwidth copying a texture over and over every single frame.
He also said,As pointed out by eradicator, the colossal amount of checks you would need to perform periodically would blow any so-called "optimisation" savings this could possibly generate completely off the map.
So some form of it can be done. (I believe the variant I proposed falls into that category - and it will have very little impact to game balance.)Conclusion: As darkfrei says: the most realistic solution is a factorissimo style blackbox.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Optimization idea: abstraction
I don't know if it can be done with the modding API as it currently exist - and I'm too lazy to find out.Deadlock989 wrote: ↑Wed Mar 11, 2020 12:36 pmI look forward to seeing your flawless implementation of it.
But it can definitely be done by the developers.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Optimization idea: abstraction
If you are talking about yourself, yes I agree.
PS: In before thread lock. It's inevitable at this point with people like you trying to antagonize everyone else at every turn while adding nothing to the discussion other than "no, it can't be done because I said so.". No attempt to refute the arguments proposed. Just ad hominem attacks.
-
- Inserter
- Posts: 31
- Joined: Thu May 04, 2017 10:55 pm
- Contact:
Re: Optimization idea: abstraction
I know it will sound bad, but how much experience with programming do you have outside factorio modding? Your github seems empty.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Optimization idea: abstraction
Straight from the kindergarten playground repertoire.
To summarise, you don't know if the game is capable of it, but a spitballed idea you had on the toilet will, if researched and implemented correctly by a team of professionals who know the game inside out but had a mysterious blind spot all along exactly where your penetrating insight lies, result in a massive performance increase for free.
Sure.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Optimization idea: abstraction
What, you want my CV now? Go fish.StephenLynx wrote: ↑Wed Mar 11, 2020 12:42 pm I know it will sound bad, but how much experience with programming do you have outside factorio modding? Your github seems empty.
Re: Optimization idea: abstraction
Maybe another dev will correct me if they feel otherwise,
But this is something we are not really interested in doing
accuracy and granularity of the simulation is part of what makes Factorio such a great game to me,
Everything is 'real', nothing is just 'a number decrement here, increment over here'.
Secondly, I just don't think it would work, you'd end up having to simulate everything anyway,
If power drops down a little bit, and a beacon gets turned off, you need to recalcualte the throughput speed?
What if there is circuit control or logistic control in there?
Well I can see hundreds of cases where the 'nice cheap abstraction' needs to be broken and recalculated and packaged up again.
But this is something we are not really interested in doing
accuracy and granularity of the simulation is part of what makes Factorio such a great game to me,
Everything is 'real', nothing is just 'a number decrement here, increment over here'.
Secondly, I just don't think it would work, you'd end up having to simulate everything anyway,
If power drops down a little bit, and a beacon gets turned off, you need to recalcualte the throughput speed?
What if there is circuit control or logistic control in there?
Well I can see hundreds of cases where the 'nice cheap abstraction' needs to be broken and recalculated and packaged up again.
-
- Inserter
- Posts: 31
- Joined: Thu May 04, 2017 10:55 pm
- Contact:
Re: Optimization idea: abstraction
No, I just think you might have a hard time thinking outside the box if you never did regular programming. Modding apis are a framework for doing one thing in a specific context. General programming is just you, memory and instructions. Maybe this is why you are such a negative nancy.
I suggested earlier that you can decide when to stop simulating, so you focus on the most common cases. Energy is one of those situations where people just don't keep running large factories constantly underpowered. And you can always choose how often to switch modes, so you are not switching every other second, in the case of power fluctuating between full powered and underpowered.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Optimization idea: abstraction
I think Factorissimo 2 handles the concept pretty well already. The only issue with it is the terrible performance it has, because of all the polling it has to do.
If the engine could handle containers that exist on more than one surface at once, "Ender-chest" styley - ditto storage tanks, ditto electric interfaces - then that issue could be toast. There was talk from a dev about doing it but I don't imagine it's a high priority when the push to 1.0 is on and there's no vanilla use case.
If the engine could handle containers that exist on more than one surface at once, "Ender-chest" styley - ditto storage tanks, ditto electric interfaces - then that issue could be toast. There was talk from a dev about doing it but I don't imagine it's a high priority when the push to 1.0 is on and there's no vanilla use case.
Sure, whatever, stalker.No, I just think you might have a hard time thinking outside the box if you never did regular programming
Re: Optimization idea: abstraction
That's fine.
Just error on the side of inefficiency IMHO. Insufficient power? Just stop the abstract factory dead in it's tracks.accuracy and granularity of the simulation is part of what makes Factorio such a great game to me,
Everything is 'real', nothing is just 'a number decrement here, increment over here'.
Secondly, I just don't think it would work, you'd end up having to simulate everything anyway,
If power drops down a little bit, and a beacon gets turned off, you need to recalcualte the throughput speed?
What if there is circuit control or logistic control in there?
Well I can see hundreds of cases where the 'nice cheap abstraction' needs to be broken and recalculated and packaged up again.
The only interaction with the abstract factory (from the outside world) should be the material inputs and outputs - i.e ban roboports, combinators, and of course, rails within the abstract factory - nothing else goes in or comes out.
If you restrict the material input conditions, e.g. you calculate it the characteristics (amount of ticks required and output) of the abstraction for exactly 100 iron/150 copper plates available as input, you don't have to do the simulation more than once if the abstract factory operates like an assembler and only starts work when 100 iron/150 copper plates is delivered to it and only starts the next batch after the required number of ticks (based on simulation) has passed.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Optimization idea: abstraction
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)Deadlock989 wrote: ↑Wed Mar 11, 2020 12:56 pm If the engine could handle containers that exist on more than one surface at once, "Ender-chest" styley
_____
@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.
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Inserter
- Posts: 31
- Joined: Thu May 04, 2017 10:55 pm
- Contact:
Re: Optimization idea: abstraction
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.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.