SRL Archive - Research & Development Lounge

New Walking Method


NKN

2012-09-18 21:03:36

A few days ago I had an idea to make a new type of walking.

Edit:
Got a basic version of it to work. Still tuning it to be more accurate.
This is how it should work:


TPA starts at MMCX,MMCY
Generates a DDTM of the area around you inside the script itself, marking the center of the minimap. (Blocks out the white dot that you are by checking if a point is in the Minimap dot of your character.)
You then move, and it searches for said DDTM.
It checks the distance between the two, generating a point.
It can then walk using that point.
(Right now, this is as far as I got. It walks back to the starting spot every time.)
Things I intend to add:
Reverse the process, making it walk forward instead of back.
Make a function that tells you the tpoint that you should walk to.
Make a walkpath and walktopoint function much like SPS


I don't know if this will even work, it's in early development stage. Leave any ideas/tips below?

I wanted to try and make a new way to walk. SPS needs maps, and only works in some areas, if it doesn't you need to make a new map, which some users can't do.
RadialWalk and DDTM's take a long time to set up, and can fail.
ObjDTM's require things around you, and never really worked well for me when I tried to use it.(In the wilderness.)

Edit: Here's what I got so far. It doesn't have many failsafes, this is just two hours of me starting it. D:
program new;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i srl/srl/misc/SmartGraphics.simba}
{$i SPS/SPS.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;
function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..2] of TDTMPointDef;
TempTDTM: TDTM;
SB : TBox;
TP,TP1 : TPoint;
begin
SB := IntToBox(MMCX - 7,MMCY - 7,MMCX + 7,MMCY + 7);
repeat
TP.x := randomRange(SB.X1,SB.X2);
TP.y := randomRange(SB.y1,SB.y2);
until(not(PointInBox(TP,IntToBox(625,133 - 50,629,137 - 50))))

dtmMainPoint.x := TP.x;
dtmMainPoint.y := TP.y;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := GetColor(TP.x,TP.y);
dtmMainPoint.Tolerance := 15;
SMART_DrawDot(True,TP,clPurple);
TP1.x := TP.x + randomrange(5,12);
TP1.y := TP.y + randomrange(5,12);

dtmSubPoints[0].x := TP1.x;
dtmSubPoints[0].y := TP1.y;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := GetColor(TP1.x,TP1.y);
dtmSubPoints[0].Tolerance := 15;
TP1.x := TP.x - randomrange(5,12);
TP1.y := TP.y - randomrange(5,12);
SMART_DrawDot(False,TP1,clPurple);

dtmSubPoints[1].x := TP1.x;
dtmSubPoints[1].y := TP1.y;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := GetColor(TP1.x,TP1.y);
dtmSubPoints[1].Tolerance := 15;
TP1.x := TP.x - randomrange(5,12);
TP1.y := TP.y - randomrange(-5,5);
SMART_DrawDot(False,TP1,clPurple);

dtmSubPoints[2].x := TP1.x;
dtmSubPoints[2].y := TP1.y;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := GetColor(TP1.x,TP1.y);
dtmSubPoints[2].Tolerance := 15;
SMART_DrawDot(False,TP1,clPurple);


TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
procedure GetMyPos;
var
x,y,xp,yp,tx,ty,i,theWalk:integer;
myPos,op:TPoint;
theAngle:Extended;
begin
myPos := Point(0,0);
theWalk:=SetDDTM;
if(FindDTMRotated(theWalk,xp,yp,MMCX - 13,MMCY - 13,MMCX + 13,MMCY + 13,-pi/2,pi/2,0.1,theAngle)) then
begin
FindSymbol(tx,ty,'Bank');
Mouse(tx,ty,4,4,1);
FFlag(0);
while(isMoving) do
begin
wait(100);
end;
if(FindDTMRotated(theWalk,x,y,MMX1,MMY1,MMX2,MMY2,-pi/2,pi/2,0.1,theAngle)) then
begin
myPos.x :=myPos.x + (x - xp)
mypos.y := myPos.y + (y - yp)
writeln(ToStr(myPos) + 'dsfads');
mouse(MMCX + (mypos.x),MMCY + (mypos.y),1,1,1);
end;
end;

