Mod with realistic materials behavior as a materials science learning tool

This is the place to request new mods or give ideas about what could be done.
Post Reply
s.vorotilo
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat Sep 19, 2020 7:59 am
Contact:

Mod with realistic materials behavior as a materials science learning tool

Post by s.vorotilo »

Greetings!
I've recently came across Factorio, and I think we could both strengthen its late game and make it a great learning tool in materials science by introducing material failure mechanics (wear and corrosion) and tech routes for material diagnostics and engineering to tackle the added challenges.

I have the necessary scientific competencies (Ph.D. in materials science, track record of 33 related academic publications) but don't have any experience in modding. Would anyone be interested in a collab?

With all due respect,
Stepan Vorotilo

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Mod with realistic materials behavior as a materials science learning tool

Post by darkfrei »

s.vorotilo wrote: ↑
Sat Sep 19, 2020 8:12 am
Greetings!
I've recently came across Factorio, and I think we could both strengthen its late game and make it a great learning tool in materials science by introducing material failure mechanics (wear and corrosion) and tech routes for material diagnostics and engineering to tackle the added challenges.

I have the necessary scientific competencies (Ph.D. in materials science, track record of 33 related academic publications) but don't have any experience in modding. Would anyone be interested in a collab?

With all due respect,
Stepan Vorotilo
Can you write recipes in some easy format like:

Code: Select all

{
	-- first recipe, fraction:
	{{ingredient_1},	{result_1, result_2}},
	-- or
	{{ingredient_1, amount_1},	{result_1, amount_1, result_2, amount_2}},

	-- second recipe, assembling:
	{{ingredient_1, ingredient_2},	{result_1}},
	{{ingredient_1, amount_1, ingredient_2, amount_2},	{result_1, amount_1}},

	-- third recipe, result with probabilities:
	{{ingredient_1, amount_1, ingredient_2, amount_2},	{result_1, amount_1, probability_1, result_2, amount_2, probability_2}},
}
Here ingredient and result - the name of item, for example "my-material-1";
amount - amount of ingredients or results; for example 2, 3 etc.; if no amount then amount = 1;
probability - independent chance to make this item; for example 0.5 = 50%; if no probability then probability = 1.

s.vorotilo
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat Sep 19, 2020 7:59 am
Contact:

Re: Mod with realistic materials behavior as a materials science learning tool

Post by s.vorotilo »

Yes, I can. I think the system for design of materials will complement very vell the system for materials failure, since the latter stimulates the former.

User avatar
jodokus31
Smart Inserter
Smart Inserter
Posts: 1603
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

Re: Mod with realistic materials behavior as a materials science learning tool

Post by jodokus31 »

Be sure to check out this mod:
https://mods.factorio.com/mod/xander-mod

This has more realistic recipes than anything I came across so far.

Regarding wear and corrosion, there are mods, where robots or machines break over time. I didn't ever use them, so I cannot recommend any.
EDIT: Fixed Typo
Last edited by jodokus31 on Mon Sep 21, 2020 5:35 pm, edited 2 times in total.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Mod with realistic materials behavior as a materials science learning tool

Post by eradicator »

Adding new materials is trivial. The real question is how you expect the "failure mechanics" to work, and if the engine/api is sufficient to implement that expectation (at a reasonable cpu-cost).

