joffrey-bion / idle-planet-miner-helper

MIT License
3 stars 0 forks source link

Information for running #5

Open mondsen opened 2 months ago

mondsen commented 2 months ago

Hi, I was able to build this and was using the run command, to execute this. It startet computing the best way for investment but hung at about task 69 where I got exceptions (Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "DefaultDispatcher-worker-2").

My main question: how to I configure input settings correctly?

PhilippeCaira commented 2 months ago

Hello, I wanted to test the project myself, starting from scratch (no planets, no tech) the program works well. However, if I try to reproduce my current galaxy, or even more simply the first 5 planets, it works, but as soon as the program reaches the telescope stage my cpu and ram are at 100%. When I say that the program works well, I notice that the first 70 steps (with 5 in depth) go pretty fast, but after that, the execution time for each step takes longer and longer.

joffrey-bion commented 2 months ago

Hi folks! Thanks for the sudden interest for this project :) I haven't worked on this for quite a while, especially the part searching for optimal actions.

I guess the search is exponential and thus will slow down drastically when trying to go very far. One possible way to improve this is to reduce the depth of the search (IIRC), which means you might get less optimal actions, but faster. The more you progress in a given galaxy run, the more options are available, and this is why the search explodes. Usually, you would reset and cash in the prestige rather quickly, though (it's more optimal than keeping going).

That said, there are definitely some things that could be improved in the implementation (I had left some TODOs here and there with potential improvements).

@mondsen at the moment, the current galaxy state is hardcoded in the main function: https://github.com/joffrey-bion/idle-planet-miner-helper/blob/cfe1229a855593a6d8e356cb2d59014c625fde86/src/main/kotlin/org/hildan/ipm/helper/Main.kt#L20

You can change this to match your current galaxy state, especially the prestige-related things.

PhilippeCaira commented 2 months ago

I can see that by modifying searchDepth to 3 and indicating the whole of my current galaxy, the program manages to work. I'm going to study the program, I don't master kotlin, but I've already used it so I might be able to help a little.

I'm puzzled, I've entered all the data for my galaxy, and the program suggests that I increase the cargo and ship levels of all my planets, even though these planets have sufficient cargo & ship levels for the stock on the planet to be at 0 at each transfer. I've made sure that my research projects and rooms are correctly indicated.

Maybe it's linked to the way I've encoded my planets and the galaxy bonus won't be correctly applied?

I've adapted PlanetState by adding the default value val galaxyBonuses: GalaxyBonuses = GalaxyBonuses(GalaxyBonuses.NONE) (NONE value defined in object companion, copy from tests).
I determined that I could do this since Galaxy.withPlanets (in Input.kt) function copied properties while ignoring any bonuses.

What I don't understand is that when I do a println(input.galaxy), the production stats indicated by the program are exactly what I find in my game.