SRL Archive - SRL Archives

Trig Walking!!


Hobbit

2007-04-24 01:06:17

Ok I thought of something last night while I was crafting fires. Places where there are a lot of mimimap symbols, we coul do something like Radial walk but maybe mroe accurate. I don't know how to make it but I'm sure you guys could figure it out. Here are some pics. I will explain them below.

Ok, so for the first one, you choose the 3 minimap symbols by like bitmaps or something. then it makes sure you are in the center of the red triagle. then useing 2 of the previous symbols and another one it finds another triangle(blue this time) and clicks in the center so the flag would be where the blue dot is.



Now for this picture notice that the Blue tirangle from the previous one is now the red one. So it will make sure you are in the right place. Then draws does the same thing again. Then once you get out of an area you could use this in you use radial walk or something.



So what do you guys think? Please post comments.

TheGodfather

2007-04-24 01:33:33

Now if that made a bit more sense I'd love it. Can you formulate it in a really simple form for the simpletons can understand?

danrox2004

2007-04-24 02:03:06

You could use something like:
procedure findmiddle(var x, y: integer; ax, ay, bx, by, cx, cy: integer);
begin
x := (ax + bx + cx) / 3;
y := (ay + by + cy) / 3;
end;

procedure MiddleofSymbols(var x, y: integer; S1, S2, S3: string);
var
ax,ay,bx,by,cx,cy: integer;
begin
FindSymbol(ax, ay, s1);
FindSymbol(bx, by, s2);
FindSymbol(cx, cy, s3);
FindMiddle(x, y, ax, ay, bx, by, cx, cy);
end;

usage = MiddleOfSymbols(x, y, 'tanner', 'bank', 'danger');
then you could Mouse(x, y, True); and FFlag(5);

Boreas

2007-04-24 04:16:58

Dude! That's so crazy. I had that idea yesterday in the shower.

Anyway, Godfather it's called triangulation.

Let's say there's a small earthquake somewhere, a tremor (red dot). 1234 miles away, an earthquake detection center (A) senses the vibration, and from the timing of the vibrations, it can tell that the earth quake is 1234 miles away.


You know that the earthquake is somewhere along the black line, but you don't know where.

Then another place detects how far away it is, and you know its somewhere along that circle. There are only 2 possible places that work for both, (yellow dots).


Get the radius from another spot, and now there's only 1 possible spot that satisfies all 3 distances.

So basically, a point can be defined by it's distances from 3 other points.

c0de

2007-04-24 06:05:08

From: Boreas
Dude! That's so crazy. I had that idea yesterday in the shower.

That made me laugh!

Very nice idea, but do you think it will work with all those symbols moving?

Ruroken

2007-04-24 07:34:39

I like it!

Make it work :)

SKy Scripter

2007-04-24 09:58:19

Very nice idea, but do you think it will work with all those symbols moving?


yah agree those symbols move alot ;)
i dont think it will work that easly…

Hobbit

2007-04-24 18:59:25

From: c0de
That made me laugh!

Very nice idea, but do you think it will work with all those symbols moving?


it would still work because they dont move that much. and it would still be able to trianglulate to the next set if you have one set.

@Boreas:

Great minds think alike :)…you think you'd be able to write it? i know i wouldn't be able to but i might be able to help.

Boreas

2007-04-24 22:22:33

I'll add this to my list, so that it can be used for symbols, or for anything else:

Find the point that is A distance way from PtA, B distance away from PtB and C distance away from PtC

(A,B,C:integer; PtA, PtB, PtC: tpoint): tpoint

Hobbit

2007-04-25 00:45:20

Yah that sounds like it would work. but how hard do you think it would be to actually make?

Boreas

2007-04-25 00:48:01

It won't be the hardest or the easiest thing I've made.

Hobbit

2007-04-25 00:48:53

Ok, I'd like to help if you can find anything for me to do. I think it would be a great learning experience.

Add me on msn if you do. B'cause i'll be a bit busy this week until sunday

danrox2004

2007-04-26 06:17:43

Wouldn't this work?
procedure findmiddle(var x, y: integer; ax, ay, bx, by, cx, cy: integer);
begin
x := (ax + bx + cx) / 3;
y := (ay + by + cy) / 3;
end;

procedure MiddleofSymbols(var x, y: integer; S1, S2, S3: string);
var
ax,ay,bx,by,cx,cy: integer;
begin
FindSymbol(ax, ay, s1);
FindSymbol(bx, by, s2);
FindSymbol(cx, cy, s3);
FindMiddle(x, y, ax, ay, bx, by, cx, cy);
end;
and you just do MiddleOfSymbols(x, y, 'tanner', 'cook', 'tree'); or whatever

Edit: Oh right your moving the point around instead of the middle

Hobbit

2007-04-27 19:08:29

that might work for part of it but it still needs to refernece itself to make sure its in the begining triangle as a failsafe.

danrox2004

2007-04-27 23:17:45

From: Hobbit
that might work for part of it but it still needs to refernece itself to make sure its in the begining triangle as a failsafe.


repeat
MiddleOfSymbols(x, y, 'Tanner', 'Crafter', 'Gems');
Mouse(x, y, 2, 2);
FFlag(5);
MiddleOfSymbols(x, y, 'Tanner', 'Crafter', 'Gems');
until(Distance(x, y, MMCX, MMCY) < 7))
Would that work? Or you could make it into a function:


procedure WalkToSymbols(var x, y: integer; Symbol1, Symbol2, Symbol3: String);
begin
repeat
MiddleOfSymbols(x, y, Symbol1, Symbol2, Symbol3);
Mouse(x, y, 2, 2);
FFlag(5);
MiddleOfSymbols(x, y, Symbol1, Symbol2, Symbol3);
until(Distance(x, y, MMCX, MMCY) < 7))
end;

Special Ed

2007-05-02 20:22:20

From: Boreas
Dude! That's so crazy. I had that idea yesterday in the shower.

Anyway, Godfather it's called triangulation.

Let's say there's a small earthquake somewhere, a tremor (red dot). 1234 miles away, an earthquake detection center (A) senses the vibration, and from the timing of the vibrations, it can tell that the earth quake is 1234 miles away.


You know that the earthquake is somewhere along the black line, but you don't know where.

Then another place detects how far away it is, and you know its somewhere along that circle. There are only 2 possible places that work for both, (yellow dots).


Get the radius from another spot, and now there's only 1 possible spot that satisfies all 3 distances.

So basically, a point can be defined by it's distances from 3 other points.


You wouldn't happen to be a math teacher would you? Because my math teacher explained it in that exact way…

Boreas

2007-05-02 23:03:43

Nope, I just like math and science, and that's how my science teacher explained it (at 12 yrs old, strangely we didn't really talk about it in geometry at 15 yrs old).

Yakman

2007-05-03 03:34:32

this all looks good, you could find the circle by using Distance(
a circle is the locus around a fixed point, so if you would color every pixel red thats distance < 100 you would get a red circle,

Lorax

2007-05-03 09:11:48

This is totally overdoing it, it's not necessary.. just use one symbol..

Hobbit

2007-05-04 21:08:20

but with thise it would have a low rate of getting lost or missing a reference point and it would be pretty accurate even with symbol movements

Lorax

2007-05-05 09:09:44

I think it's a vaste of time, but that's just me, keep it simple…

Hobbit

2007-05-05 22:05:40

well yak, boreas like it, cause loves it

Boreas

2007-05-06 00:48:28

Works with any compass angle, where as a dx,dy to one symbol wouldn't.

Hobbit

2007-05-06 03:23:13

yah see so theres another thing that makes it accureate.