Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 02:39

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



How to program "Hunting spot finder"?

Discussion on How to program "Hunting spot finder"? within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
Bl00ber's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 92
Received Thanks: 18
How to program "Hunting spot finder"?

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.

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
Bl00ber is offline  
Thanks
1 User
Old 09/14/2013, 14:07   #2
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
How do you get the spawn points? :'o
qkuh is offline  
Old 09/14/2013, 14:34   #3
 
Bl00ber's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 92
Received Thanks: 18
Sro map on rev6 gives it
and i bet it can be taken somehow from sbot...cuz its auto lure option has them too
Bl00ber is offline  
Old 09/14/2013, 16:12   #4
 
elite*gold: 0
Join Date: May 2013
Posts: 38
Received Thanks: 10
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...
amra85 is offline  
Thanks
1 User
Old 09/14/2013, 18:53   #5
 
Schickl's Avatar
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,064
Received Thanks: 539
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
Schickl is offline  
Thanks
1 User
Old 09/15/2013, 09:59   #6
 
Bl00ber's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 92
Received Thanks: 18
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?
Bl00ber is offline  
Old 09/15/2013, 10:09   #7
 
Schickl's Avatar
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,064
Received Thanks: 539
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
Schickl is offline  
Thanks
1 User
Old 09/15/2013, 15:45   #8
 
Bl00ber's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 92
Received Thanks: 18
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?
Bl00ber is offline  
Old 09/15/2013, 15:58   #9
 
elite*gold: 0
Join Date: May 2013
Posts: 38
Received Thanks: 10
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");
amra85 is offline  
Thanks
1 User
Old 09/16/2013, 14:18   #10
 
Schickl's Avatar
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,064
Received Thanks: 539
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')
Schickl is offline  
Thanks
1 User
Reply




All times are GMT +2. The time now is 02:39.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.