Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. Duegin
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    Duegin

    @Duegin

    10
    Posts
    1968
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Duegin Follow

    Posts made by Duegin

    • RE: Mods not playing nice with isolated VM on private server?

      Further experimentation muddied the waters again. Updating npm to latest seemed to fix the issue when I installed one particular mod (I can't recall which it was) but then when I came back later to install others the problem was back. I wound up working around it a different way by running

      npm install screeps
      

      a second time after installing the mods. This restored the files that were removed during the mod installation. I also noticed some long github threads which might be related but I did not confirm:

      https://github.com/npm/npm/issues/17379

      posted in Private servers
      Duegin
    • RE: No game ticks occur, can't connect to storage

      I restarted my server which eliminated the issue for the moment, though I suspect it will reoccur at some point. I also experimented on a separate VM and confirmed I could bring down the engine_main process in isolation and then have the launcher spin it back up with additional custom logging inside that loop. If the problem does reproduce and restarting the engine_main process doesn't eliminate it then I should be able to learn more next time.

      posted in Private servers
      Duegin
    • RE: Mods not playing nice with isolated VM on private server?

      For anyone else that might run into this in the future I set up a second VM that I think was identical to the first, except this time I started by running

       npm i npm@latest -g
      

      and the problem no longer reproduces. I can't guarantee it was this and not something else, but it seems like a good bet.

      posted in Private servers
      Duegin
    • RE: No game ticks occur, can't connect to storage

      I've also encountered the same issue although in my case the server would run quite a ways before hitting the issue. The logs show:

      engine_main.log (excerpt):

      Game time set to 32477
      Main loop reset! Stage: waitForUsers
      Main loop reset! Stage: waitForRooms
      Game time set to 32478
      Main loop reset! Stage: waitForUsers
      Main loop reset! Stage: waitForUsers
      Main loop reset! Stage: addRoomsToQueue
      Main loop reset! Stage: global
      Storage connection lost { Error: read ECONNRESET
          at _errnoException (util.js:992:11)
          at TCP.onread (net.js:618:25) code: 'ECONNRESET', errno: 'ECONNRESET', sysca
      ll: 'read' }
      Connecting to storage
      Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21027
          at Object._errnoException (util.js:992:11)
          at _exceptionWithHostPort (util.js:1014:20)
          at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
        code: 'ECONNREFUSED',
        errno: 'ECONNREFUSED',
        syscall: 'connect',
        address: '127.0.0.1',
        port: 21027 }
      Connecting to storage
      Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21027
          at Object._errnoException (util.js:992:11)
          at _exceptionWithHostPort (util.js:1014:20)
          at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
        code: 'ECONNREFUSED',
        errno: 'ECONNREFUSED',
        syscall: 'connect',
        address: '127.0.0.1',
        port: 21027 }
      Main loop reset! Stage: global
      Connecting to storage
      Main loop reset! Stage: global
      Main loop reset! Stage: global
      Main loop reset! Stage: global
      

      the same message continues indefinately from there

      storage.log:

      screeps@sosscreeps2:~/world/logs/1527233603197$ cat storage.log | more
      Loading mods from "/home/screeps/world/mods.json"
       - /home/screeps/world/example-mods/welcome-text.js
      Starting storage server
      Storage listening on 21027
      [127.0.0.1:51744] Incoming connection
      [127.0.0.1:51746] Incoming connection
      [127.0.0.1:51748] Incoming connection
      [127.0.0.1:51750] Incoming connection
      [127.0.0.1:51758] Incoming connection
      /home/screeps/world/node_modules/lokijs/src/lokijs.js:2158
                  throw err;
                  ^
      
      Error: ENOENT: no such file or directory, rename 'db.json~' -> 'db.json'
      Loading mods from "/home/screeps/world/mods.json"
       - /home/screeps/world/example-mods/welcome-text.js
      Starting storage server
      Storage listening on 21027
      [127.0.0.1:41278] Incoming connection
      [127.0.0.1:41280] Incoming connection
      [127.0.0.1:41282] Incoming connection
      [127.0.0.1:41284] Incoming connection
      [127.0.0.1:41286] Incoming connection
      

      In lokijs the relevant source for that error is:

      /**
       * Handles saving to file system, local storage, or adapter (indexeddb)
       *    This method utilizes loki configuration options (if provided) to dete$
       *    persistence method to use, or environment detection (if configuration$
       *
       * @param {function=} callback - (Optional) user supplied async callback / $
       * @memberof Loki
       */
      Loki.prototype.saveDatabase = function (callback) {
        var cFun = callback || function (err) {
            if (err) {
              throw err; // <-- error thrown here
            }
            return;
          },
          self = this;
      
        // the persistenceAdapter should be present if all is ok, but check to be$
        if (this.persistenceAdapter !== null) {
          // check if the adapter is requesting (and supports) a 'reference' mode$
          if (this.persistenceAdapter.mode === "reference" && typeof this.persist$
            // filename may seem redundant but loadDatabase will need to expect t$
            this.persistenceAdapter.exportDatabase(this.filename, this.copy({remo$
              self.autosaveClearFlags();
              cFun(err);
            });
          }
          // otherwise just pass the serialized database to adapter
          else {
            this.persistenceAdapter.saveDatabase(this.filename, self.serialize(),$
              self.autosaveClearFlags();
              cFun(err);
            });
          }
        } else {
      posted in Private servers
      Duegin
    • RE: Mods not playing nice with isolated VM on private server?

      @artch thanks for getting back to me! Sadly my attempt to use 'npm list' consumed all the memory on the machine (its a VM with 4GB) so my SSH session got disconnected and I had to reboot it without getting a result. However as long as you say it doesn't repro for you I'm happy to assume its an issue local to my machine setup and I'll try to figure out what I did to cause it. If I discover anything interesting that isn't between keyboard and chair I'll let you know.

      Appreciate it, -Duegin

      posted in Private servers
      Duegin
    • Mods not playing nice with isolated VM on private server?

      I was trying to follow the instructions here: http://docs.screeps.com/contributed/ps_ubuntu.html

      and everything works nicely if I skip installing any of the custom mods. However if I do install a mod, for example:

      screeps@sosscreeps2:~/world$ npm install screepsmod-auth
      + screepsmod-auth@2.4.5
      added 11 packages and removed 419 packages in 11.325s
      

      Then all the isolated VM stuff is gone, I assume as part of the 419 packages npm just removed?

      screeps@sosscreeps2:~/world$ find ~ -name "*isolate*"
      screeps@sosscreeps2:~/world$
      

      If I go on to run the server in this state it quickly generates errors for the missing files:

      screeps@sosscreeps2:~/world$ npx screeps start
      In file included from ../src/pf.cc:2:0:
      ../src/pf.h: In member function ‘screeps::world_position_t 
      screeps::world_position_t::position_in_direction(
      screeps::world_position_t::direction_t) const’:
      ../src/pf.h:117:4: warning: control reaches end of non-void function [-Wreturn-type]
      }
      ^
      module.js:549
          throw err;
          ^
      
      Error: Cannot find module './build/Release/isolated_vm'
          at Function.Module._resolveFilename (module.js:547:15)
          at Function.Module._load (module.js:474:25)
          at Module.require (module.js:596:17)
          at require (internal/module.js:11:18)
          at Object.<anonymous> 
      
      /home/screeps/.npm/_npx/16677/lib/node_modules/screeps/node_modules/
      isolated-vm/isolated-vm.js:1:80)
          at Module._compile (module.js:652:30)
          at Object.Module._extensions..js (module.js:663:10)
      at Module.load (module.js:565:32)
      at tryModuleLoad (module.js:505:12)
      at Function.Module._load (module.js:497:3)
      
      
      /home/screeps/.npm/_npx/16677/lib/node_modules/screeps/node_modules/
      webpack-shell-plugin/lib/index.js:168
      

      Similar behavior happened with other mods I tried. I haven't investigated much and I'm a relative newcomer to the npm package management world so there may be easy solutions I am unaware of. Just figured I should ask before spending too much time on it.

      Thanks! -Duegin

      posted in Private servers
      Duegin
    • RE: Discussion: Contract system

      This sounds cool to me. A few thoughts if someday this revives:

      1. For the folks asking for 1st class support of parameters that are distinct from the contract, I think the community can build that capability without needing anything extra from @artch. Just define a community convention that contracts look something like this:

         const parameter =
         { "arbitrary", "json", "here" }
         // -- END PARAMETER -- 
         module.exports.loop = ...
        

        Instead of thinking of contract string as code (which it still is), think of it as a serialization format for a tuple (parameter, contractTypeId). This format can be both programatically formatted and parsed/validated. For example parse/validation looks like this:

        a) The string starts with "const parameter =" and contains somewhere "// -- END PARAMETER --"

        b) The string in between those two is a valid json object

        c) The string after "// -- END PARAMETER --" hashes to a SHA512 that you recognize, presumably from a white-list of contracts you have manually vetted before inserting them in your AI.

        d) Based on recognized code SHA512, validate the parameter object conforms to any additional input requirements for a contract of the given type

      1. I'm definitely in the camp that probably wouldn't use this unless contract issuance and acceptance was automated. I think of this similar to an advanced terminal. I'd have to write code to decide when it is appropriate buy ghodium, but once that code is written my AI can buy/sell ghodium automatically indefinitely into the future. If the community defines a new contract called PAY_FOR_A_NUKE I'd have to code my AI to determine when its appropriate to issue/accept PAY_FOR_A_NUKE, and now its automated. Working with the PAY_FOR_A_NUKE contract, given an comunity supported OSS code base that wraps it in a terminal-like API, doesn't seem much harder to automate than the game's actual Nuker or Terminal. I don't believe that contracts in general are unautomatable snowflakes even if some subset of them are.
      1. I don't see how you would avoid needing to run contracts in an isolated VM, otherwise the contractee can cheat. The isolated VM would presumably could still charge its cpu/memory usage to the contractee, as well as have some access to the contractee's game objects and memory.

      2. As an alternative to formal contracts, you might encourage players to make informal contracts that they have to police themselves. Public segments already provide a communication system for arranging deals, but I think it would currently be tough to monitor a deal, or to provide payment. Those issues might be resolved via an API that shares visibility of a room with another player, and with an API for private terminal transactions. Its probably a lot cheaper to implement than contracts, but it also probably wouldn't facilitate as much deal making, especially among untrusted parties.

      1. Priority relative to other things - I'm neutral. Contracts sounds like a feature that would offer a cost-to-coolness ratio similar to other things I've heard you might be working on.
      posted in General Discussion
      Duegin
    • RE: PTR Changelog 2017-07-20: world shards

      > I like that idea, but of course I would, I'm a 10 CPU player

      Referring to my idea above? Not that I am attached to that particular scheme, but I don't think that one gave any favor to 10 CPU players in my head (sorry!). Left unspecified was that shifting CPU from shard A to shard B only works if shard A has the CPU available to give. For a 10 CPU player after your creep crossed the portal you would have  all 10 CPU in the new shard and no way to get more (without subscribing).

      posted in News & Announcements
      Duegin
    • RE: PTR Changelog 2017-07-20: world shards

      > The string is rewritten all at once, so the changes are atomic. Updated the documentation a little bit.

      Thanks Artem, that was exactly what I was looking for.

       

      A few thoughts on the rest of the thread...

      a) I still agree ideologically having an API to do anything that could be done in the UI and affects the outcome is the right goal to strive for, but happy to accept there are practical limitations in getting there.

      b) FWIW, there might be some options in the design space here that are automatable but don't need new APIs or UI re-allocation? For example move a creep through a portal into a shard that has none of your creeps yet and 10 cpu automatically shifts there from the shard that has the most CPU. When all creeps/buildings are gone from a shard for 24 consecutive hours the CPU shifts back to the shard with the most CPU. For each controller claimed after the first another 10 CPU shifts. I'm sure there are many other variations if folks like the idea of driving it with a game mechanic but not this exact mechanic.

      posted in News & Announcements
      Duegin
    • RE: PTR Changelog 2017-07-20: world shards

      It appears having a programmatic API to adjust CPU has already won the day, but I'll add my feedback as another player in favor ideologically of having such an API. 

      I like the interShardSegment. I trust at some point you will document in more detail what memory model we can expect now that we've effectively got a multi-threaded application with shared memory? 

      Thanks for all your work, I've been enjoying playing screeps!

      posted in News & Announcements
      Duegin