Page 5 of 7 FirstFirst ... 34567 LastLast
Results 101 to 125 of 152

Thread: [OSR] Walking & positioning system

  1. #101
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    Hey Slacky I've got a question for you: have you compiled this with the newest version of Simba? If so, what have you changed? I'm having errors (Variable expected) particularly at this line in Base.pas:
    Simba Code:
    LibCV.MatchTemplate(large, sub, self.matchAlgo);
    Or any time referring to LibCV. I figure this is just an issue with Lape in the most recent Simba but I've tried everything I can think of to no avail. Do you have any suggestions to point me in the right direction?

    Edit:
    I've made progress and have it working now for the most part through a bit of sloppy modification. However I believe I have a memory leak somewhere as over time while the walker is in use Simba accumulates memory. And after X amount of times ran and stopped the map file cannot be loaded, as if it's still in use, AKA something is not being freed. I'll continue how I can but as I said before, my knowledge with Lape is quite limited.
    For the first one, I guess it's because I have the function declaration wrong, causing lape to get crancky:
    > function TLibCV.MatchTemplate(image, templ:T2DIntArray; matchAlgo: cvCrossCorrAlgo; normalize:Boolean=False): T2DFloatArray; overload;
    should be the following, I think.
    > function TLibCV.MatchTemplate(image, templ:T2DIntArray; matchAlgo: cvCrossCorrAlgo; normalize:Boolean=False): T2DFloatArray;
    Note the trailing "overload" that should not be there.

    For the second problem, that is a Simba/Lape integration issue that causes all plugins to leak, like they did som years ago.. The patch that was added a few years ago wasn't enabled in that Simba RC.
    I am not sure if Simba has updated the lape repositry to the latest commit, if it has, then it's just a matter of recompiling Simba. You can bug @Olly; in order to get a new RC out which would have the fix needed.

    I had a fixed version on my server.. But I no longer have it, I am not sure who downloaded it before I lost it, perhaps @riwu; has a copy (I can't remember who I've linked it to, but his name pops up in my head). Olly might also have a version, or another version that has the fix.
    Last edited by slacky; 01-22-2017 at 10:21 AM.
    !No priv. messages please

  2. #102
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    For the first one, I belive it's because I have the function declaration wrong, causing lape to get cracky:
    > function TLibCV.MatchTemplate(image, templ:T2DIntArray; matchAlgo: cvCrossCorrAlgo; normalize:Boolean=False): T2DFloatArray; overload;
    should be the following, I think.
    > function TLibCV.MatchTemplate(image, templ:T2DIntArray; matchAlgo: cvCrossCorrAlgo; normalize:Boolean=False): T2DFloatArray;
    Note the trailing "overload" that should not be there.

    For the second problem, that is a Simba/Lape integration issue that causes all plugins to leak, like they did som years ago.. The patch that was added a few years ago wasn't enabled in that Simba RC.
    I am not sure if Simba has updated the lape repositry to the latest commit, if it has, then it's just a matter of recompiling Simba. You can bug @Olly; in order to get a new RC out which would have the fix needed.

    I had a fixed version on my server.. But I no longer have it, I am not sure who downloaded it before I lost it, perhaps @riwu; has a copy (I can't remember who I've linked it to, but his name pops up in my head). Olly might also have a version, or another version that has the fix.
    RC6 has the plugin leak fix.
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  3. #103
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by fre View Post
    I noticed jagex has 2 or 3 versions of the world map with few pixels difference.
    It's not 2-3 different version.. there is MANY thousands, automatically generated on the go. The difference is the colors.. they vary almost every time you load the chunk, each color channel can easily vary with at least +/-15, for three channels that adds up to 27000 unique versions.
    And only to complicate tasks even more; the minimap automatically scales, going up to like 125% size, at the same time as it rotates +/- 25 degrees relative to the compass, on top of that there is dots from NPC's, characters, items and so on flocking up on the tiny minimap. Having several different maps for the same location is likely not going to help you, you might have be unfortunate with one map pick, but that's something I have yet to experience.

    RSWalker should be able to handle most of these antibot measures just fine, it makes it a little less accurate, but that's usually it.

    I noticed you said in another thread that walking is impossible without reflection. That is BS. I have had bots nearly walk all over runescape surface. Only in special scenarios has the positioning failed me, for example wilderness is really hard since it's all just gray. However, if the goal is to hit an exact tile, then you are going the wrong way about it.


    As for your code, I would assume it fails because you never free a finder, you just keep on creating finder after finder in what looks to be a loop.. Windows will get VERY angry at you for doing that, every time you create a finder you ask windows for another handle to the application, and it will only give you so many handles. The handles has to be free'd once you are done with them.
    However.. it's unreasonable to create the finder over and over again anyway. Create it once. Done. You don't need a new one that is exactly equal to the one you already have.
    Last edited by slacky; 01-22-2017 at 10:54 AM.
    !No priv. messages please

  4. #104
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    ...
    Did you test this with Simba 1.2 RC6, according to Harrier it has the leak-fix which wasn't in the rc5. I wasn't aware that a rc6 had been released.
    !No priv. messages please

  5. #105
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    Did you test this with Simba 1.2 RC6, according to Harrier it has the leak-fix which wasn't in the rc5. I wasn't aware that a rc6 had been released.
    I did indeed. I surely wasn't accusing Simba of being the culprit, especially considering the work-around I made with RSWalker to, for starters, combat the compiling issue in the newest version. I'm positive I went wrong somewhere and something I did was not being freed, even while double-checking everything; I try to be strict when it comes to freeing objects.

    So what I'll do now is return to the version of RSW I had previously and make the simple adjustment you posted above and we'll go from there. I sure do appreciate not only the help but the explanation as to why. As always your posts are helpful and informative, Slacky.

    Edit:
    Renaming LibCV to TLibCV and removing the overload just brought me back to the same compile error. What would you think about appointing a TLibCV as a variable included with the TRSPosFinder? So when used later in Base.pas we'd just do, for example:
    Simba Code:
    mat := self.cv.MatchTemplate(large, sub, self.matchAlgo);
    Assuming:
    Simba Code:
    TRSPosFinder = record
        cv: TLibCV;
    ect....
    Which is basically what I did for my previous work around, and it was functioning correctly. However doing that brings an issue of function TRSWalker.FindChunk( which also directly uses LibCV rather than calling it through the TRSPosFinder. Perhaps we could change that line to use the finder's TLibCV as such:
    Simba Code:
    corr   := finder.cv.MatchTemplate(worldSample, locSample, finder.matchAlgo);
    Do you see any problem with doing that?
    Last edited by Flight; 01-22-2017 at 03:45 PM.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  6. #106
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    I did indeed. I surely wasn't accusing Simba of being the culprit, especially considering the work-around I made with RSWalker to, for starters, combat the compiling issue in the newest version. I'm positive I went wrong somewhere and something I did was not being freed, even while double-checking everything; I try to be strict when it comes to freeing objects.
    Simba is the culprit, or rather lape.. The leakfix that exists in lape is somehow not enabled in rc6. The new way of enabling it exists within lpffi itself and that is the one part of lape I do not like looking at, I just know it worked as it should when I made my "own" rc6 by enabling the leapfix in a different way. @nielsie95;

    Quote Originally Posted by Flight View Post
    So what I'll do now is return to the version of RSW I had previously and make the simple adjustment you posted above and we'll go from there. I sure do appreciate not only the help but the explanation as to why. As always your posts are helpful and informative, Slacky.
    Go grab this release, it works around the leak issue in lape, also supports Simba 1.2rc (should be backwards compatible as well):
    https://github.com/WarPie/RSWalker/releases/tag/0.7c
    - It's not the same as what's in the repository (the source code hosted at github) - grab the RSWalker.rar

    Quote Originally Posted by Flight View Post
    What would you think about appointing a TLibCV as a variable included with the TRSPosFinder? So when used later in Base.pas we'd just do, for example:
    Simba Code:
    mat := self.cv.MatchTemplate(large, sub, self.matchAlgo);
    I dont understand why you wanna make it a local variable / don't want it to be a global variable. like it's now. The reason it uses the "LibCV" prefix is solely because I wanna avoid include-conflicts. Having it as a local variable to the finder-recrod would honestly only be an irritation, having to create a variable every time you (outside the finder and outside the walker) wanna use the MatchTemplate function, and like for no reason, it's just a dummy variable anyway.. it holds no information.
    !No priv. messages please

  7. #107
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    I dont understand why you wanna make it a local variable / don't want it to be a global variable. like it's now. The reason it uses the "LibCV" prefix is solely because I wanna avoid include-conflicts. Having it as a local variable to the finder-recrod would honestly only be an irritation, having to create a variable every time you (outside the finder and outside the walker) wanna use the MatchTemplate function, and like for no reason, it's just a dummy variable anyway.. it holds no information.
    I did that because the version of RSWalker I have never had LibCV: TLibCV = nil;, which was giving the previous compile error. I'm surprised it compiled at all before RC6, but since it did I assumed how you had it was correct. That's why I did any other alternative just to fix the first issue: the compile error. Anyways that should fix the problem I'm having I assume, thanks for your help. Sorry to clutter your thread with the posts, next time I'll drop you a PM if you'd prefer.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  8. #108
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    I did that because the version of RSWalker I have never had LibCV: TLibCV = nil;, which was giving the previous compile error. I'm surprised it compiled at all before RC6, but since it did I assumed how you had it was correct. That's why I did any other alternative just to fix the first issue: the compile error. Anyways that should fix the problem I'm having I assume, thanks for your help. Sorry to clutter your thread with the posts, next time I'll drop you a PM if you'd prefer.
    Yeah I see now, impossible to remember all previous versions of RSW. But, that trick still works, just have to declare it's methods as static (constref works but it's incorrect for this) so that is has no "self"-variable.
    Simba Code:
    type namespace = type Pointer;

    function namespace.Foo():Int32; static;
    begin
      //self doesn't exist because tihs method is static.
      Result := 10;
    end;

    begin
      WriteLn( namespace.Foo() );
    end.

    I don't mind you using this thread at all, I prefer it.
    Last edited by slacky; 01-24-2017 at 08:19 AM.
    !No priv. messages please

  9. #109
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default

    Note for those wanting to use Memscanning with OSBuddy: It only works with the OSBuddy 32bit version.

    You can get it from their cdn; http://cdn.rsbuddy.com/live/f/loader/OSBuddy.exe

    The Java/Cross Platform version should also work, just make sure you're using 32bit Java.

  10. #110
    Join Date
    Apr 2007
    Posts
    373
    Mentioned
    2 Post(s)
    Quoted
    24 Post(s)

    Default

    Is it possible to find out in what map you are.
    For example in a world map or in a dungeon?

    Because if i init a map World.init or Dungeon.init it will just give my pos relative to this map.
    So i cannot check if i am truly in this location?

    Thx for any replies.
    Last edited by fre; 05-27-2017 at 11:38 AM.
    ~Fre

  11. #111
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by fre View Post
    Is it possible to find out in what map you are.
    For example in a world map or in a dungeon?

    Because if i init a map World.init or Dungeon.init it will just give my pos relative to this map.
    So i cannot check if i am truly in this location?

    Thx for any replies.
    No, not really.. It can be done in some cases, but it's a bit complex. I'd recommend that you just keep track in your script. Like if you walked down into a dungeon, or teleported into one, then set the global variable to whatever level you are at. Something like this pseudocode.
    Simba Code:
    var
      CurWorldLevel: Int32 = 1; //1 assuming script starts at world level (dungeon would be 0)

    procedure ClimbDownLadder();
    begin
      ... do stuff
      CurWorldLevel := 0; //0 = dungeon
    end;


    procedure ClimbUpLadder();
    begin
      ... do stuff
      CurWorldLevel := 1; //back to world
    end;

    procedure WalkSomePath();
    begin
      if CurWorldLevel = 0 then
        Dungeon.WalkPath(...)
      else
        World.WalkPath(...)
    end;
    And so just continuously keep track over what level you are on.


    However it can be detected at runtime, but it's really so much more involved and might not be reliable, the steps would involve searching with both World and Dungeon map for your pos, and whichever ones returned the best match determines if you are bellow or above ground level. I will not walk your through it you'd just have to look into the source code for that, and I can't recall exactly how I've implemented it all, might need to modify RSW slighlty for it.
    !No priv. messages please

  12. #112
    Join Date
    Dec 2015
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    EDIT: seems like starting simba as admin fixed it


    hey, first of all good job, this is by far the best walking method ( at least for a noobi like me :P).
    It all worked kind of well until today. Everytime i try to init my map (using world.Init('mymap.png') i get Error: TMemScan.Init -> PID `5` does not exist (Access is denied) at line 160
    Execution failed. this error. propably on my side but you guys got any suggestions what i am doing wrong?
    Ill ad my script, which i use to get the points for my path so you can tell me if im doing something wrong.
    Would confuse me hard, cuz yesterday everything work fine
    thanks

    Simba Code:
    {$DEFINE SMART}
    {$i AeroLib/AeroLib.Simba}
    {$i Reflection/Reflection.simba}
    {$I RSWalker/Walker.simba}

    var
      tester: TRSWalker;
      MyPlayer: TReflectLocalPlayer;



    procedure test;
    var
      world: TRSWalker;

    begin
      world.Init('world.png');
      writeLn(world.GetMyPos());
    end;

    begin
      InitAL;
      Reflect.Setup;
      LoginPlayer(False);
      while 1 do
      begin
        test;
        sleep(2000);
      end;
    end.
    Last edited by nenci494; 05-30-2017 at 08:31 PM.

  13. #113
    Join Date
    Apr 2007
    Posts
    373
    Mentioned
    2 Post(s)
    Quoted
    24 Post(s)

    Default

    Why use RSWalker when you use Reflection?
    ~Fre

  14. #114
    Join Date
    Jun 2017
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Allow me to make an educated guess..
    Quote Originally Posted by nenci494 View Post
    a noobi like me

  15. #115
    Join Date
    Oct 2006
    Posts
    206
    Mentioned
    2 Post(s)
    Quoted
    45 Post(s)

    Default

    Hello Slacky,

    first off I would like to thank you for this awesome utility / include that you have written.

    Perhaps i'm not looking deep enough but I manage to face some problems sometimes.

    When I am stopping/starting the script in order to improve my script by live debugging and testing failsafes I often have to force a restart from Simba and restart the script in order to get my walking procedures working again. Sometimes the script does run and I don't get any compile errors, but it just shuts down completely by giving me an succesfully execute return value even though I just called the walker function.

    Here's a snippit of how I call ur Walker function:


    Simba Code:
    procedure GotoBank;
    begin
      if (GetCurrentState = 2) then
      begin
        Walker.Init('WorldMap');
        Walker.anyAngle := True;
        if (Walker.GetMyPos.x = 2263) and (Walker.GetMyPos.y = 4072) then
        begin
          ProgressReportEduard('[Walker] - We are at the bank!');
        end
        else
        begin
          ProgressReportEduard('[Walker] - Walking to the bank!');
          Walker.blindWalk(Point(2263, 4072));
          while (isPlayerWalking) do
            Wait(randomrange(500, 1000));
        end;
        Walker.Free;
      end;
    end;


    I also tend to have this function called in my main loop by calling it with AddOnTerminate();

    Simba Code:
    procedure MemoryPrevention;
    begin
      Walker.free;
    end;

    Is it perhaps the fact that I run simba 1100 or am I doing something else wrong. If I start the script and just let it run it will never give me that problem, it's only when i'm editing stuff and I am changing things in the script while running/terminating it.

    thanks!

  16. #116
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Are you running Simba as an administrator?
    I also noticed that I have to drag the cross-hair to the RS client a few times in between botting sessions to get it to work sometimes.

  17. #117
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Eduard View Post
    Is it perhaps the fact that I run simba 1100 or am I doing something else wrong. If I start the script and just let it run it will never give me that problem, it's only when i'm editing stuff and I am changing things in the script while running/terminating it.
    So a few points:
    Note that you setup RSW every single time you walk to the bank. That's actually bad practice, best is to setup RSW _one time_ and one time only, and that is at the setup/startup portion of the script, this is notably better considering setting up RSW with the whole world map, that takes like 10 seconds.. so now when you go to the bank it will have to wait quite a while before it even starts walking.

    Further more: "(Walker.GetMyPos.x = 2263) and (Walker.GetMyPos.y = 4072)" that's asking for your script to fail. The walker can't be pixel perfect. It's actually impossible, too many possible changes, in addition to that we compare downsampled images. Note that these coordinates are not tiles either, 1 tile is 4x4 pixels, so you are actually asking "am I on this exact fraction of this tile?", and that's not a thing, you best test if you are within some box/area, or within X distance from that point.
    Last edited by slacky; 07-31-2017 at 01:00 PM.
    !No priv. messages please

  18. #118
    Join Date
    Oct 2006
    Posts
    206
    Mentioned
    2 Post(s)
    Quoted
    45 Post(s)

    Default

    Thanks so I could basicly setup the walker with init() once on startup and then running the procedures without having to call it again.
    Also, I thought it was pixel accurate, I know understand that it's not, i'll adjust accordingly.

    Thanks for the reply!

  19. #119
    Join Date
    Jul 2017
    Posts
    21
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Hey Slacky, I'm experiencing some issues with RSWalker im not sure what I'm doing wrong, could you have a look at this and tell me if anything is out of order? Thanks

    Simba Code:
    program Walking;
    //{$DEFINE SMART}
    {$DEFINE Walker}
    {$i AeroLib/AeroLib.Simba}




    var
      BronzePick:TItem;
      pnt:tpoint;
      RSW: TRSWalker;
      path: TPointArray;


    Procedure Login
    begin
      Me.Active := True;
      Me.Name := '';
      Me.Pass := '';
      Me.Member := False;
    end;

    Procedure LoadItem;

    begin
    BronzePick.DTM := DTMFromString('mAAEAAHic42FgYOADYkYgZgNiTgYIYAZiViBmAWJuIBYFYgkgFoaqZWRAAEkgFgdiESDmBWIOKGaH6k/w1EHShRsbKCiAaUkG0gBhk1ExMgAAhTYCZA==');
    end;

    Procedure UseItem;
    Begin
      if BronzePick.InInventory then
        WriteLn('Found Item in Invetory yeah!');
      if Bronzepick.interact(Mouse_Left) then
        WriteLn('We have the pick!');

    end;
    procedure Move

    begin
      pnt := [331,162];
      HumanMMouse(pnt, 5, 5);
      GameTab(TAB_INV);
      GameTab(TAB_STATS);
    end;



    begin
      initAl();
      Login;
      if (not isLoggedIn()) then
        loginPlayer(false);
      LoadItem;
      UseItem;
      Move;
      RSW.Init('WorldMap');
      RSW.walkStyle := wsSPS;
      RSW.anyAngle  := True;
      RSW.skipClose := 15;
      path := [Point(4536,2943),Point(4518,2907),Point(4494,2847)];
      RSW.WalkPath(path);

      RSW.Free();


    end.

    This is the error message I get everytime, the walker was working at first but it seemed to stop after a few uses.

    Error: Out of memory at line 93
    Execution failed.
    The following DTMs were not freed: [0]
    The following bitmaps were not freed: [0, 1, 2]

    If you could help I'd really appreciate it! Thanks

  20. #120
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by jokerface25 View Post
    Hey Slacky, I'm experiencing some issues with RSWalker im not sure what I'm doing wrong, could you have a look at this and tell me if anything is out of order? Thanks

    Simba Code:
    program Walking;
    //{$DEFINE SMART}
    {$DEFINE Walker}
    {$i AeroLib/AeroLib.Simba}




    var
      BronzePick:TItem;
      pnt:tpoint;
      RSW: TRSWalker;
      path: TPointArray;


    Procedure Login
    begin
      Me.Active := True;
      Me.Name := '';
      Me.Pass := '';
      Me.Member := False;
    end;

    Procedure LoadItem;

    begin
    BronzePick.DTM := DTMFromString('mAAEAAHic42FgYOADYkYgZgNiTgYIYAZiViBmAWJuIBYFYgkgFoaqZWRAAEkgFgdiESDmBWIOKGaH6k/w1EHShRsbKCiAaUkG0gBhk1ExMgAAhTYCZA==');
    end;

    Procedure UseItem;
    Begin
      if BronzePick.InInventory then
        WriteLn('Found Item in Invetory yeah!');
      if Bronzepick.interact(Mouse_Left) then
        WriteLn('We have the pick!');

    end;
    procedure Move

    begin
      pnt := [331,162];
      HumanMMouse(pnt, 5, 5);
      GameTab(TAB_INV);
      GameTab(TAB_STATS);
    end;



    begin
      initAl();
      Login;
      if (not isLoggedIn()) then
        loginPlayer(false);
      LoadItem;
      UseItem;
      Move;
      RSW.Init('WorldMap');
      RSW.walkStyle := wsSPS;
      RSW.anyAngle  := True;
      RSW.skipClose := 15;
      path := [Point(4536,2943),Point(4518,2907),Point(4494,2847)];
      RSW.WalkPath(path);

      RSW.Free();


    end.

    This is the error message I get everytime, the walker was working at first but it seemed to stop after a few uses.

    Error: Out of memory at line 93
    Execution failed.
    The following DTMs were not freed: [0]
    The following bitmaps were not freed: [0, 1, 2]

    If you could help I'd really appreciate it! Thanks
    I've had the issue of running out of memory before while using RSWalker, especially when loading "WorldMap". In my own experience I found it's from loading and freeing a large map multiple times with a single instance of Simba. This may be caused from testing & running a script that loads such a large map file, and even though you free it correctly in your example script you're still getting that error. And while I can't explain the cause, I can recommend simply saving your script and restarting Simba itself. You don't have to close out your SMART (if you're using it), just a simple restart of Simba to free anything that's chewing up memory.

    Also after looking at the script I notice you're not freeing the BronzePick.DTM. Don't forget, all DTMs and Bitmaps must be freed when the script terminates. That's probably not the issue you're running into in this case, but it could contribute.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  21. #121
    Join Date
    Jul 2017
    Posts
    21
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    I've had the issue of running out of memory before while using RSWalker, especially when loading "WorldMap". In my own experience I found it's from loading and freeing a large map multiple times with a single instance of Simba. This may be caused from testing & running a script that loads such a large map file, and even though you free it correctly in your example script you're still getting that error. And while I can't explain the cause, I can recommend simply saving your script and restarting Simba itself. You don't have to close out your SMART (if you're using it), just a simple restart of Simba to free anything that's chewing up memory.

    Also after looking at the script I notice you're not freeing the BronzePick.DTM. Don't forget, all DTMs and Bitmaps must be freed when the script terminates. That's probably not the issue you're running into in this case, but it could contribute.
    Well it seemed to fix it for now Hopefully it continues to work! Thanks Flight.

  22. #122
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Do you have build instructions? I was able to link MatchTempl against OpenCV 2.4.9 dynamically, but there are issues with static linking. I will add the exact failures here on Monday, but regardless it would help to know how you produced your binaries (mostly MatchTempl).

    Here is the mirror that I am working from. The main addition is a Makefile. I am targetting x86_64.

    Unrelated to this thread, but if you could add some more explicit instructions for using your produced Simba builds, that would be helpful.

    Code:
    $ mingw32-make.exe
    x86_64-w64-mingw32-g++ -Wall -std=c++11 -DBUILD_DLL -shared -Iopencv/build/install/include -Lopencv/build/install/x64/mingw/staticlib -Lopencv/build/3rdparty/lib -luser32 -lopencv_calib3d249 -lopencv_contrib249 -lopencv_core249 -lopencv_features2d249 -lopencv_flann249 -lIlmImf -llibtiff -llibpng -llibjpeg -llibjasper -lzlib -lopencv_gpu249 -lopencv_highgui249 -lopencv_imgproc249 -lopencv_legacy249 -lopencv_ml249 -lopencv_nonfree249 -lopencv_objdetect249 -lopencv_ocl249 -lopencv_photo249 -lopencv_stitching249 -lopencv_superres249 -lopencv_video249 -lopencv_videostab249 -lcomctl32 -lvfw32 -o libMatchTempl.dll main.cpp MatchTempl.cpp MatchTempl.hpp
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text+0x8a): undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text+0x2af): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text+0x2c2): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text+0x2de): undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text+0x611): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text+0x627): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text+0x63c): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text+0x65c): undefined reference to `cv::matchTemplate(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, int)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text+0x685): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text+0x69e): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text+0x6b7): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text+0x6f6): undefined reference to `cv::normalize(cv::_InputArray const&, cv::_OutputArray const&, double, double, int, int, cv::_InputArray const&)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text$_ZN2cv3MatD1Ev[_ZN2cv3MatD1Ev]+0x36): undefined reference to `cv::fastFree(void*)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text$_ZN2cv3MataSERKS0_[_ZN2cv3MataSERKS0_]+0x11f): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text$_ZNK2cv3Mat5cloneEv[_ZNK2cv3Mat5cloneEv]+0x2b): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text$_ZNK2cv3Mat5cloneEv[_ZNK2cv3Mat5cloneEv]+0x3b): undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text$_ZN2cv3Mat6createEiii[_ZN2cv3Mat6createEiii]+0x90): undefined reference to `cv::Mat::create(int, int const*, int)'
    C:\Cygwin64\tmp\ccl9rggZ.o:MatchTempl.cpp:(.text$_ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x48): undefined reference to `cv::Mat::deallocate()'
    collect2.exe: error: ld returned 1 exit status
    mingw32-make: *** [Makefile:76: all] Error 1
    Last edited by R0b0t1; 12-26-2017 at 10:22 PM.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  23. #123
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    You need to have a talk with @Brandon regarding that. IIRC he helped me with the static build.
    !No priv. messages please

  24. #124
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    @slacky, I PMed @Brandon but he seems to be away. He might get back to me after the holidays, but if you remember anything else in the meantime it will help.

    I think I was able to port MatchTempl forward to OpenCV 3.4.0, but I still receive strange linking errors:

    Code:
    $ mingw32-make.exe
    x86_64-w64-mingw32-g++ -Wall -std=c++11 -DBUILD_DLL -shared -Iopencv/build/install/include -Lopencv/build/install/x64/mingw/staticlib -Lopencv/build/3rdparty/lib -luser32 -lcomctl32 -lvfw32 -lIlmImf -llibjasper -llibjpeg -llibpng -llibprotobuf -llibtiff -llibwebp -lopencv_aruco340 -lopencv_bgsegm340 -lopencv_bioinspired340 -lopencv_calib3d340 -lopencv_ccalib340 -lopencv_core340 -lopencv_datasets340 -lopencv_dnn340 -lopencv_dpm340 -lopencv_face340 -lopencv_features2d340 -lopencv_flann340 -lopencv_fuzzy340 -lopencv_highgui340 -lopencv_img_hash340 -lopencv_imgcodecs340 -lopencv_imgproc340 -lopencv_line_descriptor340 -lopencv_ml340 -lopencv_objdetect340 -lopencv_optflow340 -lopencv_phase_unwrapping340 -lopencv_photo340 -lopencv_plot340 -lopencv_reg340 -lopencv_rgbd340 -lopencv_saliency340 -lopencv_shape340 -lopencv_stereo340 -lopencv_stitching340 -lopencv_structured_light340 -lopencv_superres340 -lopencv_surface_matching340 -lopencv_text340 -lopencv_tracking340 -lopencv_video340 -lopencv_videoio340 -lopencv_videostab340 -lopencv_xfeatures2d340 -lopencv_ximgproc340 -lopencv_xobjdetect340 -lopencv_xphoto340 -lzlib -o libMatchTempl.dll main.cpp MatchTempl.cpp MatchTempl.hpp
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text+0x5d): undefined reference to `cv::imread(cv::String const&, int)'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text+0x294): undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text+0x5f4): undefined reference to `cv::noArray()'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text+0x65d): undefined reference to `cv::matchTemplate(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, int, cv::_InputArray const&)'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text+0x71a): undefined reference to `cv::normalize(cv::_InputArray const&, cv::_InputOutputArray const&, double, double, int, int, cv::_InputArray const&)'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text$_ZN2cv6StringC1EPKc[_ZN2cv6StringC1EPKc]+0x51): undefined reference to `cv::String::allocate(unsigned long long)'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text$_ZN2cv6StringD1Ev[_ZN2cv6StringD1Ev]+0x11): undefined reference to `cv::String::deallocate()'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text$_ZN2cv3MatC1EiiiPvy[_ZN2cv3MatC1EiiiPvy]+0x122): undefined reference to `cv::error(int, cv::String const&, char const*, char const*, int)'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text$_ZN2cv3MatC1EiiiPvy[_ZN2cv3MatC1EiiiPvy]+0x207): undefined reference to `cv::error(int, cv::String const&, char const*, char const*, int)'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text$_ZN2cv3MatD1Ev[_ZN2cv3MatD1Ev]+0x36): undefined reference to `cv::fastFree(void*)'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text$_ZNK2cv3Mat5cloneEv[_ZNK2cv3Mat5cloneEv]+0x3b): undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text$_ZN2cv3Mat6createEiii[_ZN2cv3Mat6createEiii]+0x90): undefined reference to `cv::Mat::create(int, int const*, int)'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text$_ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x48): undefined reference to `cv::Mat::deallocate()'
    C:\Cygwin64\tmp\ccG5K8IR.o:MatchTempl.cpp:(.text$_ZN2cv3MataSEOS0_[_ZN2cv3MataSEOS0_]+0xe9): undefined reference to `cv::fastFree(void*)'
    collect2.exe: error: ld returned 1 exit status
    mingw32-make: *** [Makefile:135: all] Error 1
    If you look at the Makefile I created, the libraries that contain at least some of these functions are being linked in (e.g. cv::matchTemplate is in opencv_imgproc340). OpenCV has been reorganized since 2.4.9; notably, the external contributions produce their own libraries and are not all one object. Certain other libraries seem to have been combined with each other or removed. If you could look at MatchTempl and see which libraries are actually required it would help. What used to be there seems to be sufficient, but I link against all available libraries, which is what the Code::Blocks project seems to have been doing.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  25. #125
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    What used to be there seems to be sufficient, but I link against all available libraries, which is what the Code::Blocks project seems to have been doing.
    Link order matters a lot. Especially with the GNU linker. You should also probably put your files before the libraries and omit the header file. That command does seem quite butchered.
    Last edited by Kasi; 12-29-2017 at 05:45 AM.

Page 5 of 7 FirstFirst ... 34567 LastLast

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •