Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto build tunnels? #683

Open
TSStudio opened this issue Nov 6, 2022 · 5 comments
Open

Auto build tunnels? #683

TSStudio opened this issue Nov 6, 2022 · 5 comments

Comments

@TSStudio
Copy link
Contributor

TSStudio commented Nov 6, 2022

For room like this, build a tunnel is a better way to save carry creeps.
image

@TooAngel
Copy link
Owner

I read about tunnels, never used them. Would be nice to have something in the code.

@DefaultO
Copy link

DefaultO commented Jan 30, 2024

The thing about tunnels is, that they are insanely costly to maintain. Building 8 tunnels for one source isn't worth it at all.
Building roads to all your remotes can be avoided by adding twice as many move parts for each carry part from what I experienced. This can boost the economy depending on what is cheaper.

Edit: I did the math earlier. And it appears to be cheaper than what Marvin exagerrated it as.

If you repair 100 hitpoints for 1 energy per work part. And the conversion rate isn't different (I never paid attention to it). You have to repair 15000 hitpoints every 1000 ticks for a road inside a wall. You can harvest 9000 energy from one source inside a reserved or claimed room in 1000 ticks.

So if that math is correct. You earn 9000 energy in the time it takes for you to burn through 5 * 150 (= 750) energy for the roads inside the wall alone. That still is a large profit margin.

@TooAngel
Copy link
Owner

TooAngel commented Feb 5, 2024

K, thx for the insights. I guess there could be use cases where it make sense. If someone is interested in figuring these out, I think it would be a nice addition, but not mission critical :-)

@DefaultO
Copy link

DefaultO commented Feb 6, 2024

Will see if I can code that in. What would be the best way to determine the path? What factors do we want the decision to influence?

Purely energy-wise, we shouldn't built a tunnel if there would be less than 150 roads (per tunnel) to maintain otherwise.

But tunnels can save us time it takes for energy to travel back to the base! So shouldn't we have to focus on the math or rather cost of more haulers it would need to keep a remote container consistently not full? Those are the complex solutions/formulas/algorithms logistics require. Thats what makes bots efficient. And having to solve these problems is what is fun about this game.

@TooAngel
Copy link
Owner

TooAngel commented Feb 7, 2024

So, from https://docs.screeps.com/api/#StructureRoad, building costs 45k, it looses 15k per 1000 ticks, so 15 per tick - That is a lot. On plain it costs 300 to build, and 0.1 per tick. Looking at the numbers, I can't come up with many scenarios where it make sense.

Another tricky part to include it into the routing system. Right now the paths in each room are pre calculated an used by creeps when moving. So, when calculating the initial path it needs to be calculated if any tunnel would make sense.

I'm not sure if it is important that the energy arrives earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants