elswindle / factorio_annealer

Program to generate a layout of factory cells in Factorio using simulated annealing
MIT License
4 stars 0 forks source link

Struggling during installation process, not sure where #3

Open michaelhancock01 opened 1 year ago

michaelhancock01 commented 1 year ago

I have been trying to install this on a windows subsystem for linux, but I am constantly running into errors. I have been fiddling with some of the code to try and get it to install nicer, but I am permanently stuck right now because the routegroup will not populate with anything. Would greatly appreciate any assistance on how to install this.

elswindle commented 1 year ago

Sure, I'd love to help. Can you give me some more information? Is the initialization or populate routegroup function not working? Are the item requirements being correctly added into each partition? I'm assuming you have built the Factory object already, so are the partitions being correctly created? Are you able to draw the factory before starting the annealing process? If the factory was built properly, you should be able to run drawFactory() from the FactoryDrawer object and get an initial layout of the base similar to the one in the readme.

michaelhancock01 commented 1 year ago

Yeah of course. The routegroup object is null from all my testing. My installation process and initialization were largely jank, and I had to jerryrig a ton of code, so its likely I broke something a long the way. When I do run_game.py, it says pretty much all the blueprints are successfully added, and it says it built the factory successfully. But beyond that, I seem unable to run drawFactory(). I tried from the commandline as well to no avail. In writing this part, I went back to go check and it gets to the annealing function but I cannot seem to be observing the factory drawer at all.

Perhaps I could try and replicate how you installed it more closely since that also is likely to affect it?

Thanks for replying so quickly

michaelhancock01 commented 1 year ago

Is there anything else I can tell you that could make the issue easier to understand?

elswindle commented 1 year ago

Sorry about the delay, work is busy, but I have some time today to help debug. From what you are saying, it sounds like there's a problem populating the factory with the correct data. My print statements don't actually check anything (I have been meaning to fix that). They are just there to say that it has reached a certain point in the code. So I'd like you set a breakpoint and look at the following variables in the Factory object.

My first guess is there's something wrong with loading in data from the Factorio public repo. Maybe something is in the wrong spot. Because of this, recipe_list and item_list don't have anything in them and so there's nothing to iterate on when generating the requirements breakdown of each partition.

michaelhancock01 commented 1 year ago

Please take as much time as needed. I understand being busy, I have been very busy as well. I agree its likely some loading in error. As will do this as soon as I have some free time, and will report back what I find!