pot0rpan / screeps

Old WIP Screeps codebase
The Unlicense
0 stars 0 forks source link

Does not compile #2

Closed pacomms closed 3 years ago

pacomms commented 3 years ago

Wheni do rollup -c i get the folowing error

src/main.ts → dist/main.js... [!] (plugin rpt2) Error: /npm/screeps-main/src/utils/Traveler.ts(645,37): semantic error TS2344: Type 'Structure' does not satisfy the constraint 'AnyStructure'. Property 'ticksToLive' is missing in type 'Structure' but required in type 'StructureWall'. src/utils/Traveler.ts Error: /npm/screeps-main/src/utils/Traveler.ts(645,37): semantic error TS2344: Type 'Structure' does not satisfy the constraint 'AnyStructure'. Property 'ticksToLive' is missing in type 'Structure' but required in type 'StructureWall'. at error (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:151:30) at throwPluginError (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:19344:12) at Object.error (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:20013:20) at Object.error (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:19520:38) at RollupContext.error (/npm/screeps-main/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:17237:30) at /npm/screeps-main/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:25033:23 at arrayEach (/npm/screeps-main/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:545:11) at Function.forEach (/npm/screeps-main/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:9397:14) at printDiagnostics (/npm/screeps-main/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:25006:12) at Object.transform (/npm/screeps-main/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:29277:17)

any ideas ?

pot0rpan commented 3 years ago

Hmm, I'm not sure but I'll take a look. I've never had issues with Traveler types.

pacomms commented 3 years ago

thanks alot :-) great response as well

pot0rpan commented 3 years ago

@pacomms this is difficult to debug since I'm not getting the error, but try now. I added this change: 43e9f19e225fb6364485e3f5f8f53a505474e820

pacomms commented 3 years ago

yep thats compiled now, do you have any docs on this code like flag colors wot they do etc ? im pretty new to all this but love screeps just need a start with the code :-)

pacomms commented 3 years ago

Sorry just a question , should this code just run as is as a starter, i have deployed it but nothing spawns i just get tick number and empire in the console ?

pot0rpan commented 3 years ago

Awesome, wasn't sure what else to try if it didn't work.

No docs yet really, since I'm still changing things fairly often. For flags, look at config.ts to find flag colors. Right now there's only 1 there, for expanding to create new colonies. I've been planning on moving the other flag colors there as well (other flags are only for attacking currently), so I'll do that next so you can see all the flag types in one spot.

But if you're just starting, no flags are needed for that. The important part is to place your spawn in the correct spot where the bunker will fit. Look at my rooms on shard2 to see an example of where the first spawn goes in relation to the bunker layout, or check out the building plan for the full picture (note the most center spawn must be placed first).

pot0rpan commented 3 years ago

Sorry just a question , should this code just run as is as a starter, i have deployed it but nothing spawns i just get tick number and empire in the console ?

This is probably because right now the username is hardcoded, I haven't yet moved it to an easily editable environment variable. So edit config.js to change USERNAME to your in-game name. And less important, you can edit FRIENDLY_NAMES to specify who not to attack.

pacomms commented 3 years ago

cool thanks alot :-) i will watch this git as i like the code style, will look into adding more flags as i dont want everything automated, does this autobuild structures etc ?

pot0rpan commented 3 years ago

No problem! If you don't mind me asking, how'd you find this repo? I figured it would get buried under all the other "screeps" repos and no one would ever find it.

And yes, it autobuilds all necessary structures in the main colony room only. It also auto expands to start remote mining at rcl 4. One other thing to be aware of, if sources/controller are too close, things break a bit. So try not to get a room like this or you'll end up having to manually fix some stuff the room planner does.

pacomms commented 3 years ago

I was just scrolling through the github codes looking for ideas, i like the idea of using flags to control my screeps, i will look at implementing attack and defend flags ... well once i figure it all out lol

pacomms commented 3 years ago

sorry just noticed, do you have a flag for attacking already ?

pot0rpan commented 3 years ago

