shieldterew.blogg.se

Screeps reddit
Screeps reddit










  1. Screeps reddit install#
  2. Screeps reddit code#

Mining groups bundle together mining sites by a common dropoff location, and each mining group has its own TransportRequestGroup and separate fleet of haulers. To solve this problem, I introduced the idea of miningGroups a while back. A hauler could come in from the left, deposit to the left link, then start handling a request from the right room, walking past the storage and negating the usefulness of the link. Suppose you own a room that harvests from its left and right neighbors, so you put links on the left and right sides of the room, with the storage in the middle. However, things get hairy when you add multiple possible dropoff locations, such as when you build several dropoff links in a room. In the simplest case, the dropoff structure is only ever colony.storage, and this approach actually works decently well. Supplier.task = obtain energy from store structure Supplier.task = transfer energy to target Let target = closest high-priority unhandled request Hauler.task = withdraw energy from target Let target = highest priority unhandled request Hauler.task = transfer energy to dropoff structure (There are also mineralSuppliers and queens which have slightly-modified supplier logic.) This is basically how they worked in pseudocode: function haulerLogic(hauler): Haulers bring in energy from remote sources and put them in a dropoff structure and suppliers take energy from storage and distribute it throughout a room. My old transport system took a greedy approach which was simple but inflexible, needlessly separating creep roles which could be combined. Isolating requests to separate boxes makes it difficult to handle more complex requests which need require multiple transportation “legs”, such as moving minerals to a terminal, sending them to another terminal, then transferring them from the terminal to a lab. However, this system did not provide much in the way of flexibility. This way of compartmentalizing requests proved to be quite useful in some cases, giving the convenience of “throw it all in a box” while still allowing me to specify which creeps do what. At early levels, the hatchery puts requests into that group, but at RCL4+, the hatchery gets its own dedicated attendant (the queen) and its own request group. For example, each colony has a request group which suppliers attend to. TransportRequestGroups (which existed in my old AI, but which I cleaned up in the Overlord Overload rewrite) act as a “box” to group prioritized resource requests.

  • Finally, in Part 3, I’ll give a detailed explanation of how my new logistics system works.
  • In Part 2, I present a generalization of the “creep routing problem”, discuss why finding an exact solution is infeasible and motivate my approach in finding an approximate solution to the problem.
  • In Part 1, I’ll talk about the advantages and disadvantages of my old system and why it motivated an overhauled logistics system.
  • Since this post is really long (but I hope it’s worth the read!), I’ve divided it up into three parts: In this post, I’m going to talk about the overhauled logistics system I’ve spent the last few months working on. (And it’s probably the single part of the game I’ve spent the most time thinking about.) When testing synchronous code, omit the callback and Mocha will automatically continue on to the next test.Logistics – the problem of efficiently transporting resources – is one of the most interesting and deepest problems in Screeps.

    Screeps reddit code#

    In your editor: var assert = require ( 'assert' ) describe ( 'Array', function ( ) ) # Synchronous Code $ $EDITOR test/test.js # or open with your favorite editor

    Screeps reddit install#

    Or as a development dependency for your project: $ npm install -save-dev mochaĪs of v9.0.0, Mocha requires Node.js v12.0.0 or newer. Install with npm globally: $ npm install -global mocha

  • Test Fixture Decision-Tree Wizard Thing.
  • arbitrary transpiler support (coffee-script etc).
  • before, after, before each, after each hooks.
  • extensible reporting, bundled with 9+ reporters.
  • easily meta-generate suites & test-cases.
  • auto-exit to prevent “hanging” with an active loop.
  • optionally run tests that match a regexp.
  • auto-detects and disables coloring for non-TTYs.
  • simple async support, including promises.











  • Screeps reddit