Page 1 of 1

[Request/Idea] Population Mod

Posted: Sat Sep 23, 2017 11:30 am
by doppelEben
oops; think I took the wrong board; if a mod can switch the post to the right; would be nice
Just started another playthrough last night with Bob & Angel overhaul on 0.15; and had some thought about a new mod.

But to be honest, I dont really know if its actually possible to creat a mod like this; so I just share the Idea here; maybe some1 is willing to create something like this; or could lend me a hand or seven, if I would start create a mod.

I thought about a "population mod". Every Building has a defined amount of "people" working in it. Sciencecenter adds like +10 Population, a Boiler +3 and an assembler +15 or something like this.
Then it would need some more Buildings; like baracks; so one must have enought Space for all the workers in his big Facility (denie or deactivate new workplaces until there are enough beds in baracks)
Communitybuildings like a Taverne Sportcenter, Church, whatever, for pushing the will to work because "they" are more happy.
And at least a new line of products; producing food / drinkable water. Like the Greenhouse / Waterpump. If food or drinks are 0, the population begins to decrease until whole facility stands still.

In my eye there isnt a need of new graphics and ppl walking through the facility. Its just that I like the mechanism overall it would give to the whole thing.

Is something like this even possible in a mod? Or would that be a too big overhaul and is far over the top of the mod possibilities?
What are your thoughts about something like this? Yay or nay?

/discuss

Re: [Request/Idea] Population Mod

Posted: Sat Sep 23, 2017 9:02 pm
by Adil
Without the graphics or people movement simulations it is simplistic to the point of triviality:
Unverified code example
The last thing to do is to declare the new buildings prototypes and to fill out their consumption/yield table.
But without the visualization and without the calculation of population distribution in space that mechanic degrades to a simple equivalent of some building cap.

In general, you can implement pretty much any mechanic you want, lua inside the factorio is as turing-complete as any other language. The problems start when you need to express that mechanic through means of the factorio api and want to do that efficiently. (The code above would become notably more convoluted if I'd tried to remove not very efficient cycle from `recalculate_state`.)

Re: [Request/Idea] Population Mod

Posted: Sat Sep 23, 2017 10:43 pm
by foodfactorio
hi, this sounds interesting :)

without wishing to pinch your thread, id just like to post a link to a mod idea i posted some time ago that could maybe be related in some way (at least for the prestige part) which was a Colony mod idea:
viewtopic.php?f=33&t=50256

(its also cool that you got a quick reply with some possible code :) maybe Adil if you have a spare few moments you could have a quick look there too, just to see if something on the colony mod idea is feasible or possible in some way? :) and maybe a future mod could possibly utilise some elements of each to make up a nice complimentary mod of some sort? :D

Re: [Request/Idea] Population Mod

Posted: Fri Sep 29, 2017 7:39 am
by doppelEben
Wow! Thanks for the response and the code-snipped. Very appreciate it. I'm looking through it and try to tinker something like I thought.