screeps icon indicating copy to clipboard operation
screeps copied to clipboard

Rooms reserving 1 source rooms 2 steps away instead of 2 source room with low distance sources right next door

Open Somotaw opened this issue 8 years ago • 10 comments

Maybe change to be less random and focus on scouting and reserving the closest room with 2 sources first? Ideas?

Somotaw avatar Jan 05 '17 03:01 Somotaw

image room to the top right is reserved and therefore the room won't reserve the room right below it.

Somotaw avatar Jan 05 '17 03:01 Somotaw

perhaps pathcost from sources to baseroom storage can be something we can use?

Somotaw avatar Jan 05 '17 03:01 Somotaw

Hmm... not sure which one is yours, but reservations should only happen to adjacent rooms now, adjacent to a reserved room or owned room.

ghost avatar Jan 05 '17 14:01 ghost

@WhiteHalmos I'm not sure about that. My implementation was somehow random, if a room is seen and can be reserved (too less reserved ones), it will be reserved. So there are cases where a couple of rooms away are reserved, not likely, but possible.

My current idea is a regular reservation check, especially if players near you vanish or newbie walls open up. And do if more in a BFS manner. Doesn't have any concrete ideas yet, except of BFS and regular.

TooAngel avatar Jan 05 '17 20:01 TooAngel

I added code to only reserve rooms for which all the rooms along the path must be reserved or owned: https://github.com/TooAngel/screeps/commit/a96cf48bb8b3fe218213fb6bf2b16d0f79dc0b50

ghost avatar Jan 05 '17 20:01 ghost

+1 for regular check, maybe just keep spawning scouts, they're super cheap anyways.

ghost avatar Jan 05 '17 20:01 ghost

IMHO the scouts are the pre observer solution. With observers it is different.

Thought about storing the number of sources in room memory, so that you are able to calculate the best rooms to reserve based on the info from memory.

TooAngel avatar Jan 05 '17 21:01 TooAngel

I think we should store source positions, so we can calculate full pathcost/source to determine remote mining efficiency? :)

Somotaw avatar Jan 06 '17 08:01 Somotaw

Good point, so instead of storing the number of sources we can store a list of source IDs.

The path length can be calculated by finding the route and following the cached paths from storage to ID.

TooAngel avatar Jan 06 '17 19:01 TooAngel

Yes this sounds good, adding to todo :)

Somotaw avatar Jan 07 '17 05:01 Somotaw