SRL Archive - OSR Help

[SPS]Advice needed


Flight

2012-07-31 21:22:15

Hiya, so I have a problem that I can't seem to find a way to get around. It's a bit hard to explain so I'll use an image to aid the explanation.


Let's assume I have a point array of all of those little green dots. Now, let the blue dot represent out player's location and the red dot represent the target coordinate we want to walk to. If possible, how might I go about making an SPS-walker that would form a path from our current location to any one of the points in the recorded array using only the points in that array? It should, obviously, also calculate the shorter route to get to the destination point.

I was wondering about using 'TPABetweenPoints' with a super high Rand to make the points and check each of those if they match my previous recorded array.

Coh3n, maybe you have some ideas here?

Getdropped

2012-07-31 22:02:55

From: Flight
Hiya, so I have a problem that I can't seem to find a way to get around. It's a bit hard to explain so I'll use an image to aid the explanation.


Let's assume I have a point array of all of those little green dots. Now, let the blue dot represent out player's location and the red dot represent the target coordinate we want to walk to. If possible, how might I go about making an SPS-walker that would form a path from our current location to any one of the points in the recorded array using only the points in that array? It should, obviously, also calculate the shorter route to get to the destination point.

I was wondering about using 'TPABetweenPoints' with a super high Rand to make the points and check each of those if they match my previous recorded array.

Coh3n, maybe you have some ideas here?


Once you have the points all listed you could getmyspspos then if your sps pos is between values, you add the sps points on to eachother to create the path on the fly. Use the X and Y values to decide what is the start point and which one you plan on clicking next. I suggest making something like 4 or 8 quadrants and creating what your position would be and based on which quadrant you are in choose the appropriate path.

Making a picture to explain it now.

Edit: Each line on the map represents an if/case statement

Brandon

2012-07-31 23:19:47

Iunno.. If you actually have a TPA of all those green dots then why not use SPS_WindWalk?

Maybe split the TPA into two parts. One for the top, one for the bottom and whichever is smaller, walk that one?

Daniel

2012-08-01 00:51:29

From: Flight
Hiya, so I have a problem

That's not your only problem… :cartman:

Anyways, but to answer your question with a question: if you already have the points in a TPA, why not just simply click those points and then calculate the relative distances before clicking the next? :s

Flight

2012-08-01 03:02:29

From: Daniel
That's not your only problem… :cartman:

Anyways, but to answer your question with a question: if you already have the points in a TPA, why not just simply click those points and then calculate the relative distances before clicking the next? :s


That's what I started doing but I think what I'll do is calculate two distances; the nearest two points to the player and the distance from those two points to the destination point. Whichever of the two is closer to the destination will be the next point in the walking path. I'll just loop this until the destination is reached. Genius!

Daniel

2012-08-01 03:07:26

From: Flight
Genius!


I know :sasmokin: ;)

mormonman

2012-08-01 03:09:56

If you wanted to do this the way you first described just look up dijkstra or a* pattern searching.

Flight

2012-08-01 05:43:25

Thanks for the advice, after a couple of hours I got it running just how I want it. It works beautifully.

speedster

2012-08-01 05:46:14

Nice lol abyss crafter

Olly

2012-08-01 09:12:47

Flight may I ask why a abyss runecrafter? when beta comes here runecrafting runes will be dead since spells use like 1 death each cast >.<. Or are you making it for the challenge :P

riwu

2012-08-01 09:18:38

From: Ollybest
Flight may I ask why a abyss runecrafter? when beta comes here runecrafting runes will be dead since spells use like 1 death each cast >.<. Or are you making it for the challenge :P

Not necessarily. Even though spell costs are reduced, the demand for them will increase as magic will become much more popular (due to the lower cost and remade (balanced) combat magic). Also all non-combat spells, vengeance etc are going to remain popular and their costs are not altered.

Flight

2012-08-01 09:46:48

I suppose it's just always been a goal of mine. I hope that it doesn't go to waste in the end, I've been working pretty hard on this one. :(

Olly

2012-08-01 15:24:09

From: Flight
I suppose it's just always been a goal of mine. I hope that it doesn't go to waste in the end, I've been working pretty hard on this one. :(


Remind me of ZMI Extreme :(