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

Scouts stuck when there is no way to pass a room #150

Open
ykozxy opened this issue Jun 30, 2019 · 2 comments
Open

Scouts stuck when there is no way to pass a room #150

ykozxy opened this issue Jun 30, 2019 · 2 comments

Comments

@ykozxy
Copy link

ykozxy commented Jun 30, 2019

Issue summary

Description of issue:

When scouts try to pass a room that is impassable due to obstacles, they would be stuck and hang around at the same place. Probably due to continuously recomputing the path, CPU usage skyrockets about 25% (shard 3) during the process and eventually consumes all the bucket. (I have to kill the scouts to prevent this manually)

Steps to reproduce:

The room replay: https://screeps.com/a/#!/history/shard3/E17S38?t=8174724

The issue occurs on the upper left corner of the room when the creep cannot move to the exit at the lower right of the room
Snipaste_2019-06-30_10-39-27

Error message:

// Console output:

// Offending line:

Suggested fix (optional):

Maybe scout should stop recomputing the path and exit the room (or stand still) once it finds it cannot pass the room

Other information:

  • Overmind version: 0.5.2
    • Commit hash: {optional, but helpful: include the commit hash (if known)}
@PDS-West
Copy link

PDS-West commented Nov 3, 2019

i had the same error, when i set the log level to 4 i got this:
[1:51:39 AM][shard3]DEBUG 12288587 Movement: incomplete path for [scout_4]! ([E7N19, 43, 4] ⟶ [E8N20, 25, 25])
[1:51:41 AM][shard3]DEBUG 12288588 Movement: incomplete path for [scout_0]! ([E7N19, 45, 5] ⟶ [E8N20, 25, 25])

scout error

@tamyiuchau
Copy link

tamyiuchau commented Aug 1, 2020

I have bisected the problem to

if (Game.map.isRoomAvailable(roomName)) {

which it tries to travel to a room where no path could be found.
dirty hack fix this issue(temporary), but it breaks the assumption of 2D random walk, so it might not drift away from origin and have probability to reach anywhere

            if (Game.map.isRoomAvailable(roomName) && scout.room.findExitTo(roomName)>0b&& scout.creep.moveTo(new RoomPosition(25, 20, roomName))>=0,{maxOps:100}) {

p.s. it also solve high cpu usage of scouts when no path is find

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