Also have you done a search for similar mods? From memory i know there's
One for robots: https://mods.factorio.com/mod/robot_attrition
And i thought there was one for assembling machines, but the only thing i could quickly find was the outdated https://mods.factorio.com/mod/WearAndTear
(Disclaimer: I haven't used either of them. Only read the description.)
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.

s.vorotilo
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat Sep 19, 2020 7:59 am
Contact:

Re: Mod with realistic materials behavior as a materials science learning tool

Post by s.vorotilo »

Thanks for the tip! I will check it out.
jodokus31 wrote: ↑
Mon Sep 21, 2020 4:51 pm
Be sure to check out this mod:
https://mods.factorio.com/mod/xander-mod

This has more realistic recipes than anything I came across so far.

Regarding wear and corrosion, there are mods, where robots or machines break over time. I didn't ever use them, so I cannot recommend any.
EDIT: Fixed Typo

s.vorotilo
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat Sep 19, 2020 7:59 am
Contact:

Re: Mod with realistic materials behavior as a materials science learning tool

Post by s.vorotilo »

I see it this way:

Any machine is composed of given materials and is characterized by a specific level of mechanical stress.
I want to program the durability of materials by a certain Weibull distribution, and then return randomized outcomes for the material every X ticks. If the outcome for the material is below the applied mechanical stress, the material fails. Every material failure event increases the chance that the machine will break down or progresses the machive into a new stage of wear (like in the Wear and Tear mod).
eradicator wrote: ↑
Mon Sep 21, 2020 4:53 pm
Adding new materials is trivial. The real question is how you expect the "failure mechanics" to work, and if the engine/api is sufficient to implement that expectation (at a reasonable cpu-cost).

Also have you done a search for similar mods? From memory i know there's
One for robots: https://mods.factorio.com/mod/robot_attrition
And i thought there was one for assembling machines, but the only thing i could quickly find was the outdated https://mods.factorio.com/mod/WearAndTear
(Disclaimer: I haven't used either of them. Only read the description.)

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Mod with realistic materials behavior as a materials science learning tool

Post by eradicator »

TL;DR: Shouldn't be too complicated, but'll be on the heavy side for performance penalty.
_____
s.vorotilo wrote: ↑
Sat Sep 19, 2020 8:12 am
Ph.D. in materials science,
[...] but don't have any experience in modding
But i'm guessing you have ample programming experience outside of factorio modding?
_____

Yea, as i thought. That is basically the most cpu-expensive category of mod you can make, so it'll never scale to megafactory sizes. But can probably work ok for medium sized factories, so as a learning tool it should be fine.

As far as the api goes you'll have to constantly iterate over all machines and apply your check. There's generally two ways: constant cpu-cost variable game-time, and constant game-time, variable cpu-cost. And you'll have to use the latter if it's supposd to be realistic.

Replacing machines while they're running will probably cause some slight hickups for the adjacent inserters but should otherwise be ok (but cpu-expensive).

Do you have any idea how to communicate the whole mechanic to the user/player? How should replacement/repair work? What is the expected MTBF? If you intend to introduce new materials then how many? When you say "machine" to you mean inserters, substations, and all the small stuff too? Or just assemblers/furnaces? etcpp.

Also the topic says "learning tool", so i'm guessing you care more about accuracy etc than that the mod integrates well with the existing game machanics (a.k.a. "is fun to play")? I.e. form a pure game-design pov i'd personally never let the machines break down completely, maybe a hard-limit of 20% "durability". But from a realism standpoint you can't really do that.
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.

s.vorotilo
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat Sep 19, 2020 7:59 am
Contact:

Re: Mod with realistic materials behavior as a materials science learning tool

Post by s.vorotilo »

Thanks for the clarification!
eradicator wrote: ↑
Tue Sep 22, 2020 2:20 pm
ut i'm guessing you have ample programming experience outside of factorio modding?
Unfortunately, I have almost no experience in coding except high school classes.

eradicator wrote: ↑
Tue Sep 22, 2020 2:20 pm
Yea, as i thought. That is basically the most cpu-expensive category of mod you can make, so it'll never scale to megafactory sizes. But can probably work ok for medium sized factories, so as a learning tool it should be fine.
Regarding the performance - we could use cluster computations (Clusterio mod) to make it more manageable. This will also be pretty realistic - megafactories are also divided into smaller interconnected units, so every operator will be responsible for running a single unit (factorio server).
eradicator wrote: ↑
Tue Sep 22, 2020 2:20 pm
As far as the api goes you'll have to constantly iterate over all machines and apply your check. There's generally two ways: constant cpu-cost variable game-time, and constant game-time, variable cpu-cost. And you'll have to use the latter if it's supposd to be realistic.
Replacing machines while they're running will probably cause some slight hickups for the adjacent inserters but should otherwise be ok (but cpu-expensive).
I agree that the constant game-time, variable cpu-cost is way more realistic. Also, the idea is to introduce risk in order to bolster the failure-resistance - so the users should be encouraged to build their production lines with some redundancy, so that when one machine breaks, the production flow can be redirected to back-up machines with as little hickups as possible.
eradicator wrote: ↑
Tue Sep 22, 2020 2:20 pm
Do you have any idea how to communicate the whole mechanic to the user/player? How should replacement/repair work? What is the expected MTBF? If you intend to introduce new materials then how many? When you say "machine" to you mean inserters, substations, and all the small stuff too? Or just assemblers/furnaces? etcpp.
I was thinking about doing a massive online course using this mood. "Learning Materials Science and Engineering with Factorio". Additionally, we could communicate with users using push notifications and visual cues - worn-down machinery will emit massive clouds of black smoke and accelerate pollution. To replace /repair the failed machinery, you can click on it, toggle "repair" and feed it the needed materials, or you can rebuild the machine using more advanced materials, or you can tech up to drones and automate all repairs/replacements.
The MTBF should be randomized on the basis of Weibull distributions for the used materials (weak chain statistics) so that machines built from more advanced materials would work longer. Regarding the objects - we could start from assemblers/furnaces and then introduce failure for additional systems (once the automated repairs are available and do not require attention except for resource management)
eradicator wrote: ↑
Tue Sep 22, 2020 2:20 pm
Also the topic says "learning tool", so i'm guessing you care more about accuracy etc than that the mod integrates well with the existing game machanics (a.k.a. "is fun to play")? I.e. form a pure game-design pov i'd personally never let the machines break down completely, maybe a hard-limit of 20% "durability". But from a realism standpoint you can't really do that.


Actually, I think the fun is very crucial - what's the point of a game if it's tedious? I agree with the "never break down completely" - I think about introducing performance and pollution penalties instead of stopping the machines completely. This is fairly realistic - most of the time worn-down machinery can still function, but is inefficient.

eradicator wrote: ↑
Tue Sep 22, 2020 2:20 pm
TL;DR: Shouldn't be too complicated, but'll be on the heavy side for performance penalty.
_____
s.vorotilo wrote: ↑
Sat Sep 19, 2020 8:12 am
Ph.D. in materials science,
[...] but don't have any experience in modding
But i'm guessing you have ample programming experience outside of factorio modding?
_____

Yea, as i thought. That is basically the most cpu-expensive category of mod you can make, so it'll never scale to megafactory sizes. But can probably work ok for medium sized factories, so as a learning tool it should be fine.

As far as the api goes you'll have to constantly iterate over all machines and apply your check. There's generally two ways: constant cpu-cost variable game-time, and constant game-time, variable cpu-cost. And you'll have to use the latter if it's supposd to be realistic.

Replacing machines while they're running will probably cause some slight hickups for the adjacent inserters but should otherwise be ok (but cpu-expensive).

Do you have any idea how to communicate the whole mechanic to the user/player? How should replacement/repair work? What is the expected MTBF? If you intend to introduce new materials then how many? When you say "machine" to you mean inserters, substations, and all the small stuff too? Or just assemblers/furnaces? etcpp.

Also the topic says "learning tool", so i'm guessing you care more about accuracy etc than that the mod integrates well with the existing game machanics (a.k.a. "is fun to play")? I.e. form a pure game-design pov i'd personally never let the machines break down completely, maybe a hard-limit of 20% "durability". But from a realism standpoint you can't really do that.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Mod with realistic materials behavior as a materials science learning tool

Post by darkfrei »

If you want to slow down "broken" machines, hurt the health of it, add more pollution, all this excesses must be by all buildings not simultaneously, so it's better to change the mod to "constant CPU cost", only few assembling machines will be processed in the one game tick (1/60 second).

You can check the amount of completed products till last update, calculate the chance of break and do slowing/damage hp/add pollution. Maybe add small explosion near of the assembling machine.

s.vorotilo
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat Sep 19, 2020 7:59 am
Contact:

Re: Mod with realistic materials behavior as a materials science learning tool

Post by s.vorotilo »

Thanks for the suggestions!

Post Reply

Return to β€œIdeas and Requests For Mods”