JonathanSafer / screeps

Screeps AI
MIT License
25 stars 7 forks source link

newMove foresight #124

Closed JonathanSafer closed 4 years ago

JonathanSafer commented 4 years ago

At the moment, newMove operates by simply moving to the nearest exit to the next room on the route. This will generally be less efficient motion-wise because the creep will not necessarily take fastest path to it's overall destination.

At the cost of cpu, it might be useful to allow the pathfinder to target a little farther ahead in the path.

CAUTION: if we give creeps the option to move to rooms NOT on the designated route, they may get stuck on exits due to the vision inconsistencies.

JonathanSafer commented 4 years ago
Screen Shot 2020-03-24 at 6 48 52 PM

Green = preferred route Red = route taken

JonathanSafer commented 4 years ago

This is also a side effect of making highways cost half as much as regular rooms in findRoute. backRoadPenalty decreased to 1.5 accordingly.

jordansafer commented 4 years ago

how about making it scan 2 rooms instead of 1? (total of 5, NSEW and current)

JonathanSafer commented 4 years ago

Read the caution statement. Specifically wrt novice walls and other structures that can inhibit motion but require room vision

JonathanSafer commented 4 years ago

we could have a function in getPath that can extrapolate novice walls to the center of neighboring rooms, based off of which exit tiles in the creep's room have walls on them

jordansafer commented 4 years ago

we can tell if a room has novice walls based on whether it is next to a novice room

JonathanSafer commented 4 years ago

Rooms neighboring creep’s room now get novice walls written in, so we should be able to open up pathfinding to rooms not on the route

JonathanSafer commented 4 years ago

The exception here would be that opposing players could still mess stuff up by making their own walls, but that adds so many edge cases it would be easier to treat that as a military problem.

That being said, when we do get around to assigning players threat levels, players who like to make lots of walls in their rooms should be a higher threat level

JonathanSafer commented 4 years ago

portal bug is caused by this, so I'll leave this issue open until we can confirm that the portal issue is solved #136