Defense is handled automatically, for both main colony room and remote harvesting rooms. And yes attacking is all flag-based. I'm about to move the attack flag colors to config.flags so it's easier to find. But for now, if you place a red/green flag in any room within 5 rooms of the main colony room, it'll spawn an attacker and healer pair, then go to the flag room and attack.

pacomms commented 3 years ago

awesome will look at that :-) i hope you dont mind me asking questions its kinda easier than trawling through the initial code :-)

pot0rpan commented 3 years ago

No not at all, ask away!

Just moved all flag colors to config.ts, also added small comments to explain what they do.

pacomms commented 3 years ago

Awesome will take a look now, is teh ammount of attackers configurable, ie send 2 melee instead of 1 or does it go by RCL and energy ?

pot0rpan commented 3 years ago

That just goes by number of flags, so you have to make the decision of if it's worth it and will be strong enough at the current RCL. Each pair gets assigned a flag, so if you put 2 flags in a room it should spawn 2 pairs, 1 for each flag.

pacomms commented 3 years ago

ahh perfect :-) awesome , is there a factory support and powerscreep support ?

pot0rpan commented 3 years ago

Attackers/healers also spawn before most other creeps, so be careful not to leave a flag too long if your attackers keep getting killed, or it could start starving the colony.

No factory or power stuff yet, or boosts. Labs/boosts are my next big to-do item, but it'll probably be a while as I need to figure out a good way to handle it.

pacomms commented 3 years ago

cool, well will watch you stuff with interest :- ) if i figure anything good i will of course share with you, thanks for putting your code up it really helps newbies ..

pot0rpan commented 3 years ago

No problem, thanks for checking it out! Any advice or suggestions are welcome.

So I'm assuming changing USERNAME fixed it for you and stuff started spawning then?

pacomms commented 3 years ago

yes it seems to have, i have it on a private server for now with just a few bots has spawned stuff and seems to be upgrading etc so far, will see about the layout etc, does it spawn walls and ramparts and roads ? is there any way to increase the display on the room to include more info etc .. debug console

pot0rpan commented 3 years ago

Ok nice. It makes ramparts around the bunker and controller, and roads to sources, controller, and at rcl 6 mineral. Also places containers/links. If you look at any of my rooms on shard2, everything that has been build was built automatically (except containers in remote mining rooms, that's manual for now).

The room visuals aren't configurable yet, all you can do is turn them on and off by typing stats.show = true/false in the console. All the blue profiling logs can be turned on and off in a similar way, stats.profile = true/false. If you want to filter the profiling results you can do it with stats.filter(). Most profiling logs are given "categories", like the room name, creep name, and creep role (if applicable). So to only show profiling for Pioneer creeps in room E1S1 you would do stats.filter('E1S1', 'pioneer'). But on a global reset or code push the profiling filter gets removed, that's not saved in memory currently. To turn off the filtering, just do an empty stats.filter().

Hope that helps, I'll get around to documenting those "hidden" things at some point.

pacomms commented 3 years ago

Hey bud, quick question my room only seems to be spawning builders and not dedicated miners and haulers i am at rcl 3 or do i need to place containers or something for the miners to spawn ?

Thanks :-)

pot0rpan commented 3 years ago

Builders should start to build roads and containers at RCL 3, then the harvesters should start spawning.

-------- Original Message -------- On Sep 9, 2021, 1:39 AM, pacomms wrote:

Hey bud, quick question my room only seems to be spawning builders and not dedicated miners and haulers i am at rcl 3 or do i need to place containers or something for the miners to spawn ?

Thanks :-)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

pacomms commented 3 years ago

kewl its just started doing just that :-) awesome

pacomms commented 3 years ago

sorry me again :-) when should remote miners start spawning ? do i need to place containers in other room to start mining them or a flag maybe ?

pot0rpan commented 3 years ago

I believe they start at RCL 4 once storage gets built, so the excess energy can be stored somewhere. They'll start spawning regardless of if containers exist, and container placement is manual atm.

Once they start spawning, place a container construction site under (or near) them and they'll build it then start using it. Sometime soon I'll automate that so they place the construction site themselves.

