SRL Archive - OSR Help

Appeal to the public knowledge


Wardancer

2013-02-21 19:27:10

I'm a strong believer that a) I'm not the smarter guy around here and b) the sum is bigger than its parts. I'm working on a function and I thought of two ways to execute it, but I'm not pleased with what I thought of so far. Let me explain what I want to do.

I'm working on a system that would record points on the minimap and not store the information as static coordinates but rather while taking into consideration the surroundings and moving. It doesn't have to be excessively precise. For this, I thought of two possibilities so far: SPS and DTM.

The main problem I have with SPS is its speed of execution. The function SPS_GetMyPos takes, at best, 400ish miliseconds and my attempts to quicken it didn't yield any promising result.

As for DTM/DDTM, it'd do the trick, but moving tends to pretty much ruin any precision. Of course, I could build a few fail safes around it and it's, by far, the leading candidate for this task, but I'm curious if you can think of other ways to get it done.

i luffs yeww

2013-02-21 19:37:12

I'm not sure what you mean by moving ruins any precision for DDTMs? Do you mean the map changing rotation or what?

Wardancer

2013-02-21 19:47:27

Oh. Just that if I want to record points on the MM, walking would offset this by a few pixels from experience. This could cause false positives. SPS would have a similar issue. It just wasn't my main concern with this system.

i luffs yeww

2013-02-21 20:03:11

I still don't think I really understand what you're trying to figure out. :( You've said that you weren't too concerned about being off a few pixels, so I don't know what you're trying to solve.

Wardancer

2013-02-21 20:34:55

The function doesn't have to be dead on target, but it still has to be pretty close. Walking would be a bit too off.

A possible use of the function would be to record loots on the minimap so you don't wait until picking up the drops before moving on to a new monster while still being able to go back to the loots after. Hoping it's more clear now.

i luffs yeww

2013-02-21 20:49:04

From: Wardancer
The function doesn't have to be dead on target, but it still has to be pretty close. Walking would be a bit too off.

A possible use of the function would be to record loots on the minimap so you don't wait until picking up the drops before moving on to a new monster while still being able to go back to the loots after. Hoping it's more clear now.


Well for your example there are some pretty simple ways to have a system like that. Say you kill a monster then run south for two clicks, you just keep the points in a TPA and then flip them and walk back. You could also do some Djikstra/A* traversal which would be neat. It would be a fast, small, and accurate system if it's a relatively small area, and could be totally dynamic.

Wardancer

2013-02-21 21:28:34

From: i luffs yeww
Well for your example there are some pretty simple ways to have a system like that. Say you kill a monster then run south for two clicks, you just keep the points in a TPA and then flip them and walk back. You could also do some Djikstra/A* traversal which would be neat. It would be a fast, small, and accurate system if it's a relatively small area, and could be totally dynamic.


I don't think a simple TPA would work as there is a lot of moving involved.

As for Djikstra/A*, I have no idea what that is. A quick search on villavu gave one result which didn't help much. Time to google a bit. Anything with a dash in its name deserve my utmost respect.

i luffs yeww

2013-02-21 21:33:59

From: Wardancer
I don't think a simple TPA would work as there is a lot of moving involved.

As for Djikstra/A*, I have no idea what that is. A quick search on villavu gave one result which didn't help much. Time to google a bit. Anything with a dash in its name deserve my utmost respect.


Are you able to give more information about where/what this is going to be used (for)? Just asking because, from the example you gave, TPAs and graph traversal would work well.

Wardancer

2013-02-21 21:55:28

From: i luffs yeww
Are you able to give more information about where/what this is going to be used (for)? Just asking because, from the example you gave, TPAs and graph traversal would work well.


The area doesn't really matter. I'm trying to think of a function which could be generic. I might be completely misunderstanding what Djikstra/A* is, but it made me think of loading a DTM on the fly. The main point and sub points coordinates would be static but I'd use GetColor for the colouring. Past that point, it'd be easy to load the drop dots from anywhere.

I'm still very curious about what the real Djikstra/A* is (I assume graph traversal is that).

i luffs yeww

2013-02-21 22:14:09

From: Wardancer
The area doesn't really matter. I'm trying to think of a function which could be generic. I might be completely misunderstanding what Djikstra/A* is, but it made me think of loading a DTM on the fly. The main point and sub points coordinates would be static but I'd use GetColor for the colouring. Past that point, it'd be easy to load the drop dots from anywhere.

I'm still very curious about what the real Djikstra/A* is (I assume graph traversal is that).


I'm not sure if I know what you're wanting. :( It seems like you're just wanting to redo DDTMs? I'm not sure if that's correct or I'm wrong or what.

Also, Dijkstra and A* are graph search/traversal algorithms. http://maxburstein.com/blog/introduction-to-graph-theory-finding-shortest-path is a simple implementation and explanation of Dijkstra's algorithm in Ruby and Python. If you imagine each node/city as a click, it may make more sense. And I would also probably make every node connect to the main node ('A' in the case of the article) so you can see if there are shorter distances maybe. That could get more complicated, though, if there are obstacles that made you walk a longer way, but I'm just typing out my thoughts.

Also, I was spelling Dijkstra wrong, as usual. :(

Wardancer

2013-02-21 22:43:28

From: i luffs yeww
I'm not sure if I know what you're wanting. :( It seems like you're just wanting to redo DDTMs? I'm not sure if that's correct or I'm wrong or what.

Also, Dijkstra and A* are graph search/traversal algorithms. http://maxburstein.com/blog/introduction-to-graph-theory-finding-shortest-path is a simple implementation and explanation of Dijkstra's algorithm in Ruby and Python. If you imagine each node/city as a click, it may make more sense. And I would also probably make every node connect to the main node ('A' in the case of the article) so you can see if there are shorter distances maybe. That could get more complicated, though, if there are obstacles that made you walk a longer way, but I'm just typing out my thoughts.

Also, I was spelling Dijkstra wrong, as usual. :(


Yes, what I'm referring to is called DDTM on this forum (even though most of what we see is just a DTM not written as a string).

The traversal algorithm is interesting but I'm afraid it wouldn't work as a solid positioning system without quite a bit of tweaking. I don't see any advantage over a DDTM. I might be missing something though. From my point of view, there are many other ways we can go to discriminate which TP to go to first (and I'm much more familiar with those, obviously).

Thank you very much for the link though. Was quite interesting even though I didn't understand all of it. My coding knowledge starts (and ends) with simba and I doubt my field of study could be any farther from coding than it is, haha.

i luffs yeww

2013-02-21 22:56:26

From: Wardancer
Yes, what I'm referring to is called DDTM on this forum (even though most of what we see is just a DTM not written as a string).

The traversal algorithm is interesting but I'm afraid it wouldn't work as a solid positioning system without quite a bit of tweaking. I don't see any advantage over a DDTM. I might be missing something though. From my point of view, there are many other ways we can go to discriminate which TP to go to first (and I'm much more familiar with those, obviously).

Thank you very much for the link though. Was quite interesting even though I didn't understand all of it. My coding knowledge starts (and ends) with simba and I doubt my field of study could be any farther from coding than it is, haha.


So you're looking to make another positioning system? I'm still trying to figure out what exactly you're looking to do, is all. Sorry if I'm just not getting it.

Wardancer

2013-02-21 23:12:23

From: i luffs yeww
So you're looking to make another positioning system? I'm still trying to figure out what exactly you're looking to do, is all. Sorry if I'm just not getting it.


Well, I don't want to reinvent the wheel, but yes, it'd be some positioning system, but which would store multiple TPs which wouldn't be your own position but rather dots on the minimap. Is it more clear?