MCPcopy Index your code
hub / github.com/TooAngel/screeps

github.com/TooAngel/screeps @v1.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.2.0 ↗ · + Follow
83 symbols 132 edges 71 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

TooAngel Artificial intelligence for screeps

CircleCI Code Climate npm version gitter

https://screeps.com/

For in game room visitors:

Happy to see you visiting one of our rooms. Visit FAQ to find answers

Info

This is the AI I'm using for screeps. I managed to reach Top 10 from November 2015 - March 2016. Main Goal is to automate everything, no manual interaction needed.

The AI is deployable on a private screeps server, follow the information on Steam.

Note

This is not a good example for code quality or structure, most LOCs written while fighting or other occasions which needed quick fixes or in the ingame editor. But I think there are a couple of funny ideas. Every contribution is welcome.

Features

Tweaking

Add a src/friends.js with player names to ignore them from all attack considerations.

E.g.: module.exports = ['TooAngel'];

Add a src/config_local.js to overwrite configuration values. Copy config_local.js.example to src/config_local.js as an example. src/config.js has the default values.

Contributing

All kind of contribution is welcome, issues, contact via channels, pull requests.

Follow this link if you are planning to contribute via pull request.

Contribution and Workflow

Issues with label 'enhancement' exist, which are open for discussion and implementation. The description will reflect the latest status of the discussion and should end up in the documentation, when finishing the implementation.

Upload

install dependencies

npm install

add your account credentials

to screeps.com

To deploy to the live server provide the credentials.

via env

export email=EMAIL
export password=PASSWORD

via git ignored file

echo "module.exports = { email: 'your-email@here.tld', password: 'your-secret' };" > account.screeps.com.js

or edit and rename account.screeps.com.js.sample to account.screeps.com.js

And deploy to the server:

grunt screeps

to private server

Create a .localSync.js file with content:

module.exports = [{
  cwd: 'src',
  src: [
    '*.js'
  ],
  dest: '$HOME/.config/Screeps/scripts/SERVER/default',
}
grunt local

Develop

grunt jshint
grunt jsbeautifier
grunt jscs

Design

More details of the AI design

Core symbols most depended-on inside this repo

nextState
called by 9
src/prototype_creep_mineral.js
addToString
called by 5
src/config_brain_memory.js
openExits
called by 4
src/prototype_room_costmatrix.js
resetCounters
called by 3
src/prototype_room_controller.js
executeTask
called by 3
src/prototype_room_controller.js
getOppositeDirection
called by 2
src/prototype_creep.js
getNextSourceKeeper
called by 2
src/role_atkeepermelee.js
inLayer
called by 2
src/prototype_room_wallsetter.js

Shape

Function 83

Languages

TypeScript100%

Modules by API surface

src/prototype_creep_mineral.js13 symbols
src/prototype_creep_resources.js6 symbols
src/prototype_room_defense.js5 symbols
src/prototype_room_attack.js5 symbols
src/role_scout.js4 symbols
src/prototype_room_basebuilder.js4 symbols
src/role_atkeepermelee.js3 symbols
src/prototype_room_wallsetter.js3 symbols
src/prototype_room_external.js3 symbols
src/utils.js2 symbols
src/role_towerfiller.js2 symbols
src/role_scoutnextroom.js2 symbols

For agents

$ claude mcp add screeps \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact