Register for your free account! | Forgot your password?

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

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

Advertisement



Incremental walking position update coordinate. Need help with three questions!

Discussion on Incremental walking position update coordinate. Need help with three questions! within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2011
Posts: 16
Received Thanks: 2
Incremental walking position update coordinate. Need help with three questions!

Hi guys, I've started coding bot yesterday by modifying the simplex_proxy from Drew to run in multithreaded using C#.

At the moment I can make the bot walk to a specific location in VSRO using the packet with opcode 0x7021.

I know I can get character server location from opcode 0xB021. Where packet structure is

ObjectID Uint32
ground click or sky click UInt8()
xSec Uint8
ySec Uint8
x UInt16
z UInt16
y UInt16

ComesFrom UInt8 //need confirmation
xSec0 Uint8 //need confirmation
ySec0 Uint8 //need confirmation
x0 UInt16 //need confirmation
z0 UInt16 //need confirmation
y0 UInt16 //need confirmation

---------------------------------------------------------------------------------
I have three questions I need help with.

Question 1
------------
Is my second part for the packet with opcode 0xB021 correct?

Question 2
------------
How do I get the position or X Y coordinate while the character is moving?
The packet 0xB021 gives me the location but it's only provided once when I click or execute the 0x7021 packet.

Is the x y position update can only be read from client memory address?
Is there other method to estimate imcremental character x y position overtime?

The reason I ask for question 2 is I want the walk to be realistic. Like when I'm near the first x, y position I exectue the next x, y position. That way my character don't mementary stop between point.


Question 3:
-------------
Does anyone have or know where I can find packet opcode structure information or map?

------------------------------------------
Thankyou very much for helping guys.
vutle is offline  
Old 02/09/2012, 10:21   #2
 
elite*gold: 0
Join Date: Nov 2007
Posts: 959
Received Thanks: 602
1.: yes
2.: well,you receive the speed of your character from the characterdata packet,so all you have to do is to calculate the time it will take to walk there,and then in each second(or whenever you want),you refresh your position by modifying the value according to the time/speed/distance (can't remember the exact formula,but I'm sure you can find it in some old emulators :P )
3.:silkroadonline.be/PacketWiki/
^^

good luck with your bot
vorosmihaly is offline  
Thanks
1 User
Old 02/09/2012, 11:43   #3
 
elite*gold: 0
Join Date: Sep 2007
Posts: 255
Received Thanks: 531
1. Source Z should be a float

2. For calculating the time it get's to arrive the destination i've been using this formula i found from xcoding emulator source

Code:
float speed = 50.0f;
float time = 0f;

speed = speed * (float)0.0768;

double tx = (DesX - x);
double ty = (DesY - y);
double distance = Math.Sqrt(tx * tx + ty * ty);

time = (float)distance / speed;

decimal intervalTime = (decimal)time;

intervalTime = Math.Round(intervalTime);
Though multiplying speed with 0.0768 seemed a little bit too slow for my bot/loop, i use 0.1 which seems to be pretty accurate
jremy is offline  
Thanks
1 User
Old 02/09/2012, 13:06   #4
 
elite*gold: 0
Join Date: Jan 2011
Posts: 16
Received Thanks: 2
Thanks jremy.

In 1)

The destination position is correctly display.
The problem I had is the source coordinate display incorrectly for X and Y position.

For exampe the packet below:

Code:
[S -> C][B021]
F6 A7 78 01                                       ..x.............
01                                                ................
98 66                                             .f..............
90 00                                             ................
8B FF                                             ................
5E 07                                             ^...............
01                                                ................
98 66                                             .f..............
C6 02                                             ................
0A 5B EE C2                                       .[..............
B6 49                                             .I..............
x: 3278 y: 2109 Desination
x2: 3335 y2: 3807 Source


Is the source calculation different to destination calculation?

x = ((Xsector - 135) * 192 + (X / 10));
y = ((Ysector - 92) * 192 + (Y / 10));

--------------------------
2) That assume normal walking speed right?
vutle is offline  
Old 02/09/2012, 13:47   #5
 
elite*gold: 0
Join Date: Sep 2007
Posts: 255
Received Thanks: 531
Quote:
Originally Posted by vutle View Post
Is the source calculation different to destination calculation?

x = ((Xsector - 135) * 192 + (X / 10));
y = ((Ysector - 92) * 192 + (Y / 10));
Try

x = ((Xsector - 135) * 192 + (Xoffset / 100));
y = ((Ysector - 92) * 192 + (Yoffset / 100));

I get 3271, 2109

Quote:
Originally Posted by vutle View Post
2) That assume normal walking speed right?
Yes, 50.0f is the run speed of noob character without clothes. You have to get the run/walk/zerk speed from chardata packet and 0x30D0 speed update packet.
jremy is offline  
Thanks
1 User
Old 02/09/2012, 14:03   #6
 
elite*gold: 0
Join Date: Jan 2011
Posts: 16
Received Thanks: 2
Thanks guys, all is working perfectly.

Request to close thread.
vutle is offline  
Reply


Similar Threads Similar Threads
COnquer coordinate in cartesian coordinate ?
02/07/2011 - CO2 Programming - 5 Replies
i m working on my minimap in pro4never proxy, i cleaning map from coquer site and put in picture box now i want to locate my char in this minimap likes in game :) but the coordinate in game are different view of classic cartesian coordinate :) some1 had module to trasform Conquer coordinate in cartesian coordinate ? or explain me why cood traslation in math not work :// :handsdown: i m working on this sistem



All times are GMT +1. The time now is 01:21.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.