Navigation

    forum

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

    computerquip

    @computerquip

    3
    Posts
    821
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    computerquip Follow

    Posts made by computerquip

    • CPU Usage

      What determines CPU usage? Is it only documented functions using the API, meanings its strictly a game mechanic? Or is it more realistic in that large amounts of, for example, if statements can eventually consume CPU?

      What does CONST CPU usage mean? I'd assume that it uses some O(1) mechanic where as others use O(n) or something similar that scales to something. But since we don't necessarily know what, it's seemingly difficult to optimize. In addition, an O(1) operation can still be a heavy operation... 

      Any insight would be great. 

      posted in Help
      computerquip
    • RE: ERR_INVALID_TARGET in very basic harvester code

      Actually, it seems the object is invalidated every tick. But I can store the unique ID of the source and fetch by that each tick (although it uses more CPU). I guess that'll have to do for now. 

      posted in Help
      computerquip
    • ERR_INVALID_TARGET in very basic harvester code

      I have very basic harvester code that does nothing but store a path and target in memory, moves to the node if it can't harvest yet, and does nothing otherwise. 

      http://hastebin.com/nuhaliyugu.avrasm

      I'm storing the result of "findClosestByPath(FIND_SOURCES_ACTIVE)" into memory, then passing that to "findPathTo". Both of these functions work just fine. They both return an object and array respectively. 

      However, whenever I tried to get the creep to harvest() the target, it gives me ERR_INVALID_TARGET. I'm not sure what else can cause this so I'm posting here.

      I'm no expert in Javascript. It could possibly be something wrong with my code that I'm simply overseeing. Any help in indicating the problem would be appreciated. 

      EDIT: For what it's worth, I've verified in the memory viewer that the location for the target is a valid energy source. If you'd like me to give a screenshot, I can... although, I don't see why the search function would give me an object that is apparently invalid. 

      posted in Help
      computerquip