this post was submitted on 30 Sep 2025
90 points (100.0% liked)
Automation and Factory Builder Games
324 readers
1 users here now
A community surrounding automation and factory games. Think Factorio or Satisfactory.
Rules
- Please stay on-topic: post about automation and factory builder games. There is some wiggle room; there always is when it comes to game genres, but some things clearly do not fit (Pong, a post asking what car you should buy in real life) and will be removed.
- Don’t be a jerk. This covers bigotry and discrimination, which includes but is not limited to homophobia, racism, sexism, etc.
- Please don’t directly link to pirated content.
- When advertising something you have worked on (think your own automation game review website, or an automation game you have worked on), please use common sense for what is spammy. If there’s about four new posts here weekly, don’t post a progress update weekly—we don’t want self-promotion overwhelming the community. But finding new automation game creators is cool, so do post them here every once in awhile! I reserve the right to change this rule to be more specific about what exactly counts as spammy and what does not, but I feel I’ll know it when I see it and trust most posters to operate in good faith.
- Please indicate spoilers. The following format works on both Lemmy and Kbin, but if you are using an app it may not. See this comment for which apps handle spoilers. Note that spoilers in post bodies will just show the text in the preview if you link the post in, say, Discord, instead of spoiling it.
Spoilers for SomeAutomationGame
Something that happened at the end of the game!
Something else that happened at the end of the game!
will appear as
Spoilers for SomeAutomationGame
Something that happened at the end of the game!
Something else that happened at the end of the game!
Not Rules
Magazine/community icon is the Apple gear emoji for now. Suggestions for a replacement are very welcome.
Other communities you may be interested in:
- !factorio@lemmy.world
- !satisfactory@lemmy.world
- !incremental_games@incremental.social
- !citybuilders@sh.itjust.works
- !tycoon@lemmy.world
founded 8 months ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Oh, I didn't know this was possible with programming. I wonder what such code would look like.
Programmer here. I only skimmed the article but this sort of scheduling is very common in multithreaded applications.
The most common I see is Thread 1 is the application start. You click game.exe and this is it. This thread does a lot of initialization and prep work.
Thread 1 then spawns thread 2,3,4,etc and hands them each a set of tasks and a callback function. For DSP it's probably a list of buildings to calculate resource generation for it seems.
Here's where I'm guessing. The array of buildings is shared memory that the main task can monitor. As a thread finishes it's assigned array, it callsback to the main thread it's completion, the main thread then quickly scans the threads for the one with the longest list over a certain length (probably to avoid overhead of splitting if there's only a few items left), takes half of it, and sends it to the idle thread, leaving half in the shared memory for the busy thread.
Rinse and repeat until all tasks are done.
The specifics of the code are going to be highly language dependent. Thread locking and instruction atomicity become real important. Hopefully that helps a little.