end;
function WalkToSpot:Boolean;
var
x,y,i,theWalk:integer;
FoundDTM:Boolean;
theAngle:Extended;
begin
theWalk:=SetDDTM;
SMART_DrawBoxEx(True,False,IntToBox(MMCX - 13,MMCY - 13,MMCX + 13,MMCY + 13),clRed);
if(FindDTMRotated(theWalk,x,y,MMCX - 13,MMCY - 13,MMCX + 13,MMCY + 13,-pi/2,pi/2,0.1,theAngle)) then
begin
FreeDTM(theWalk);
result := true;
mouse(x,y,1,1,1);
FFlag(0);
While(IsMoving) do
Wait(100);
end;
end;







procedure Mainloop;
begin
GetMyPos;

end;

begin
{$IFDEF SMART}
SRL_SIXHOURFIX := TRUE;
SMART_FIXSPEED := TRUE;
{$ENDIF}

ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
ClickNorth(SRL_ANGLE_HIGH);
Mainloop;
end.

Cheers. :garfield:

Vinyl Scratch

2012-09-18 21:17:24

Nice! Can't wait for this to flourish. Hope this turns out great, man.

I tried to rep+. Won't let me, I would if I could, but I can't, so I'll wait until I can.

Silentcore

2012-09-18 21:38:53

Nice Job, Looking forward to this sometime.

Noob King

2012-09-19 00:48:29

Care to upload a little demo video?

Abu

2012-09-19 02:23:13

I don't get it, is it DDTM walking? Coz that exists you know… :confused:

CynicRus

2012-09-19 03:26:13

I honestly did not catch the essence of the idea. If you decided to create a new kind of walking, better rewrite the SPS that it does not depend on the color and contours used for reconnaissance.

tristen8878

2012-09-19 05:22:27

I'll try this out later when I get home looks interesting

P1ng

2012-09-19 05:29:05

So this would be (at present) only for moving small distances within the same confined space, no?

NKN

2012-09-19 06:29:21

From: P1ng
So this would be (at present) only for moving small distances within the same confined space, no?


Currently, yes.

From: abu_jwka
I don't get it, is it DDTM walking? Coz that exists you know… :confused:

It's sort of DDTM walking. When it's finished, it'll be like SPS, you use GetMyPos to get points, then use the points for walking. It's simpler that making your own case of DDTM's, and should be more accurate if the colors change on the minimap.
From: CynicRus
I honestly did not catch the essence of the idea. If you decided to create a new kind of walking, better rewrite the SPS that it does not depend on the color and contours used for reconnaissance.

It's a SPS like program. Trying to make it run like SPS, but without the need for maps, so if the SPS map is outdated, and you can't make your own, you can use this.

BigFate

2012-09-19 06:42:59

This seems like a clever idea, very nice +rep!

litoris

2012-09-19 07:39:18

Wait so this basically gets colors around the center radomly to create the DDTM? It could go wrong in so many ways.
-If one of the points happens to be the red from an item, yellow from an NPC or white from a player, walking fails
-If, after you click, the map reloads(ie you have already been walking for a while) then the DDTM is broken
-It will be worse than radialwalk in terms of speed because you have to move to a point and then stop, gather colors all over again and click. Very bot-like.

It'd be much more useful if you spent your energy trying to fix SPS.

Olly

2012-09-19 13:20:02

From: litoris

It'd be much more useful if you spent your energy trying to fix SPS.


What is wrong with SPS?

litoris

2012-09-19 13:36:17

From: Ollybest
What is wrong with SPS?


The way maps are compared to the minimap. Even with custom maps and high tolerance it can screw up. Customs maps in areas with different colors still work reasonably well though.
Most devs are inactive, and not many people have the knowledge and time to fix it all.

Olly

2012-09-19 14:00:21

From: litoris
The way maps are compared to the minimap. Even with custom maps and high tolerance it can screw up. Customs maps in areas with different colors still work reasonably well though.
Most devs are inactive, and not many people have the knowledge and time to fix it all.


Eh ive never had a problem with it.. I think its perfect with custom maps, Your never going to get colour walking perfect :S

Le Jingle

2012-09-19 14:08:59

I'm unsure, but I think I've seen the RS MiniMap zoom itself in and out, at least that's what I think when my map drastically changed the last custom map I was making :s

