Xonotic Forums
curvegun (custom weapon) - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10)
+--- Forum: Xonotic - Development (https://forums.xonotic.org/forumdisplay.php?fid=12)
+--- Thread: curvegun (custom weapon) (/showthread.php?tid=6326)



curvegun (custom weapon) - dingus - 08-01-2016

So here is a thing I am making.



The idea is that when you press down primary fire, you shoot out a tracer shot that is only visible to you. When you release primary fire, a bullet fires in a parabolic arc starting in the direction you are currently looking, and passes through wherever the tracer was.

This isn't an attempt to replace/copy the functionality of the devastator. What I would like to do eventually is to make the projectile much, much faster than the devastator rocket, so that it is essentially hitscan. That way we can curve rockets and hitscan shots.

I hope you like it Wink


RE: curvegun (custom weapon) - end user - 08-01-2016

(08-01-2016, 04:13 PM)dingus Wrote: So here is a thing I am making.



The idea is that when you press down primary fire, you shoot out a tracer shot that is only visible to you. When you release primary fire, a bullet fires in a parabolic arc starting in the direction you are currently looking, and passes through wherever the tracer was.

This isn't an attempt to replace/copy the functionality of the devastator. What I would like to do eventually is to make the projectile much, much faster than the devastator rocket, so that it is essentially hitscan. That way we can curve rockets and hitscan shots.

I hope you like it Wink

So The Fifth Element ZF-1




RE: curvegun (custom weapon) - dingus - 08-01-2016

(08-01-2016, 04:50 PM)end user Wrote: So The Fifth Element ZF-1

Only if you are mirio/kromatic/smilescythe


RE: curvegun (custom weapon) - cefiar - 08-01-2016

There's something like this on the SMB servers already, but the tracer is visible to all, and if you hit the opponent with it, I think it auto-fires an attack of rockets. Might be worth looking at their implementation.

FWIW: I like the fact that you can target any spot instead of just an opponent (ie: could do splash damage if you target near an opponent), though that might make such a weapon too powerful.


RE: curvegun (custom weapon) - dingus - 08-02-2016

(08-01-2016, 06:24 PM)cefiar Wrote: There's something like this on the SMB servers already, but the tracer is visible to all, and if you hit the opponent with it, I think it auto-fires an attack of rockets. Might be worth looking at their implementation.

FWIW: I like the fact that you can target any spot instead of just an opponent (ie: could do splash damage if you target near an opponent), though that might make such a weapon too powerful.

Thanks for the suggestion. I looked at that weapon, but as far as I can tell, the only way to hit someone is to first shoot them with the tracer. The tracer on that weapon fires in a straight line and doesn't pass through walls, so I'm not sure I see the point of it. You have to have line of sight so it ends up functioning like a 'normal' gun.

With this gun, the whole point is that you can shoot around corners like the devastator, but the shot moves quickly and you don't have to continuously aim. This means it would be good for things like prediction shots. If anything, it is like a more sophisticated mortar weapon.

Another thing that isn't immediately obvious: that last shot in the video shows that you can make the bullet completely switch directions rather quickly. I would like it to be possible to do 'mid-air' rocket jumps by doing a sort of 180 flick-shot in the direction you want to be propelled.


RE: curvegun (custom weapon) - cefiar - 08-02-2016

Oh I wasn't saying to copy it, more that their implementation of how some of it works (eg: the homing rockets) might prove useful for making yours work (eg: less code, better code paths, etc).


RE: curvegun (custom weapon) - Pendulla - 08-03-2016

It eneded up where you pointed the tracer only the last time, every other time it looks like the projectile have gone to a random place. What am i seeing wrong?


RE: curvegun (custom weapon) - aa - 08-03-2016

(08-01-2016, 06:24 PM)cefiar Wrote: There's something like this on the SMB servers already, but the tracer is visible to all, and if you hit the opponent with it, I think it auto-fires an attack of rockets. Might be worth looking at their implementation.

FWIW: I like the fact that you can target any spot instead of just an opponent (ie: could do splash damage if you target near an opponent), though that might make such a weapon too powerful.

That weapon (T.A.G. Seeker) is actually a part of vanilla game, available under the New Toys mutator or found on Vehicle maps. It existed since Nexyiz times.


RE: curvegun (custom weapon) - dingus - 08-03-2016

(08-02-2016, 06:33 PM)cefiar Wrote: Oh I wasn't saying to copy it, more that their implementation of how some of it works (eg: the homing rockets) might prove useful for making yours work (eg: less code, better code paths, etc).

Oh, I see. Thanks for the suggestion Smile

Pendulla Wrote:It eneded up where you pointed the tracer only the last time, every other time it looks like the projectile have gone to a random place. What am i seeing wrong?

It doesn't follow a straight path to the tracer, but will always pass through it. It essentially follows a bezier curve whose control points are the player position, a second point based on the look direction, and the tracer position.

The exact formula is this:

Code:
(1-t)*(1-t)*p0 + 2*(1-t)*t*p1 + t*t*p2;

where:

Code:
p0 = player.origin
p2 = tracer.origin
p1 = vlen(p0, p2) * normalize(v_look) + player.origin

(bare in mind I'm using velocity and acceleration instead, but that's just an implementation detail. I also need to reparamaterize the curve based on arclength, which will make it so that the bullet travels at a constant speed. However thats pretty technical)