Navigation

    forum

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

    fazan

    @fazan

    34
    Posts
    1150
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    fazan Follow

    Posts made by fazan

    • Game is not defined

      After I put a flag in simulation room at 500% speed, messages like that appeared in the console for a few seconds from one of my modules where Game.rooms was used in a function.

      posted in Technical Issues and Bugs
      fazan
    • RE: universal getUsedCpu
      var usedOnStart = 0;
      usedOnStart = getUsedCpu ();
      
      function getUsedCpu ()
      {
          return Game.rooms.sim ? performance.now () - usedOnStart : Game.getUsedCpu ();
      }
      
      posted in General Discussion
      fazan
    • universal getUsedCpu

      Put this in the beginning of your script to have a getUsedCpu function which works in the simulation mode:
      ```javascript
      var usedOnStart = 0;
      usedOnStart = getUsedCpu ();

      function getUsedCpu ()
      {
      return Game.rooms.sim ? performance.now () - usedOnStart : Game.getUsedCpu ();
      }
      ```

      posted in General Discussion
      fazan
    • RE: Recommend a lightweight pathfinding library

      Great! Very helpful. But one question: how do you deal with moving targets, like creeps? I didn't see that handled in the code.

      posted in Help
      fazan
    • Recommend a lightweight pathfinding library

      So, I need to optimize my pathfinding, and I'd like to get to that from both ends (both the algorithm and caching), so I've been looking for a good library to do the thing for some time, unsucessfully. So, can anyone recommend a small (a file or two) and fast js pathfinding library with support of movement costs?

      posted in Help
      fazan
    • RE: A potential very fast js pathfinder algorithm

      @Actium What algorithm did you use for your pathfinder?

      posted in General Discussion
      fazan
    • RE: Cache results

      Ohh... markdown
      javascript
      var Foo = function (room)
      {
      global.Cache = global.Cache || {};
      global.Cache.rooms = global.Cache.rooms || {};
      global.Cache.rooms [room] = global.Cache.rooms [room] || {};
      global.Cache.rooms [room].FunctionName = global.Cache.rooms [room].FunctionName || FunctionCode;
      return global.Cache.rooms[room].FunctionName;
      }

      posted in Help
      fazan
    • RE: Cache results

      Like this?
      javascript
      Function = function (room)
      {
      global.Cache = global.Cache || {};
      global.Cache.rooms = global.Cache.rooms || {};
      global.Cache.rooms [room] = global.Cache.rooms [room] || {};
      global.Cache.rooms [room].FunctionName = global.Cache.rooms [room].FunctionName || FunctionCode;
      return global.Cache.rooms[room].FunctionName;
      }

      posted in Help
      fazan
    • RE: RoomPosition.findClosestByRange () filtering broken?

      @chris Sorry, but there are no calls of 'filter' in the first example. There I pass an object with a property called 'filter' which holds a function definition. Do I miss something?

      posted in Technical Issues and Bugs
      fazan
    • RE: What happens when a creep is not on path specified by moveByPath?

      Oh, thanks, it wasn't in the documentation yesterday

      posted in Help
      fazan