Also, On Topic –> I think that DDTM walking might be somewhat useful; it seems to rely on SPS, as stated it's similar, but nonetheless if you feel totally adamant about the subject, do some interesting work!

Olly

2012-09-19 14:40:31

From: Le Jingle
I'm unsure, but I think I've seen the RS MiniMap zoom itself in and out, at least that's what I think when my map drastically changed the last custom map I was making :s

Also, On Topic –> I think that DDTM walking might be somewhat useful; it seems to rely on SPS, as stated it's similar, but nonetheless if you feel totally adamant about the subject, do some interesting work!


There's always been huge tolerance/zooming etc with the minimap :P nothing new.

Sir Ducksworthy

2012-09-19 15:42:45

I've found certain AI, in combination with Color to be the most effective out of every single possible thing I've been able to fathom having any real success and use.
Here's a snippet of some Web, notice how It is all interconnected, so it will always know which direction and approach to get by any obstacles, but it goes beyond that to just basic human common sense like using text's around the character by just filtering out Land Pixels to know where to move to objects and then compare things constantly with a Database, which works extremely fast since things don't need to clog up your RAM etc so much, I was startled by the efficiency I had no idea basically what to expect:
Mmm:

Like:


Yeh, just keep thinking outside the box NKN, your definitely on the right track. :)
I apologize for what I keep underground these days their is a lot I'd like to let loose, tbh but you know how it goes with the scene these days, people love stealing work of others to profit off, make sure 2 Be weary of that.

NKN

2012-09-19 16:57:37

Oh well.
It's just an idea I came up with, and I want to see how far I can get it. I could probably add failsafes for the dots, I already added one to make sure any point of the DDTM isn't the same color as any other one.

As for SPS issue. I'm absolutely terrible at making custom SPS maps, so I wanted an alternative.

Maybe once It's finished I can make it search without having to stop, just when the flag is gone, or when you're close to it.

If the minimap reloads, you could always do a check. If the minimap clolor count of black is over a certain amount, the map is reloading, subtract one to the path you were moving to and continue.

Keep thoughts coming. :)

Runaway

2012-09-19 17:06:29

I've been working on something similar lately. Instead of checking around the character, it checks around the mouse (before clicking) and grabs the most unique colors in a circle around it. I think a combination of both methods would be a great way to make on-the-go walk paths :)

I definitely think you should add the origin as a parameter:


function SetDDTM(Origin: TPoint): Integer;

so that you can use it in more scenarios.

NKN

2012-09-19 18:45:57

From: Runaway


I definitely think you should add the origin as a parameter:


function SetDDTM(Origin: TPoint): Integer;

so that you can use it in more scenarios.

Not catching you here.

Runaway

2012-09-19 19:58:44

Like this:


function SetDDTM(Origin: TPoint): Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..2] of TDTMPointDef;
TempTDTM: TDTM;
SB : TBox;
TP,TP1 : TPoint;
begin
SB := IntToBox(Origin.x - 7, Origin.y - 7, Origin.x + 7, Origin.y + 7);
// ...

So you can call it with whatever center point you want to use:


aDDTM[0] := SetDDTM(Point(MMCX, MMCY));

// or:

GetMousePos(M.x, M.y);
aDDTM[0] := SetDDTM(M);

Catch my drift?

NKN

2012-09-19 21:22:41

Oh, I get it now.

Sir Ducksworthy

2012-09-20 09:33:51

It's an awesome Idea NKN, Look forward to seeing more of it <3

BigFate

2012-09-20 13:32:07

I like your idea Sir Ducksworthy of having an interconnected web. It would be nice if it acted like a template (like a layer on top of the map) and it would only click points that are on the web when walking. The tricky part would be placing the web in the correct position and finding out where you are in the first place other than that making walking paths would be quite easy.

NKN

2012-09-20 18:04:47

I think I got it to work.
Let me test it, and if it does work, I'll see about uploading a video,

KeepBotting

2012-09-20 21:02:31

So basically it's SPS without the need for maps?
I likey. Rep+.

NKN

2012-09-20 21:07:38

Currently, the only way to gather points is to use a form, and click "New Point" everytime you want a new point. I don't know how to detect when it moved, but I'll solve that in a later update. ;)

Ontopic: Should be working, found main problem. I derped, and didn't know Mouse() added 50 to your points. If I have time, I'll try and run a video of Edgeville to GE.