Navigation

    forum

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

    Keidence

    @Keidence

    14
    Posts
    774
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Keidence Follow

    Posts made by Keidence

    • RE: Season #2

      Will the Market / Terminals be enabled?

      I can imagine a scenario where a single player only ever turns in the symbol in their starting (highest RCL) room. They would use the market to exchange all their other symbol types for that single kind.

      I kinda like the idea of forcing players to devise a cooperative system where creeps need to meet in the open and physically exchange goods. Harder to program and easier to ambush!

      posted in News & Announcements
      Keidence
    • RE: Screeps not moving. No error on code.

      Which shard are you on? Do you have any other information (room link, history link, etc)?

      If you are on shard3 that is likely because the shard is down.

      https://status.screeps.com/

      posted in Technical Issues and Bugs
      Keidence
    • RE: Screeps Arena Preorder

      @artch That definitely look interesting! Happy to see things like ES6 syntax making it into the game.

      However, this sounds like a significant API departure from the main MMO, do you have plans to upgrade the main MMO API to ES6 modules in a similar fashion?

      Or is it expected that MMO bots and Arena bots will always be fundamentally different?

      posted in News & Announcements
      Keidence
    • RE: Game.cpu.generatePixel change

      @artch It looks like not all the documentation has been updated.

      PIXEL_CPU_COST = 10000
      https://docs.screeps.com/api/#Game.cpu.generatePixel shows 10000

      However, in the game web client. The intellisense in the console is still out of date. Typing Game.cpu.generateP into the Console brings up an intellisense completion which reads:

      fn() -> number
      Generate 1 pixel resource unit for 5000 CPU from your bucket.
      
      CPU cost: HIGH
      
      posted in News & Announcements
      Keidence
    • RE: Increase Lab Productivity - Increase results and decrease number of intents.

      +1

      posted in Feature Requests
      Keidence
    • RE: How does Memory work?

      Short answer: Indeed, you can't.

      Better longer answer is that you can ONLY save primitive objects to Memory. As stated in the documentation, this is because at the end of each Tick, Memory is serialized by JSON.stringify and the resulting string is saved to the backend.

      On the next tick, the backend gives back a plain string which is passed to JSON.parse to produce the Memory object available to your script.

      For this reason, you cannot save any class instances, functions, or Game Object references to Memory as JSON.parse will not know how to reinstantiate the class/function on the next tick.

      The usual solutions are to save Game Object Ids (e.g. Memory.mainSpawnId = Game.spawns.Spawn1.id). Ids are strings, and will be returned from memory on the next tick, and you can look up the Game Object instance on that tick with: const spawn = Game.getObjectById(Memory.mainSpawnId)

      You should save to Memory just enough primitive information to reinstantiate your needed classes on later ticks.


      Unrelated to the Memory object, there is another caching technique where you cache real object instances on the Global scope. (e.g. global.MainClass = new MyClass())

      This object actually will survive the Tick, as it exists in your virtual javascript instance on the server. (However, I believe you cannot store actual Game Objects (e.g. Creeps, Structures, etc) this way, as they are regenerated every tick by the runtime).

      However, while Memory has a system guarantee to ALWAYS survive till the next tick, Global scope has no such guarantee. And anything saved on Global Scope can be cleared without warning by the Runtime if it restarts your isolated VM. (see: https://wiki.screepspl.us/index.php/Global_reset). This is what Smokeman is referring to as you should only store data on Global Scope that you can regenerate/recalculate from the information you have in Memory.

      Combining these two techniques efficiently is a large part of optimizing Screeps 🙂

      posted in Help
      Keidence
    • RE: Issue with the target for the method creep.reserveController(target).

      Can you accept my answer to mark this topic resolved?

      posted in Technical Issues and Bugs
      Keidence
    • RE: Issue with the target for the method creep.reserveController(target).

      Oh I see.

      Take a look at .lookForAt. https://docs.screeps.com/api/#Room.lookAtArea

      It says it returns an array of objects found, not a single object. I think it's unfortunate that screeps structures .toString uses square brackets.

      Try doing .reserveController(controller_2[0]). Does that give the results you expected?

      posted in Technical Issues and Bugs
      Keidence
    • RE: Issue with the target for the method creep.reserveController(target).

      From the API Documentation: https://docs.screeps.com/api/#Creep.reserveController

      ERR_INVALID_TARGET -7 The target is not a valid neutral controller object.

      The error code in your example makes sense if the first intent claimed it, and the second failed because it is claimed.

      Can you try other variations of your example? Reversing the order of the .reserveController calls?

      posted in Technical Issues and Bugs
      Keidence
    • RE: Decorations update

      @systemparadox Definitely second this, the legislation has been changing rapidly in the past couple years so it is important that you guys look into it.

      posted in News & Announcements
      Keidence