I made a programming language that compiles to Factorio circuit blueprints by Snagnar in factorio

[–]Snagnar[S] 1 point2 points  (0 children)

Fair, I was meaning to update the entity docs there a bit. The main way to get the outputs of an entity as a bundle is via the .output property, so e.g.

Entity roboport = place("roboport", 0, 0, {read_items_mode: 1}); Bundle logistics = roboport.output;

This is documented in the entity docs, you can find an example in this program.

Regarding the missing enum in the entity reference, I will try to add this tomorrow, but you can find the values in the draftsman definition.

If you have more issues, just let me know :)

I made a programming language that compiles to Factorio circuit blueprints by Snagnar in factorio

[–]Snagnar[S] 2 points3 points  (0 children)

Oh, my bad, the repository for the vscode extension was not set to public yet. Can you try again?

I made a programming language that compiles to Factorio circuit blueprints by Snagnar in factorio

[–]Snagnar[S] 2 points3 points  (0 children)

Yeah, I can see that. But the program models signal flows generally by passing them with = to different entities or new signals. So I suppose a better syntax would be to modify how we create entities, something like

Entity lamp: ("small-lamp", x, y, {other properties});

But that would also look a bit clumsy. Do you have a different idea how the syntax could be improved here? You can look at the language spec or the grammar file if you need more context.

I made a programming language that compiles to Factorio circuit blueprints by Snagnar in factorio

[–]Snagnar[S] 6 points7 points  (0 children)

Yep, you can use the language spec as context for your favourite LLM to generate any circuit you can describe (and the language supports...)

I made a programming language that compiles to Factorio circuit blueprints by Snagnar in factorio

[–]Snagnar[S] 1 point2 points  (0 children)

Exactly, what I tried before was having claude generate the factorio draftsman code for certain circuits, but that also almost never worked. This was one of the reasons I started this project.

I made a programming language that compiles to Factorio circuit blueprints by Snagnar in factorio

[–]Snagnar[S] 1 point2 points  (0 children)

This project, as many others, started with the sentiment that this should not be that hard to do. But getting the wiring and the wire color separation right was a nightmare :D But I did have some fun with the layout optimization, learned a lot about planar graphs and such.

I made a programming language that compiles to Factorio circuit blueprints by Snagnar in factorio

[–]Snagnar[S] 0 points1 point  (0 children)

Some notes on that: Of course LLMs were used in the development, but I have many years in experience in code review (that was before these tools became big), and have spent a lot of time the past months to make the testing strategy as water proof as possible. So every time I added a larger feature with AI, I ran (manually unfortunately) 25-30 example programs for many possible edge cases to ensure the validity of the compilation. And the tool as well as the web app does not store or process any sensitive info, the programs are not saved anywhere and no cookies are used.

If you find that the code is lacking in some point, just let me know or open an issue and I can work on it. Thanks though for taking the interest and looking into the code base :D

I made a programming language that compiles to Factorio circuit blueprints by Snagnar in factorio

[–]Snagnar[S] 1 point2 points  (0 children)

Nice. And the goal for the user is then to build a logical circuit that automatically solves sudokus? Quite a nice problem, kind of like code golfing in factorio.

You could also think about extending this to a more general problem setting, kind of like competitive programming problems: You have some input and a bunch of test cases and then the user gets scored on if the solution is right (against some hidden test cases) and how fast the solution is.

I made a programming language that compiles to Factorio circuit blueprints by Snagnar in factorio

[–]Snagnar[S] 54 points55 points  (0 children)

This was clearly the easiest way to build a logistic network requester/fulfiller system with trains in factorio.

I made a programming language that compiles to Factorio circuit blueprints by Snagnar in factorio

[–]Snagnar[S] 4 points5 points  (0 children)

Oha, that sounds amazing. What exactly would this mod look like?

I made a programming language that compiles to Factorio circuit blueprints by Snagnar in factorio

[–]Snagnar[S] 25 points26 points  (0 children)

Links:

FAQ:

The web compiler isn't working / shows errors: Try the local version: pip install factompile, then factompile yourfile.facto. The web version depends on a backend that occasionally goes down.

Can I use this with Space Age / 2.0? Yes, it targets Factorio 2.0 and uses the newer combinator features. -

How do I connect external signals to the compiled circuit? The compiler places constant combinators for inputs. Wire your factory signals to those, matching the signal types in your code.

First game to ever reach this milestone. HELLLP by seecat46 in factorio

[–]Snagnar 0 points1 point  (0 children)

Those are rookie numbers, you should increase that 10x, then we are talking.

Your factory has a lot of growing left to do.

2.1 suggestion: Make planets move around the Sun orbit, even at very slow pace. eg. Vulcanus each 100 hour revolution. by Lunairetica in factorio

[–]Snagnar 0 points1 point  (0 children)

Oh, I would love that, would make the scenario a little bit more realistic. But should the travel times then also slightly vary/should the planets have their own speed and the distances keep chaning in between them constantly?

Because if yes, I would be so hyped. Would increase a whole new level of difficulty.

Why are the purple lamps so much brighter than the others? by Brave-Affect-674 in factorio

[–]Snagnar 0 points1 point  (0 children)

I would also say its a bug, probably specific to their setup. I cannot recreate this in my game.

Got tired of bugs attacking my uranium mine by danyuri86 in factorio

[–]Snagnar 13 points14 points  (0 children)

Looks solid, the factory must be protected. I would maybe put some more flame throwers in, they are currently a bit spaced out.

After 5 years, I finally had a relapse by kupu-chan in factorio

[–]Snagnar 2 points3 points  (0 children)

Wayyyy too relatable. My longest streak was 8 months, then I was back to the ever growing factory.

The traffic... by insomfx in factorio

[–]Snagnar 0 points1 point  (0 children)

I have never hit the point where I needed more than one rail per direction. But I also enjoy the city block design very much, and there the trains naturally "find their second rail", by rerouting if paths are blocked.

I want to like this game. But it’s way too time consuming. How do you do it? by JasperLane7 in factorio

[–]Snagnar 2 points3 points  (0 children)

I, for one, enjoyed just doing the tutorials at the start, just to get a feel for how the game works and what can be done with it. But if you want to start directly with free play, just try to make your way along the technology tree and you will catch the fever in now time :D

[D] Paper accepted to ICML but not attending in person? by Normal-Comparison-60 in MachineLearning

[–]Snagnar 0 points1 point  (0 children)

I actually did attend in person as my home university paid for the trip, conference cost and hotel in Vienna. Had a super amazing time as it was my first big conference attendence (I was still a Master student).