How to program "Hunting spot finder"?

09/13/2013 19:12 Bl00ber#1
Hiya,
i wanted to make hunting spot finder for my share party but i lack of knowledge in programming.
Let me show u on a picture what i need.
[Only registered and activated users can see links. Click Here To Register...]
Imagine that black square is sro map, red points are mobs respawn places.
The thing i want is to find all points (blue dot) which have not less than X red points in specified radius.
For example to find only this points (blue) which have not less than 3 respawn points in radius=30.
Ive been using sbot auto lure closest spawns for the time being but with this i can only search 1 point at a time and its easy to miss a good spot.
I have some basic knowledge in C but i 'd rly appreciate any hints even in other programming languages :P
09/14/2013 14:07 qkuh#2
How do you get the spawn points? :'o
09/14/2013 14:34 Bl00ber#3
Sro map on rev6 gives it
and i bet it can be taken somehow from sbot...cuz its auto lure option has them too
09/14/2013 16:12 amra85#4
u can pick those points from Media\server_dep\silkroad\textdata\npcpos.txt
those spawn points pretty much useless. spawn rate is unknown. also, spawned mobs usually dive somewhere.

if u have some kind of autowalk/collision detection then u can write some algo so the character pick a point to move to where density of mobs is highest...
09/14/2013 18:53 Schickl#5
Tab_RefNest: Contains all the spawnpoints
Tab_RefHive: Contains other information related to them(you can e.g. overwrite the maximal number of objects that are spawned)
Tab_RefTactics: Contains informtion of the object that is spawned


The easiest way would be to just loop through the area.
So e.g. you move your point to 0,0 and write down how many spawn points you have near this point, then you move it to 10,10 or so and repeat the process until you find the one with the highest density of spawn points

However this is very inaccurate. If you want to be accurate you'd have to take quite many things into account: the radius of the spawn area, how much of that circle is in yours, how many mobs the server spawns in that area and how fast they respawn

And the terrain of course(A big spawn area doesn't help you if you can't walk there)

You also have to be sure to use the right radius. The db contains two: nRadius and nGenerateRadius

These are the things I can think of right now
09/15/2013 09:59 Bl00ber#6
Quote:
Originally Posted by Schickl View Post
Tab_RefNest: Contains all the spawnpoints
Tab_RefHive: Contains other information related to them(you can e.g. overwrite the maximal number of objects that are spawned)
Tab_RefTactics: Contains informtion of the object that is spawned
Where can i find this files? Are they in media.pk?
09/15/2013 10:09 Schickl#7
Quote:
Originally Posted by Bl00ber View Post
Where can i find this files? Are they in media.pk?
You can find them in the database
09/15/2013 15:45 Bl00ber#8
Quote:
Originally Posted by Schickl View Post
You can find them in the database
And where exectly is this database?
U mean some silkroad files or maybe a thread here in forum named database?
09/15/2013 15:58 amra85#9
Btw, may be useful to you. Here is how i read npcpos :)
Code:
            foreach (string line in Static.npcpos)
            {
                strings = line.Split('\t');
                float dx, dy;
                float x, y;
                ObjectType type = Static.GetObjectType(Convert.ToInt32(strings[0]));
                if (type != ObjectType.MONSTER) continue;

                short sector = Convert.ToInt16(strings[1]);
                byte xSec = Convert.ToByte((sector).ToString("X4").Substring(2, 2), 16);
                byte ySec = Convert.ToByte((sector).ToString("X4").Substring(0, 2), 16);
                dx = (float)Convert.ToDouble(strings[2].Replace('.', ','));
                dy = (float)Convert.ToDouble(strings[4].Replace('.', ','));
                x = (xSec - 135) * 192 + dx / 10;
                y = (ySec - 92) * 192 + dy / 10;
                int id = Convert.ToInt32(strings[0]);
                data.Add(new NpcPosition(id, x, y));
            }

Code:
string[] npcpos = System.IO.File.ReadAllLines(@"D:\npcpos.txt");
09/16/2013 14:18 Schickl#10
Quote:
Originally Posted by Bl00ber View Post
And where exectly is this database?
U mean some silkroad files or maybe a thread here in forum named database?
The database from the official server files
Just search here or on google and you'll find them('vsro database')