I'm not complainingArgh wrote: Yeah, it's roughly to scale, like everything else is. I wanted it to be a big, bad mecha, and it works pretty well.

Moderators: Moderators, Content Developer
I'm not complainingArgh wrote: Yeah, it's roughly to scale, like everything else is. I wanted it to be a big, bad mecha, and it works pretty well.
Code: Select all
gravity = weaponDef->myGravity==0 ? mapInfo->map.gravity : -(weaponDef->myGravity);
Shouldn't MRSI be a single-click ability instead of needing micro to pull off?Argh wrote:I would like to announce that I've coded a new gameplay feature for P.U.R.E.- artillery may now use velocity controls. So it finally acts like real artillery- you can use different "powder loads" to change the parameters of your big guns, making them more useful for different jobs. I dunno whether this is a useful feature yet, but I suspect that the answer is "yes, very".
Hmm. I tried to set it to 0.05, down from 0.1, which is the standard setting I'm using for my Cannons, and range didn't double. What else might be interfering? Lemme test with another weapon, the first thing I picked was the Artillery Shell, which has GroundBounce enabled. Can't think of anything else that's unusual about it, but meh, the rest of this code works- if I can get what I wanted, which is higher velocity and greater accuracy, but lower range, and lower velocity but greater range (I have the inverse right now, which is annoying) it'd be nice. I'll experiment a bit, see what went wrong.You misread that code. If myGravity is 0 it uses the map gravity, otherwise the tag. Look at THIS, plasma artillery uses very low gravity to fly pretty much straight.
Code: Select all
61 // initialize range factor
62 rangeFactor = 1;
63 rangeFactor = (float)range/GetRange2D(0);
64 // do not extend range if the modder specified speed too low
65 // for the projectile to reach specified range
66 if (rangeFactor > 1.f || rangeFactor <= 0.f)
67 rangeFactor = 1.f;
68 // some magical (but working) equations
69 // useful properties: if rangeFactor == 1, heightBoostFactor == 1
70 // TODO find something better?
71 if (heightBoostFactor < 0.f)
72 heightBoostFactor = (2.f - rangeFactor)/sqrt(rangeFactor);
Code: Select all
266 float CCannon::GetRange2D(float yDiff) const
267 {
268 const float factor = 0.7071067f; // sin pi/4 == cos pi/4
269 const float smoothHeight = 100.f; // completely arbitrary
270 const float speed2d = projectileSpeed*factor; // speed in one direction in max-range case
271 const float speed2dSq = speed2d*speed2d;
272
273 if (yDiff < -smoothHeight)
274 yDiff *= heightBoostFactor;
275 else if (yDiff < 0.f)
276 // smooth a bit
277 // f(0) == 1, f(smoothHeight) == heightBoostFactor
278 yDiff *= 1.f + (heightBoostFactor-1.f) * (-yDiff)/smoothHeight;
279
280 float root1 = speed2dSq + 2*gravity*yDiff;
281 if(root1 < 0.f){
282 return 0.f;
283 } else {
284 return rangeFactor*(speed2dSq + speed2d*sqrt(root1))/(-gravity);
285 }
286 }
Code: Select all
heightBoostFactor is exposed in the weapondefs
I'll try 0.99, just to be sure, but I don't think that will work, either.yDiff < -smoothHeight
Easy...I want to see artillery in Spring that can actually reach 45 degree angles of aim, which never seems to happen
Code: Select all
fout.writelines (str(int(math.ceil(math.sqrt(int(maxRange) * 140)))) + ";")