SRL Archive - Reflection Development

web walking


grats

2011-07-28 12:02:13

Well.. we do have one pretty much already built..

utility:
http://villavu.com/forum/showthread.php?t=63367
http://villavu.com/forum/showthread.php?t=63439


actual script:
http://villavu.com/forum/showthread.php?t=64029


I was thinking building the whole mapped out points I created could just be added.. and I can easily fix it up and add more or something.. it is also easy to get around obstacles in scripts..
like this:

I've seen this in a script where the player runs to the end of the red point.. does the agility obstacle and then continues the web walk down to the crafting guild, it isn't that complicated and if we want a web walk we already have one

Goobs

2011-07-28 15:51:00

How does it know where obstacles are? I must have missed it while reading xD

I made a function, but not nearly as awesome as this one. I'd like to see this make it into Reflection 2 :)

Drakan

2011-07-28 16:01:42

Well we are looking into a more dynamic way of doing a walker. Static tiles and such isn't what we want to do. But these things are under development and being worked on when there is time. I'm still on vacation right now so I don't have my computer or anything.

grats

2011-07-28 16:05:11

From: drags111
Well we are looking into a more dynamic way of doing a walker. Static tiles and such isn't what we want to do. But these things are under development and being worked on when there is time. I'm still on vacation right now so I don't have my computer or anything.


oh ok, like auto generated walkers?

From: ProphesyOfWolf
How does it know where obstacles are? I must have missed it while reading xD

I made a function, but not nearly as awesome as this one. I'd like to see this make it into Reflection 2 :)


oh no, it doesn't know

but my example was.. it stops before the obstacle (give the point right before the obstacle) then it handles the obstacle and then it continues on its route.. someone did this in their script, let me find it

here:
http://villavu.com/forum/showthread.php?t=63725

Drakan

2011-07-28 16:07:45

Yes. Not technically web walking because there isn't recorded tiles. But yes, using the collision map info to generate paths on the fly. Still a work in progress. I believe method has some information since I last talked to him about getting the info from the cache. I need to talk to him sometime when I get home :P

grats

2011-07-28 16:12:45

From: drags111
Yes. Not technically web walking because there isn't recorded tiles. But yes, using the collision map info to generate paths on the fly. Still a work in progress. I believe method has some information since I last talked to him about getting the info from the cache. I need to talk to him sometime when I get home :P


ProphesyOfWolf had one with R2 that was generating the tiles to walk.. (straight to the other point) it looked like the creating of the tiles was working he just had a procedure wrong that didn't actually walk on the tiles or something.. which brought us to the discussion of webber in the first place

Coh3n

2011-07-28 22:16:38

Couldn't the Nexus one be de-compiled and checked out to see how the they do it? I mean, it literally goes anywhere and solves every obstacle.

grats

2011-07-28 22:58:10

From: Coh3n
Couldn't the Nexus one be de-compiled and checked out to see how the they do it? I mean, it literally goes anywhere and solves every obstacle.


never seen that one.. sounds like it's really good :P

how hard is it to de-compile stuff? my awesome level isn't high enough to do such things

Coh3n

2011-07-28 22:59:57

From: grats
never seen that one.. sounds like it's really good :P

how hard is it to de-compile stuff? my awesome level isn't high enough to do such things
Oh I don't have a clue, I just know it's possible to do with some software.

senrath

2011-07-28 23:05:01

Nexus is written in Java, right? Then decompiling it is as easy as drag-and-drop. Making sense of what was decompiled is another matter.

Bobarkinator

2011-07-28 23:38:14

Unless Nexus has changed, I'm pretty sure they use static tiles. At least that's what it was 2 years ago…

mormonman

2011-07-28 23:46:35

From: Bobarkinator
Unless Nexus has changed, I'm pretty sure they use static tiles. At least that's what it was 2 years ago…


All of their web is hard-coded.

Bobarkinator

2011-07-28 23:56:20

From: mormonman
All of their web is hard-coded.


Exactly. I'm not sure what drags and Method are cooking up, but hard-coding would be the closest to fool proof method. But drags on-the-fly method may be just as good when we see it.

noidea

2011-07-29 01:41:59

rsbuddy has something called nano walker. idk much about it. Its supposed to handle all of that.

grats

2011-07-29 02:18:38

From: Bobarkinator
Exactly. I'm not sure what drags and Method are cooking up, but hard-coding would be the closest to fool proof method. But drags on-the-fly method may be just as good when we see it.


yea we got hard coded right here in the thread.. so if they can cook up something using some math formulas or the-like, I'd love to see it

Brandon

2011-07-29 03:25:59

Only way I see this working dynamically.. is to be able to get the midpoint tile from you to the destination.. if its not on minimap then get the midpoint tile from you to the previous midpoint tile.. then check if its on minimap.. if it still isn't then do it again until eventually it narrows down to a tile near u..
The obstacles part I have no clue about now because u can't check for obstacles while walking a path… unless you do walktotile, check obstacles, walktotile, check obstacles and so on and so forth..

My attempt at Dynamic Tile walking..

var
GlobalDest: TPointArray;

Function GetTileToMM(Destination: TTile): TPoint;
var
Me, NewDest: TTile;
DistTile, i, b, L, h: Integer;
Place, MidDest: TPointArray;
begin
DistTile:= R_DistanceFromTile(Destination); //distance from destination..
Me:= R_GetMyPos();
MidDest[0]:= R_GetMidTile(Me, Destination); //mid tile from me to destination..
i:= 0;
b:= 0;
Repeat
Place[b]:= MidDest[i]; //new destination = mid tile of me to previous destination..
MidDest[i + 1]:= R_GetMidTile(Me, Place[b]);

b:= b + 1;
i:= i + 1;

L:= Length(MidDest); //Length of the array..
if(R_TileOnMM(MidDest[L - 1])) then
writeln('Tile On MM');
Until(R_TileOnMM(MidDest[L - 1]) and (DistTile < 10));
NewDest:= MidDest[L - 1];
GlobalDest:= MidDest;
Result:= NewDest;
end;

begin
R_WalkPath(GlobalDest);
end.

Results of Tiles Midpoints:


place 0 = MP(middest 0)
middest 1 = MP(place 0)

place 1 = middest 1
middest 2 = MP(place 1)

place 2 = midtest 2
midtest 3 = MP(place 2)
Resulting array that we will walk:

[midtest 3, midtest 2, midtest 1, our destination]
Not tested yet but in theory that should work if objects didn't exist.. That code above should actually build a path on its own to the destination.. and then walk it.. but obstacles will be a problem..

Goobs

2011-07-29 04:54:07

Mine just uses geometry to calculate the set of points in a straight line to the destination.. It would be good with a path function, if you had it walk from point to point. However, across long distances, it fails because of obstacles and water :( xD Maybe a hybrid of both to calculate the correct path necessary, and then compare those tiles to a safe hard-coded web to ensure safeness? 4:53 in the morning, little tired xD

Home

2011-07-29 05:59:15

From: drags111
Well we are looking into a more dynamic way of doing a walker. Static tiles and such isn't what we want to do. But these things are under development and being worked on when there is time. I'm still on vacation right now so I don't have my computer or anything.


Are you going to use A* Dijsktra?

Or something like that.

EDIT: I think Trilez made something good to TriBot?

~Home

grats

2011-07-29 06:12:46

From: ProphesyOfWolf
Mine just uses geometry to calculate the set of points in a straight line to the destination.. It would be good with a path function, if you had it walk from point to point. However, across long distances, it fails because of obstacles and water :( xD Maybe a hybrid of both to calculate the correct path necessary, and then compare those tiles to a safe hard-coded web to ensure safeness? 4:53 in the morning, little tired xD


yea I was thinking of something like.. it calculates a straight route till it has to turn.. then it turns & then ti calculates another straight route.. etc

From: ProphesyOfWolf
4:53 in the morning, little tired

you said it though.. my head lit on fire just reading your post, overload, overload

Coh3n

2011-07-29 10:33:41

The easy part is getting it to walk, the hard part is obstacles. There are so many in RS, it would take forever to gather hard coded value for each one, and the chances of actually getting every last one are next to none. Not to mention several have agility requirements. It's definitely not something that can be done easily.

Drakan

2011-07-29 10:53:24

From: ggzz
Only way I see this working dynamically.. is to be able to get the midpoint tile from you to the destination.. if its not on minimap then get the midpoint tile from you to the previous midpoint tile.. then check if its on minimap.. if it still isn't then do it again until eventually it narrows down to a tile near u..
The obstacles part I have no clue about now because u can't check for obstacles while walking a path… unless you do walktotile, check obstacles, walktotile, check obstacles and so on and so forth..


Then you need to study up on Dijkstra's formula, A*, and graph theory in general. Dynamic walking in it's current state (that I have) is done by this: The collision map is loaded and saved into a 2-dimensional integer array. Then using the collision map, a derivative of dijkstra's formula is used to calculate if the tile is reachable from your current position, avoiding obstacles. Then using the A* formula it calculates the next tile to go to on the minimap closest to the destination tile. All avoiding obstacles and whatnot. I haven't had a chance to work on it in a month or 2, but hopefully I will get that opportunity soon. The part I need method for is that from my understanding he has a way to load the entire collision map through the cache, which would solve a couple of problems im having with my current one. Anyway, that's kind of all rough from memory so I hope it makes sense a bit.

**BANNED The Man

2011-07-29 11:41:19

The way I thought of a while back was by putting a piece of code in scripts that grabs the tile the player is standing on, then submits that tile to a database.
This will make a "learning" web walker.
The more tiles people collect, the more/shorter ways we can get to places.
I started the project a few months ago but never got anywhere without motivation.

-Boom

grats

2011-07-29 12:06:04

From: Dynamite
The way I thought of a while back was by putting a piece of code in scripts that grabs the tile the player is standing on, then submits that tile to a database.
This will make a "learning" web walker.
The more tiles people collect, the more/shorter ways we can get to places.
I started the project a few months ago but never got anywhere without motivation.

-Boom


that would be really cool.. so eventually it would have pretty much every point in the game mapped out if people ran places enough.. and then it would just run along those spots

Drakan

2011-07-29 12:12:02

From: Dynamite
The way I thought of a while back was by putting a piece of code in scripts that grabs the tile the player is standing on, then submits that tile to a database.
This will make a "learning" web walker.
The more tiles people collect, the more/shorter ways we can get to places.
I started the project a few months ago but never got anywhere without motivation.

-Boom


Why would you possibly go through that much trouble, when the post I wrote before yours explains how you get all of the tile information in < 50ms. It just seems unnecessary and a waste of time.

grats

2011-07-29 12:14:04

From: drags111
Why would you possibly go through that much trouble, when the post I wrote before yours explains how you get all of the tile information in < 50ms. It just seems unnecessary and a waste of time.


well he was working on it months before :P he probably quit that forever.. sounds way over complicated for what we need.. but a neat idea

**BANNED The Man

2011-07-29 12:23:09

From: drags111
Why would you possibly go through that much trouble, when the post I wrote before yours explains how you get all of the tile information in < 50ms. It just seems unnecessary and a waste of time.


As I said, I started that months ago when you weren't around and I didn't know you could get that information..

-Boom

Bobarkinator

2011-07-29 14:47:07

Drags: That handles bridge crossings where there's really only one place that you can cross at?