Register for your free account! | Forgot your password?

Go Back   elitepvpers > Other Online Games > Browsergames > DarkOrbit
You last visited: Today at 02:35

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

Advertisement



Movement Calculation

Discussion on Movement Calculation within the DarkOrbit forum part of the Browsergames category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2009
Posts: 77
Received Thanks: 20
Movement Calculation

I don't want any thanks or whatsoever for this. Just throwing it out to the devs who will maybe get interested in developing another bot!
This should really only be encouraging for beginners to write new software!
You can use this without permission (no licencing).
Also it's kind of a nice and easy task if you want to do some maths again
If you have questions or spotted a mistake, please tell me!

Have fun!

PHP Code:
from math import powsqrt

def calcposattime
(currentdestinationspeedtime):
    
# extract
    
currentxcurrenty current
    destinationx
destinationy destination
    
# errorpreventing
    
if (currentx == destinationx) and (currenty == destinationy):
        return (
00)
    
# calc delta
    
deltaxdeltay currentx destinationxcurrenty destinationy
    
# calc distance from current to destination
    
distance sqrt(pow(deltax,2)+pow(deltay,2))
    
# distance: dis travelled in time: t with speed: v => dis = v * t
    
distance_travelled speed time
    
# now see how much of the final distance we made and multiply with our delta coordinates:
    
delta_travelled_x deltax * (distance_travelled/distance)
    
delta_travelled_y deltay * (distance_travelled/distance)
    
# and now add it to our current location
    
newxnewy currentx delta_travelled_xcurrenty delta_travelled_y
    
return (newxnewy)


if 
__name__ == "__main__":
    
STEPSIZE 4
    
for x1 in range(010STEPSIZE):
        for 
y1 in range(010STEPSIZE):
            for 
x2 in range(010STEPSIZE):
                for 
y2 in range(010STEPSIZE):
                    print 
"from"x1y1"to"x2y2"="calcposattime((x1y1), (x2y2), 11
(That lower part is for testing purposes)
Python
general_lolichdissdich is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Exp Calculation
08/21/2011 - CO2 Private Server - 4 Replies
I know this is not real exp calculation and it's custom. Just wondering, if it would be a good way to do it custom. static ulong GetExerience(ulong GainExperience, byte attLevel, byte oppLevel, byte Rate, uint Damage, byte Reborns, byte TeamMembers) { ulong Experience = (attLevel <= oppLevel) ? (GainExperience * Rate) : ((GainExperience / attLevel) * Rate); Experience += (ulong)(Damage ^ (Reborns + oppLevel)) / TeamMembers; return...
Exp calculation?
01/09/2011 - CO2 Programming - 3 Replies
Hey, Does anyone has a decent exp calculation, or show me atleast how it is calculated? I really have no idea when it comes to conquer. Thanks in advance, ImmuneOne.
archer calculation
09/24/2010 - CO2 Private Server - 2 Replies
where is this located in what cs in 5165 and what the line?
Damage Calculation
08/02/2010 - CO2 PServer Guides & Releases - 12 Replies
Okay. I haven't found any physical damage calculations out there that involves BP. Maybe nobody wants it or what but Ive been lurking these forums for a while looking for ideas for my server. Anyway, here's my ROUGH (+- 1.5k) damage compared to the real co. If anyone got any ideas on how to improve my equation by all means please post. I use 5165 but the gist of it should be the same as other servers. also, thanks to CoEmu v2, I used some of the damage calculation from there namely the...
Repair Calculation
06/04/2010 - CO2 Private Server - 0 Replies
Here is the correct gold calculation for repairing an item: int nRecoverDurability = Math.Max(0, Item.Stats.Durability - Item.CurDurability); if (nRecoverDurability == 0) return; byte Quality = ItemManipulation.GetQuality((int)Item.Stats.ID); double QualityMultipier = 0;



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


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.