Giter Club home page Giter Club logo

screeps-quorum's Introduction

screeps-quorum

Screeps Quorum is a completely automated project centered around the game Screeps.

JavaScript Style Guide License Version Downloads CircleCI

npm

While there are other Screeps code bases which focus on automation, this is the first codebase which has automated its own management and deployment. The Quorum project does not have a single specific user behind it, but is completely independent.

All Pull Requests are done by volunteers, and the entire project is open source.

How does it work?

  • Anyone can make a pull request. Developers can then vote on the pull requests using reactions (:+1:, :-1:, or :confused:). Pull requests which meet the consensus rules and pass all tests will be merged using Gitconsensus.

  • Any code that gets merged into master will automatically be uploaded to the Screeps main world under the user Quorum. Code is also deployed automatically once a day.

  • If the Quorum user is no longer spawned in the game it will be relaunched using the ScreepsAutoSpawner. The AutoSpawner fork used by this project has its own conensus rules and is also automatically kept up to date.

  • All of the Quorum data is public using ScreepsDashboard and hosted at quorum.tedivm.com. This includes full console output, all memory and segment data, and wallet history (with more feature being developed as needed).

Resources

Join the discussion on slack at #quorum, available on the Screeps Slack Network.

View the Quorum Dashboard for all the information on the currently running instance.

Contributing

This project does everything but code itself- that part comes from community pull requests.

The developer wiki should be the first stop before diving into the code. Like the project itself this is completely community run, and documentation contributions are always appreciated.

Not sure where to get started? The github project has a list of needed features specifically to give people a jumping off point for getting into the project.

Please take a moment to read the contributors guide to get an understanding of how the project works and how contributions will be looked at by the community.

Deploying

This codebase uses Gulp to deploy to the screeps server. It uses a configuration file, .screeps.json, which can save multiple configurations.

{
  "main" : {
    "username": "Quorum",
    "password": "random123",
    "branch": "main"
  },
  "127.0.0.1" : {
    "username": "Quorum",
    "password": "random123"
  },
  "myserver.example.com" : {
    "username": "Quorum",
    "password": "random123",
    "ssl": true
  }
}

By default Gulp will deploy to the main server, but this can be changed with the server flag.

gulp --server=127.0.0.1

By default gulp will push to the default branch. This can be changed in the configuration file or by passing the branch option to gulp.

screeps-quorum's People

Contributors

ahmedcharles avatar alinanova21 avatar anisoptera avatar daboross avatar dansrogers avatar dessix avatar dragoonreas avatar duckymirror avatar esryok avatar gitconsensus[bot] avatar jeremygagnier avatar jerroydmoore avatar lurr avatar mebays avatar metaverserpn avatar pathurs avatar riftlurker avatar screeps-automated-user avatar screepsquorumbot avatar semperrabbit avatar tedivm avatar therealmaxion avatar viezevingertjes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

screeps-quorum's Issues

[feature] When finding room paths take into account source keeper blocks

Some rooms have source keepers that basically block an entrance, meaning anything that walks through and isn't prepared basically gets sniped. At the same time source keeper rooms can be really useful to walk through. It would be useful if the system could take them into account the same way it does with blocked exits.

[feature] Multi Shard

There are a lot of things to implement for the support of the code being multi-shard ready.
Some include the following, feel free to create separate issues for subpoints and check them off as they are completed, linking to them from the list here also helps:

  • Transfer creep memory through interShardSegment when traveling through shard portals
  • Pathfinding/targeting to/after shard portals
  • Respawn check needs to consider whether we are on multiple shards, and not just respawn when we look defeated on one shard
  • Adjusting CPU limit allocation between shards
  • Expanding from one shard to another
  • Supporting one shard with civilian creeps/resources from another
  • Attacking/defending on one shard with creeps from another
  • Market arbitrage between shards

Structure Layout

I've put together a very basic system for storing room layout plans- it uses the sos.lib.vram module to save data in a segment, and stores the room layouts themselves as a serialized costmatrix. This system should give us the building blocks for auto layout and build.

Next step is the layout itself. I'm thinking we use templates and the distance transform function itself to do this (rather than some sort of dynamic algorithm that uses different layouts in different scenarios). I'm thinking to start we have two templates-

  • Core Structures - basically everything that isn't an extension or extractor, this layout will focus on spawning, boosting, and resource management. Towers will be clustered here for easy loading and for the strongest possible DPS when under attack.

  • Extension Flowers - rip off dissi and bask in the cpu savings.

