Log in

View Full Version : DTMs are SLOW



DeSnob
11-19-2011, 10:27 PM
I understand, it's not too easy to search for. However, can anyone explain to me why my fps drops like crazy while SMART is running after it searches? I free the DTM and use it correctly; however, even after it's done searching and just sits idle, it'll lag like crazy. The lag only stops when I turn the script off. It seems like there's a memory issue with DTMs. (I only have 2 Gigs of mem in my temp computer)

E: By the way, this is what I'm testing.
program new;
{$define SMART}
{$i SRL\SRL.scar}

var
x, y: integer;

procedure DeclarePlayers;
Begin
HowManyPlayers := 2;
NumberOfPlayers( HowManyPlayers);
CurrentPlayer := 0;

End;

procedure dtm;
var
d: integer;
Found: extended;
begin
d := DTMFromString('mbQAAAHicY2VgYNjFzMCwmxlCLwDiy0C8FS g+A4ivA/F2IN4ExF/ff0bFjOwMRkBxdMyIBYMBAGE5FJw=');
//:= DTMFromString('mQwAAAHicY2ZgYNjFjMBbgfwZQHwdiL++/wzHRkA+DHMBMSMUAwEAF7QNhg==');
if FindDTMRotated(d, x, y, mmx1, mmy1, mmx2, mmy2, 0, 360, 1, found) then
begin
Writeln('X = ' + IntToStr(x));
Writeln('Y = ' + IntToStr(y));
end else
Writeln(':(');
FreeDTM(d);
end;

begin
Smart_Server := 10;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
SetUpSRL;
ActivateClient;
DeclarePlayers;
LogInPlayer;
dtm;
Mouse(x, y, 5, 5, True);
repeat

until(not(LoggedIn));
end.

noidea
11-19-2011, 10:31 PM
Which function are you using to search for the dtm?
I remember when i tried to use it eons ago, dtmrotated() was very very slow in some cases.

DeSnob
11-19-2011, 10:33 PM
Which function are you using to search for the dtm?
I remember when i tried to use it eons ago, dtmrotated() was very very slow in some cases.

Is there any efficient alternatives? :S I've gotta search the minimap for a chicken pen.

YoHoJo
11-19-2011, 11:19 PM
Why not use SPS for walking? Not accurate enough?
DTM rotated I bet is a bit laggy yeah, I think you're going form 0-360, why so many angles? As long as compass is in same angle you don't have to do 0-360, you can just do like 30 degrees or something.

Wizzup?
11-19-2011, 11:25 PM
http://docs.villavu.com/simba/scriptref/dtm.html#finddtmrotatedse

AngleStep of 1 with Start/End angle at 0-360 means it will do 360 normal FindDTM searches.

Regardless, Simba version?

Wizzup?
11-19-2011, 11:31 PM
Hang on... I think I know why this is lagging.

You have:


repeat

until (not loggedin);


Are you sure it is not lagging there?

DeSnob
11-19-2011, 11:51 PM
Hang on... I think I know why this is lagging.

You have:


repeat

until (not loggedin);


Are you sure it is not lagging there?

Wow.. I'm so stupid. I should probably use fresh "skeletons" to test scripts right? :p Works fine now.
E: Also, I need it to check through the whole compass because the angles in the script are so different because it constantly changes the angle.

YoHoJo
11-19-2011, 11:52 PM
Was it really that causing the lag..? Seems weird since there's nothing between those two lines.

Tickyy
11-19-2011, 11:57 PM
The best thing is, don't use DTMs at all :p, just like my Superheater :p.

Wizzup?
11-20-2011, 12:31 AM
Was it really that causing the lag..? Seems weird since there's nothing between those two lines.

That's the point. It'll just keep calling LoggedIn. Which will keep returning 'False' -> not False = True -> Repeat.

YoHoJo
11-20-2011, 12:34 AM
Oh yeah, It's not an Until(false), got it!