fCPU


Factorio Customizable Processing Unit. Allow to write any logic on low level machine code. The fCPU acts like a programmable microcontroller with a vector coprocessor that supports many useful instructions.

Content
22 days ago
0.18 - 2.0
10.2K
Logistic network Circuit network

g fCPU - Lua Support

5 months ago

I really like your mod, the simplicity and all the features it has.
I never tried learning low level machine code, seems daunting, those high level languages are obviously much easier.

So I have to ask:
Are there any plans to create a "fCPU - Lua"?

I know there already mods for that, but they are broken/unmaintained or does not work in multiplayer.
There is nothing wrong with machine code or your mod, I think writing assembly is like a super power.
But at the same time I think you understand as well why some people moved from assembly to code in other languages.

I suggest Lua cause it might help bring people to the factorio moding community.

I understand that it might be really troublesome to implement this, but what can I do besides suggesting.

I hope that finds you well.

3 months ago

If you can read and write lua, you can read and write assembly. By its very nature it is way more simplistic than a higher level language and thus its very easy to pick up, even without much in the way of learning material.

You should give it an honest try before suggesting they implement something far more complex. You might be surprised at what you are capable of.

Registers are roughly equivalent to variables, "functions" are kinda like labeled lines where you set some registers before jumping to the label to pass in variables to the "function", etc. From there, you just have simple ops like mov, add, sub, and so on that work on the "variables" in the registers to make things happen. Its honestly very simple.

Making large programs is hard in asm, thats why higher level languages were made. But with that came a lot more to learn, lots of language complexity, and so on that asm doesn't have. Given this is 1 tick per line executed and 256 lines max, you will only ever be writing tiny things with this. You wont be recreating Sandstorm or Doom or whatever with this.

a month ago

"if you can read and write Lua you can read an write asm" well I guess anything is possible if you learn it. If you can run a mile, you can run a marathon, does that means cars shouldn't exist?

Sparky, It's not easy to know how difficult it is to implement something like this since I'm not a moder or know anything about factorio moding. I would never suggest something difficult if I knew that beforehand.

That said, I think it's totally valid to make "an honest try" on asm, thank you for that, I really get your point of view. I agree with what you said, but none of that invalidates my argument, there is a place for a "fCPU - Lua". Maybe it's not what the author want, and I'm ok with that. I hope it's not difficult though.

I hope you are writing this with good intent and not on a ill manner. I just made a suggestion of things there are outside my comprehension at the moment. It wouldn't be nice to like, condemn people for talking about mod suggestions.

25 days ago

It would have to be balanced though. Like tokenize and then increase the power usage based on the tokens. Or just a simple power usage based on script length.

It would be nice to see a lua scripting mod with a nice interface for a change though. There used to be one but it's drastically out of date. Speaking of out of date, fCPU needs a version bump to 2.0 otherwise we can't use it anymore.

New response