jonathansafer / screeps Goto Github PK
View Code? Open in Web Editor NEWScreeps AI
License: MIT License
Screeps AI
License: MIT License
Actions move should include range as a param, so creeps don’t take weird paths (specifically PC, Upgraders and builders)
Obs scans all rooms and stores data in segments
Prioritize rooms that are nearby, and rooms that haven’t been scanned in a while
attacker and defender names are flipped
At RCL 6 and 7, when below 21% store threshold, don’t make upgraders unless timer is low
plan
flag seems not to be working when placed in the room
Make a config file with values like “construction frequency” , rcl8 update frequency, etc. So these can easily be changed without digging into the code
Put extractor on mineral
factory should avoid changing from dormant if not dormant OR PC should check if the factory has resources in it rather than a produce
PC opportunistically boosts spawns and extensions if it can
Walls shouldn’t be created in places where they aren’t needed
Walls also shouldn’t block off resources (use rampart instead)
This may be the case with some other products as well. For 1 batch of organism, 930 cells are needed. Normally, this is not necessarily a problem since high tier resources have dibs over low tier. However, in this case, one batch of phlegm only needs ~520 cells. This means that if we have more than 520 cells but less than 930 (odds that we jump from below 520 to above 930 in one 400 tick period are near 0), the commodity manager will decide to start another batch of phlegm. This phlegm will in turn be processed up the line until it eventually stays sitting as organoid(T4). This problem also occurs with tissue for the same commodity line, where the CM will once again prefer to make organoids over organisms.
Healmap with negatives at defender location
Assignments for defenders
Defenders are ranged
Don’t operate the factory if the factory is dormant
breaker destroys enemy ramparts/buildings but ignores walls (because they are unowned). destroy them
Road planner should cooperate with walls re: road to controller
need L1,2,3,4,5 power creeps in 5 L8 rooms with factories.
verify market code and ops code support this properly
terminal should attempt to sell excess ops and/or PC should not deposit ops in terminal if terminal is overstuffed w/ops
If we are using over 20 CPU/tick and bucket is running low (under 1k?), skip non-critical tasks. Also a lazy approach to hibernating => randomly choose 10 cities to run each tick (not perfect since cities will still end up doing similar work, it just limits the number of cities doing work per tick).
Highest level PC also operates Obs when Obs requests operation
Add mining metrics for factory resources so we know how long it takes to sell a top tier factory product (5550 base minerals for 1 top tier)
during the transition from RCL 3 -4, there is a point where the RCL 4 body is used even though all the extensions are not done being built yet. This RCL 4 body cannot be spawned leading to eternal gridlock and eventual decay. (builder and Upgrader affected)
Power miners must be able to fight and beat enemy harassers and power miners
Ferry should have 100% uptime at RCL 7 for factory usage and link mining
Store info about rooms in segments, to be used for long range path finding and military planning
After taking a close look on how the base is structures i couldn't help but notice that the walls are at low health(in one of your rooms are at 75k),if the enemy have smart attack code they will go for the walls since they have the lowest HP,also make the spawns further away from each other because them being close means that a nuke can take all 3 of them out easily,also,why not use all 10 labs for creating boosts,only using 6 is not that efficient.
Terminals balance Ops
RCL 3 body types skipped
Potential breaking bug from RCL 3 -> 4: builder can’t be built while extensions are partially made.
I was thinking,why not make the room planner build containers when it comes to mining
/remote mining
and upgrading
hi,i was testing the bot on my private server but when i placed the first spawn nothing happens,it only starts console.logging
the TIME
and nothing else,what should i do?
Observer should scan all power rooms in a row and or scan more frequently (maybe scan all rooms every 200 ticks)
Creeps need body for link mining
If moving through an enemy territory, breaker should destroy walls/ramparts that get in the way. breaker could optionally kill the towers/spawns as well
Power miners and associated medics should suicide as soon as their counts are updated
I like the idea of having that container being built near the spawn,but it would be much better if it was to be built on one of the adjacent squares of the spawn so that allows for recycling creeps but also for storing energy until the storage comes online,also it would help if the number of builders was increased from 1 to 3 or 4 at rcl 1 so the colony develops much faster.
PC stores and withdraws Ops as needed in terminal
TLDR bulky miners are only worth it in PC rooms. Savings is 10% cpu for the city, cost is 2% of city energy production***. Total savings is 5% of empire cpu.
***(4k for miners + 1k for tug - 4k energy recovered from spawn gap).
Miners currently use 20% of city cpu (additional 20% used for power mining, and 20% used for transporters)
In a room w/o a pc, a miner mines with 20 work, additional cost is 2k*2 miners = 4k energy for 40 work and 10% cpu saving (20 move tugboat [1k] code required). production is 3k * 2 sources * 5 cycles = 30k in that time.
If we boost a miner to 40 work, we are spending 4k+/30k (10-15% of energy) for 10% cpu. Not worth it.
In a PC room, each source has an extra 100*250 = 25k energy, for a total of 80k energy for the room. In these rooms the change may be worth it since we save 10% CPU for a 5-6% energy cost.
PC room cpu numbers:
PC rooms make 160k/310k per 1.5k ticks, over 50% of miner cpu. Saving 50% of pc miner cpu saves 25% of empire miner cpu => 5% of city cpu empire-wide.
Numbers to remember:
energy production: 30k/1500 ticks
pc room production: 80k/1500 ticks
current miner cost (2): 6k/1500 ticks (1-2% lost- walking time, 7% lost- spawn time**),
current transporter cost (2): 3k/1500 ticks
ferry (1): 1.5k/1500
**miner mines 40 energy/tick. when a miner dies, 150 ticks are lost worst case, so a miner has 150 ticks to mine 3k energy. 15040 = 6k, 0 lost. In a PC room, there is 5k extra energy, so 2k is lost per miner. So a PC room loses 4k/80k = 5%. Currently, with 2 PC rooms in the empire, total production is 530k + 2*80k = 310k. Current losses from this issue are 8k/310k ~= 3%. (issue can also be prevented with bulky miner)
Claim operation should be dropped if under attack
Full integration of medic and trooper into one unit, ability to maintain orientation.
All decision making occurs in trooper code. Once medic is assigned to a trooper, it loses its independence, and suicides if trooper dies.
Similar to how upgraders inject themselves with upgrade boost, builders should do so with repair boost (at least at RCL 8)
Rather than unclaiming cities, cities should have one or more hibernation modes where they stop producing creeps entirely, except for the occasional upgrader (possibly a unique role) to maintain the claim. Hibernating cities will be able to semi or fully come out of hibernation to defend themselves, maintain walls, and/or generate economic output when there is significant spare cpu (peacetime). Cities designated with hibernating ability will be able to hibernate to create excess cpu during times of need.
Links get auto built
Link can’t block off source, can’t be on a road, must be adjacent to a spot that miner could stand
Transporter fills extension in organized manner, fewer and bigger transporters
Transporters should deposit their load and suicide if they have less than 10 ttl. This will prevent them leaking substantial amounts of energy onto the floor (especially now that they are so big).
Change upgrader to use links. #16 must be completed first, with a link placed by the controller for the upgrader to use.
If PC has no work to do, go dormant for 10 ticks
I've seen the way you defend the base,but I have to say,it's not the most efficient because of all the walls,i know they are easier to maintain than ramparts but walls don't allow creeps to be in them,so defenses aren't going to be that effective,meaning you can only use ranged defenders,also enemy creeps can position themselves in front of the ramparts so your creeps can't get out,i suggest making all the walls into ramparts so that allows for more defensive options and overall more travel options when it comes to creep movement.
Update counts should not do any filtering on ticks where said filtering is not used
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.