pacomms commented 3 years ago

Ok thanks, i have placed a claim flag and its spawned a claimer and sent it to the room, however when the colonizers spawn it gets stuck as the colonizer doesnt move from in front of spawn, do claiming not occur until these guys get to the claim room ? is there a way to make them go sit at a white flag for example when idle so they dont block the spawn ?

pot0rpan commented 3 years ago

Hmm they should go to the claim room instead of sitting there, maybe they're waiting until the claimer claims it first? I'll look into it later. Let me know if they head to the new room once the Claimer claims it.

is there a way to make them go sit at a white flag for example when idle so they dont block the spawn

Unfortunately, no. Whenever creeps are saying a countdown like "... 99" they should move out of the way of other stuck creeps (see https://github.com/pot0rpan/screeps/blob/main/src/actions/recycle.ts), but that doesn't check for a blocked spawn atm. It also doesn't look like Colonizers are using that all the time, so they may end up blocking both creeps and spawning. I'll work on fixing that.

pacomms commented 3 years ago

:-)

pacomms commented 3 years ago

ok so 3 colonizers have moved to the claim room, i have to kill a few to clear the spawn but now they sit there saying cmon ?

pacomms commented 3 years ago

hmm the claimer doesn't seem to have actually claimed the controller thats why the colonizers are doing nothing i guess, must be an issue with claimer maybe

pot0rpan commented 3 years ago

They say "cmon" if they got to the room and Claimer still hasn't claimed it. What's the claimer doing?

pacomms commented 3 years ago

claimer just died and a new one isnt spawning, claimer just sat by the controller

pacomms commented 3 years ago

is there a command to manually spawn another claimer ?

pacomms commented 3 years ago

claimer just spawned lets see what this one does

pacomms commented 3 years ago

nah claimers just sitting there doing nothing

pot0rpan commented 3 years ago

It's adjacent to the controller?

pacomms commented 3 years ago

yes

pacomms commented 3 years ago

screenshot

screenshot attached

pot0rpan commented 3 years ago

I won't be able to make any changes for a few hours, but maybe try putting some console.logs in this area to see what it's trying to do. That may help me debug for now until I can actually test it. https://github.com/pot0rpan/screeps/blob/11c881b278ff37336dab66e04e60a8cec312716b/src/creeps/ClaimerCreep.ts#L92-L110

pacomms commented 3 years ago

wait a minute, can i even claim 2 rooms at gcl 1 ? maybe thats the issue

pot0rpan commented 3 years ago

OH! that's probably the issue then 😄 Since colonizing is done manually with flags I never added a check for that.

pacomms commented 3 years ago

lol , ok rest easy then i need to raise my GCL then 1st

pot0rpan commented 3 years ago

You may be able to do that through the cli, I've never tried on my private server though. May need a mod for it.

pacomms commented 3 years ago

okies

pacomms commented 3 years ago

Hey m8, only me again :-) , i have just sent some attack creeps to another bots room and they dont attack anything when they get there, i noticed this as well if i spawn an attack creep in main room and the spawn in an invader they dont attack the invader nor any other creeps, i have looked through attacker code but cant spot why they are not doing anything ?

pot0rpan commented 3 years ago

Hey,

The attackers should attack once they get to the room with the flag, but I'm not sure what happens if you put the flag in their home room. When the home room has invaders or other hostiles, defenders should spawn unless the towers take them out first.

But if the attackers are in the flag room, and the flag room isn't their home room, then I'm not sure why they wouldn't be attacking.

pacomms commented 3 years ago

wierd , if i spawn invaders in the home room the defenders spawn but dont attack the invaders, same if i put attack flag in another room the attackers do spawn but do nothing when they get there

pot0rpan commented 3 years ago

Ok thanks, i have placed a claim flag and its spawned a claimer and sent it to the room, however when the colonizers spawn it gets stuck as the colonizer doesnt move from in front of spawn

Also, this should be fixed now. They weren't heading to the room until the claimer claimed it and died due to a small copy/paste bug.