I have a starting point proposal google sheets.

As for the placement rules I think we should first attempt to put the core cluster down as close to possible to the controller, with the extensions as close as possible to the core cluster. We can then iterate over random positions and loosen up the rules until something fits.

[feature] World Scouting

This is the active part of #84. The primary goal here is to gain visibility to rooms to trigger the room intel process.

[feature] Advanced Multiroom Travel

  • Avoid enemy rooms (unless desired).
  • Generate custom costmatrixes with features such as spot avoidance (for walking around source keepers or towers).
  • Detect when stuck and compensate.
  • Switch ignoreCreeps on and off depending on circumstances.

[feature] Sleep processes

It should be possible to sleep processes for a specific amount of time.

The simplest way would be to add a new object to the scheduler's memory for "sleep", with the pid being the key and the unsleep time being the value. When a process is sleeping it should be removed from the running queues, and when it is no longer sleeping it should be placed back in.

[feature] Remove "timed out" construction sites

The expand program is spamming construction sites and not cleaning them up (a bug on it's own), but in general a system that cleans up stale construction sites would be nice.

One way to handle it would be to save the construction site creation date in memory and remove any older than a specified timeout value. The Creep.prototype.build function can also be monkey patched to update that value when called on a site so things that are being built (just slowly) won't time out.

[bug] Worker can get "stuck" on construction sites

If a worker is standing where a new construction site is placed, and that site isn't walkable, the creep will get stuck. It will be unable to build the construction site, but it won't move because it is in range to the site.

This is a pretty rare occurrence as the creep has to be standing in the exact right spot, but it can happen.

[feature] Update the Wiki

This is a standing issue to let people looking for ideas on how to help know that work on the wiki is always appreciated.

[feature] Room Intel Database

This is the passive side of #85, which should manage actually getting room visibility.

Data to collect (please comment if there is something missing)-

  • Room owner
  • Room level
  • Mineral
  • Number of Sources
  • Resources Positions (SK Rooms)
  • Portals
    • Position
    • Destination Room
    • Destination Shard

This should ideally be stored using segments, possibly with the sos vram library (the room construction code is a great example on how to use this library).

[feature] Core Structure Management (crane creep)

The core layout includes a spot for a creep that sites adjacent to many of the major structures (nuker, power spawn, terminal, storage, link, and a spawn). This allows a single creep (the "crane", "loader", or "linker" creep depending on who you ask) to manage all of those structures without ever having to move.

This creep should-

  • Move resources from the terminal to storage.
  • Move resources from storage to the terminal.
  • Move power and energy (economy permitting) into the power spawn.
  • Move ghodium and energy (economy permitting) into the nuker.
  • Move energy into or out of the link.

quorum_layout

[feature] Remove construction sites when out of spawns

If someone clears a room out a construction site for the first structures they hit will be placed, but once they clear out the spawns nothing will be able to build it. Clearing out other sites will make the spawn build quicker and help the room recover.

[bug] Gulp doesn't clear `dist` folder so deleted files still get uploaded

In most cases this shouldn't be a problem, as the file won't get loaded if it isn't references anywhere in the uploaded code base, but there are cases during development where it can cause issues (for instance, if uploading code to a private server after removing a program- if the program doesn't exist the scheduler will just kill the process, but if the stale program is uploaded it can result in an unstable system or at a minimum a bunch of errors to the console).

[bug] Creeps crash sometimes and don't recover.

I've observed a creep crashing multiple times. No error's visible in the console, yet the creep stops doing his job and never recovers. It solves itself when the creep dies, but that's not the expected behavior.

Types i observed this with is: Miner & Hauler. In the miners case it was stuck on top of a container and stayed there, blocking other miners. In the case of the haulers (multiple), they were waiting next to a fully filled spawn, but not continued doing anything after the spawn was empty.

[bug] Wall/Rampart building code gets stuck on impossible to built positions

This is primarily an issue because of another already solved bug, but it should still be resolved for robustness.

Basically, if a rampart or wall is scheduled to be built but it is in an impossible to build on position it will attempt to add the construction site and fail. The next tick it will see that there is no site there and will try again.

This can be resolved by adding a check when looking for "gaps" to see if it is possible to construct and then skipping over those that aren't.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.