The Dink Network

Reply to Re: Some self-indulgence

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
June 21st 2012, 09:58 PM
fairy.gif
Someone
Peasant He/Him Australia
 
EDIT: Reading over my (and your) post again I don't feel we really disagree much.

Yes. I don't like the word patent.

Long answer: Here's the aiming part of my script, comments are the ones also in the original script:

Yes, I don't think you should credit me. However, although I probably exaggerated the similarities between my script and Paul's, I would have gladly called my script an optimised version of your script if you had released it first and I saw it, and I wouldn't think that means you would get credit for my script or it would discourage me in any way.

Anyhow, for purely constructive reasons I'd like to compare my script and yours. Both scripts work by dividing:

50.&posx = &mox;
51.&posx * 4;
52.&posx / &moy;

so lines 50 and 52 are the heart. My script has the same heart. However your script is inaccurate, very much so at some angles, and the speed of the projectile is dependent on the angle [i.e., at some angles it will travel faster]

My script differs for three reasons:
1) It optimises how much information is retained in the division
2) It uses a DinkC loop to move the projectiles so they can move with non-integer mx/my
3) It tries to ensure consistent speed regardless of direction [I forgot about this while describing it in the original post]

Three is done by ensuring the equivalent of &posx + &posy is equal to a constant independent of angle. It should really be the sum of the squares of those two values, but squaring stuff leads to overflow really easily, so I took the sum as an approximate equation.

The result is that my script has no visible inaccuracy and the speed is more consistent. Check out aiming is globals3.c and movement in w-fire.c [firloop]