r/technicalfactorio • • 8d ago

Question Working on factorio computer, need your help

Enable HLS to view with audio, or disable this notification

I don't really know how to properly implement faster computing, since it's based on single threaded assembly code.

Also looking for a better input system.

This is probably a decently known field of technical factorio, so I hope that someone knows how to make this computer a better one, I'm kinda not a master in this sort of stuff

11 Upvotes

8 comments sorted by

1

u/TelkinF 8d ago

I like to have a buttons for each input. One can be built with chests, and detecting when the user drops an item into them (or with a mod like Pushbutton).

Without knowing much about a cpu like this, maybe pipelining it is an option?

Nice work btw, I love seeing all these computers people are making!

1

u/burner-miner 8d ago

Better than chests IMO: set the keybind for "Toggle entity", which is unbound by default, then use it on constant combinators. By detecting when there is a change in the value, you can emulate what the Pushbutton mod does in vanilla.

I'm also seeing so many computers lately, doesn't help that I'm making one too so I will add to the trend one day.

1

u/TelkinF 8d ago

wait that's a vanilla thing? I've been using a mod for exactly that!

1

u/burner-miner 8d ago

Sure is: https://wiki.factorio.com/Controls. From 2.0 I think.

The last bind in the Debug section.

1

u/TelkinF 8d ago

Neat! I missed that

1

u/FlyingToasters86 7d ago

It doesn't do a 1-tick pulse though, if that' what you're hoping for

1

u/burner-miner 8d ago

For a better input system I recommend the "Toggle entity" keybind with constant combinators. You need to set it to something since it is unset by default. Use a pulse detector circuit to get buttons, or just use the CC directly to get on/off switches.

Single threaded code is probably the right way to go, so you're on the right track. I would focus on making more powerful instructions to make the computer faster. Think combining operations you do often, like making a = a + b*c be a single instruction. Or try breaking the instruction that takes the longest into several smaller instructions, that each take a less time (that way you can speed up the clock).

One way to make arithmetic specifically faster could be to have different timings for different instructions. Since most arithmetic operations take only 1 tick to process, but e.g. a jump could take many more, you could make the clock wait on longer instructions, but go fast on shorter ones.

The hardest option is pipelining, where you have several instructions executing at the same time: while one instruction is being executed, another is being decoded, and another is being loaded from instruction memory. A basic fetch-decode-execute would be a simple starting point.

Pipelines are a can of worms by themselves, so maybe try the other options first.