Private Server Bot Development

From Screeps Wiki
Jump to navigation Jump to search


Private Server Bot Development[edit]

Release[edit]

Add `"screeps_bot": true` to the `package.json`. Set the `main.js` as entry point and relase the code as npm package. The bot then needs to be added as a steam workshop item. This can be done via the screeps server interface.

Read more in the official documentation: https://github.com/screeps/screeps#npc-bots

Development[edit]

Well, the usual script could already be released as a bot.

Necessary features[edit]

- Automatic structure placement

Nice to have[edit]

- External room harvesting 
- Mineral handling 
- Power harvesting
- New rooms claiming on GCL level up 
- Automatic attack 
- Rebuild of fallen rooms 

Hints[edit]

- Be aware of random spawn positions.
- Don't touch the interface while developing
  - If a structure needs to be placed, write code
  - If a creep is stuck, write code
  - If a constructionSite is wrong, write code
- Manage dynamic environments. Recheck external harvesting rooms from time to time, e.g. players can vanish
- Handle migrations of code. As soon as the bot is released every version can be deployed and upated to the current one. Make sure that rooms can selfheal, remove wrong positioned structures, recreated from any kind of existing structures.

Considerations[edit]

- A passive bot is boring
- An agressive bot is annoying

Examples[edit]

- SimpleBot
- TooAngelBot