Schoolie440 / ScreepsCoop

Brian, Joe, and Ben's Coop Screeps Repo
0 stars 1 forks source link

Room Capture! #6

Closed Schoolie440 closed 5 years ago

Schoolie440 commented 5 years ago

We just hit GCL 2, and it would be great to capture a room. In the past, I kinda brute forced this with a lot of variable manipulation and console control, and a little bit of automation. It would be great if we could make our first room capture this time happen autonomously just so we know we can.

schoolie commented 5 years ago

Not sure how much you've done to investigate this, but these two roles were what I was working on to get this working:

https://github.com/schoolie/screeps_ai/blob/master/role.observer.js https://github.com/schoolie/screeps_ai/blob/master/role.claimer.js

Here's how I think I was trying to structure the logic:

role.observer.shouldSpawn compares the number of spawns in the game with the GCL, and starts spawning 'observers' if they don't match.

The observer's only job is to go sit in the middle of the next room we want to claim (currently hardcoded as 7, but there could easily be logic applied there). I remember having trouble figuring out how to get "visibility" into a room, so this was my way around that.

After the observer is spawned, I then spawn the 'claimer.' His job is to go to the same room as the observer and 'claim' the controller.

It's very likely possible to combine the two roles, but I seem to remember the claimer is expensive and slow, and I got sick of losing them on the way to the new room, or something like that.

Once the room is claimed, both roles become builders, which reverts to upgraders when there's nothing to build.

I had also begun (finished?) structuring my spawn logic to be room independent, so as soon as a new spawn is claimed, it just starts pumping out creeps according to the rules defined for the other room.

schoolie commented 5 years ago

Also, this is a place where we should really get a private server running for testing. Want to set that up again?

Schoolie440 commented 5 years ago

I'll take a look at the code. I'm sure I can steal some. Did you look into the "observer" structure at all?

On Tue, Aug 14, 2018, 9:57 AM Brian Schoolcraft notifications@github.com wrote:

Also, this is a place where we should really get a private server running for testing. Want to set that up again?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/schoolie3344/ScreepsCoop/issues/6#issuecomment-412880606, or mute the thread https://github.com/notifications/unsubscribe-auth/AGh19GM47SvZkwcmnrFQjcgxUuo09G75ks5uQtc0gaJpZM4V7uge .

schoolie commented 5 years ago

Yeah, the observer structure makes things a lot easier, but you don't get it until RCL 8 I think?

Schoolie440 commented 5 years ago

Yeah, I just checked, and it is rcl 8. It also reaches up to 10 rooms away, so it could end up being how we do it exclusively. I was using the sim world to test some. Main problem is a really slow tick rate. I will get a server going when I get home and see if I can get variable tick rate set up. We might also be best off just each using a private server on our local host so we don't need to have one running all the time.

On Aug 14, 2018 12:15 PM, "Brian Schoolcraft" notifications@github.com wrote:

Yeah, the observer structure makes things a lot easier, but you don't get it until RCL 8 I think?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/schoolie3344/ScreepsCoop/issues/6#issuecomment-412928958, or mute the thread https://github.com/notifications/unsubscribe-auth/AGh19Orj9LV9WBjvNwnwZFV55wSqP8XAks5uQvehgaJpZM4V7uge .

Schoolie440 commented 5 years ago

Nice. I'm doing well with atom currently, but I will probably do some vim learning once I am rolling well. Have you gotten to look at any code yet?

On Tue, Aug 14, 2018, 12:58 PM thebestschoolie notifications@github.com wrote:

Reopened #6 https://github.com/schoolie3344/ScreepsCoop/issues/6.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/schoolie3344/ScreepsCoop/issues/6#event-1788306759, or mute the thread https://github.com/notifications/unsubscribe-auth/AGh19ILOjF8ERR6J-3sxHE2XyB2dlFOuks5uQwGkgaJpZM4V7uge .

Schoolie440 commented 5 years ago

I have a decent roomCapture setup now, that we shouldn't need to improve for a while outside of possible bug fixes