Factorio Simulation
Posted: Fri Sep 18, 2020 4:35 pm
Hello there!
I wanted to ask, whether someone knows a good lua to json transformer of factorio's data.
Why I am asking: We have a programming lecture. Until last year the project was to simulate and then optimize StarCraft2. Students had to do a forward simulation of the game. Basically the simulation answers the question: How long does it take to build, for example, SCV, Barrack, SupplyDepot, Marine, Marine, Marine.
So given things to build the simulator should tell you how long does it take.
The optimization would answer a different question: What is the best buildorder to create 3 Marines. Or in 5 minutes of simulation time, produce as many marines as possible.
The students really like this project. However the techtree of starcraft2 is not deep enough, thus the optimization algorithm is not very hard to create.
Factorio's techtree is more complicated, thus we had the idea to switch to Factorio instead. Besides, it is a better topic for CS students anyway.
For the simulation, I need certain data. What does the creation of a thing cost, and how long does it take. Or in case of the raw materials (stone, iron, copper, coal,...) how often are they produced by the miners. I have peaked into the folders of factorio, and found under "Factorio/data/base/prototypes/recipe" most of the information.
It is all lua code, I'd like to be it in json. I have found online some parsers, however, they seem to be quite old and out of date?
Furthermore I'd like to hear some inside of what makes sense to simulate.
In the case of StarCraft we don't consider a lot of things. For example geometry (we don't care where we build the buildings, we just build them).
In the case of factorio we will have to do simplifications as well.
Geometry is the first candidate which we will ignore, i.e. in the beginning we don't need belts at all, things will just go from one place to another instantly, we don't care about water, or where the actuall resources would be.
The player itself will be also probably heavily abstracted.
There will be no aliens.
Yes, there are lots of questions regarding this project. First and foremost I need to look into the data and find out, what am I missing.
I wanted to ask, whether someone knows a good lua to json transformer of factorio's data.
Why I am asking: We have a programming lecture. Until last year the project was to simulate and then optimize StarCraft2. Students had to do a forward simulation of the game. Basically the simulation answers the question: How long does it take to build, for example, SCV, Barrack, SupplyDepot, Marine, Marine, Marine.
So given things to build the simulator should tell you how long does it take.
The optimization would answer a different question: What is the best buildorder to create 3 Marines. Or in 5 minutes of simulation time, produce as many marines as possible.
The students really like this project. However the techtree of starcraft2 is not deep enough, thus the optimization algorithm is not very hard to create.
Factorio's techtree is more complicated, thus we had the idea to switch to Factorio instead. Besides, it is a better topic for CS students anyway.
For the simulation, I need certain data. What does the creation of a thing cost, and how long does it take. Or in case of the raw materials (stone, iron, copper, coal,...) how often are they produced by the miners. I have peaked into the folders of factorio, and found under "Factorio/data/base/prototypes/recipe" most of the information.
It is all lua code, I'd like to be it in json. I have found online some parsers, however, they seem to be quite old and out of date?
Furthermore I'd like to hear some inside of what makes sense to simulate.
In the case of StarCraft we don't consider a lot of things. For example geometry (we don't care where we build the buildings, we just build them).
In the case of factorio we will have to do simplifications as well.
Geometry is the first candidate which we will ignore, i.e. in the beginning we don't need belts at all, things will just go from one place to another instantly, we don't care about water, or where the actuall resources would be.
The player itself will be also probably heavily abstracted.
There will be no aliens.
Yes, there are lots of questions regarding this project. First and foremost I need to look into the data and find out, what am I missing.