Sword weapontype

Sword weapontype

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Sword weapontype

Post by KDR_11k »

A weapontype used for swords with an appropriate effect:

It would emit a polygon trail (like swords do in many console games) from a line of defined length, when fired the line would exist for a given time and be attached to the piece it's fired from (including rotation), if it moves in a way that intersects a collision primitive damage is dealt to the target. Each time the weapon is fired it could hit each target only once. The explosion effect is spawned whenever it intersects. Range would be counted from the center of the attacker to the edge of either the footprint or the collision primitive of the target. Only the trail is visible, it's assumed that the modder will create the look of the sword itself. By default the sword would "reload" when FireWeaponX returns instead of having a reload time.

IsSword: The tag that defines a weapon as this type.
SwordLength: Length of the collision line.
SwordVisibleLength: If desired the visible length can be different from the actual length, defaults to the value of SwordLength.
Color/ColorRGB: Obvious.
Intensity: Alpha for the trail.
Duration: Time the sword remains active after being fired.
TrailTime: Time each trail segment exists after being emitted.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

I *NEED* MELEE

+9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9^9^9^9^9^9^9
^9^9^9^9^9^9^9
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Re: Sword weapontype

Post by Guessmyname »

KDR_11k wrote:IsSword: The tag that defines a weapon as this type.
I'd rather we used another rendertype for this
KDR_11k wrote:SwordLength: Length of the collision line.
I think there's already a length tag - for lasers
KDR_11k wrote:SwordVisibleLength: If desired the visible length can be different from the actual length, defaults to the value of SwordLength.
And I think there's something similar to this for lasers as well, but I can't remember what it's called...
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Sword weapontype

Post by zwzsg »

I think all we need for melee is some tag that make weapon aims for the closest side of the target footprint, instead of aiming for the target center.

Not all melee would need polygon trail, and polygon trail could be used for ranged weapons as well.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Post by Pxtl »

I would think the polygon trail would be something more general - just a part that you could show/hide - when it is hidden, the trail emission stops, when it is visible, it starts. Just show it when the sword is swinging. After all, the polygon trail would be nice for other uses, wouldn't it?
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Re: Sword weapontype

Post by Neddie »

zwzsg wrote:I think all we need for melee is some tag that make weapon aims for the closest side of the target footprint, instead of aiming for the target center.

Not all melee would need polygon trail, and polygon trail could be used for ranged weapons as well.
I agree with the lord of scripting.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Sword weapontype

Post by Pxtl »

zwzsg wrote:I think all we need for melee is some tag that make weapon aims for the closest side of the target footprint, instead of aiming for the target center.

Not all melee would need polygon trail, and polygon trail could be used for ranged weapons as well.
Correct me if I'm wrong, but isn't, for the purposes of projectile collision, the sphere used instead of the footprint? Thus, all that really needs to happen is that range calculations should add the radius of the target's collision sphere in determining if a unit can be hit?

The only real problem occurs if you have a unit where the footprint is substantially smaller than the collision sphere, preventing a hand-to-hand unit from getting close enough to attack. Which is why I see you want to use the footprint... but that approach creates a strange inconsistency where the footprint is used for hand-to-hand while the sphere is used for projectiles.

But I'm neither a modder nor coder - just a humble tool-maker, so I should STFU and GBTW.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

No I tried that already some time ago on request of smoth (offsetting the weapon range with collision sphere size on checks whether a unit can fire) but, while this did make the unit fire the weapon correctly, the weapon didn't deal any damage, possibly because damage calcs work on the center of a unit. (so AoE of weapon would need to be > collision sphere size of attacked unit)

Also IIRC it kept pushing it's target like mad to get to the center :-)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Oh yes, the sphere blocking damage is fun. I had that issue in an early version of CvC, sometimes drones would take no damage at all.

What I think I forgot to mention is that the sword would check whether the path it moved (can be linear interpolation) intersected with the target, not just its current position each frame. When I tried to use beamlasers fast swings failed to connect.

While we're at it, would be nice if all pgrojectiles checked for collision on a line between their old and new position rahter than just their current position each frame, fast weapons tend to go through small units (e.g. the Tiger's ion cannon tends to go through drones and turrets in CvC if they are at just the right distance).
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Post by Pxtl »

Tobi wrote:No I tried that already some time ago on request of smoth (offsetting the weapon range with collision sphere size on checks whether a unit can fire) but, while this did make the unit fire the weapon correctly, the weapon didn't deal any damage, possibly because damage calcs work on the center of a unit. (so AoE of weapon would need to be > collision sphere size of attacked unit)

Also IIRC it kept pushing it's target like mad to get to the center :-)
It sounds like several issues then - the unit AI also attempts to get into firing range based on range (not range + target radius), and the damage calculation only considers damage that hits the center of a unit...

that can't be right, can it? Wouldn't that mean that peewees do no damage to Krogoths? After all, if the weapons collide when they hit the surface of the Krogoth's sphere, and the damage dealt is calculated based on the blast radius and distance to centre, woudln't that mean that peewees wouldn't hurt? Otherwise I don't see how a peewee shell hitting the surface of a hitsphere differs from a sword... unless this is one more way that lasers differ from normal weapons (and the sword is actually a hidden laser, not a hidden projectile).
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Post by PicassoCT »

My Suggestion for a dirty Work around - the Swoardarms as diffrent Variations of Towers, that are all attached to the Shoulders, and are put visibel and after a fast Move invisibel to create the Ilusions of a Swoardfight, once the Front of the Spheres touch each other ;)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

As usual I have no idea what the hell Picasso is trying to suggest or why he thinks it's a good idea.
User avatar
LathanStanley
Posts: 1429
Joined: 20 Jun 2005, 05:16

Post by LathanStanley »

KDR_11k wrote:As usual I have no idea what the hell Picasso is trying to suggest or why he thinks it's a good idea.
amusing :lol:

he's thinking I think....

Piccasso? um... that dosen't make much sense.. but I think I can understand that you mean to "spawn" something when the "attack" is ordered to "force" the attack on the said "target?"...

uhh... um... way beyond me.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Post by PicassoCT »

Units like Ships have TurretTowers (Moving Weaponheads) with the Cannons inside. Now to make a SwoardArm for a Unit you just need to modell it and make it a Tower that like on a Ship is resting (and turning around) the Shoulders of the Unit. The Tower could start moving if the Enemy Sphere comes in ShortRange, fire a invisible Shot once it has aimed enough on the Target. After the Turretower is "fired" and had its hit, the Tower has a "Reset" and the Process starts again. Bad idea ? Maybe.

Sorry if some of my Posts are getting worser, but i am elsewhere with my thoughts right now.. Hope you don`t feel offended..
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

That's basicly how we've been trying to implement melee at the moment
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

We can move firepoints any way we want, the problem is that weapon ranges are measured from the center of the attacker to the center of the target, for larger targets that could mean the attacker touching the target already and still not being in range since the target is larger than the range.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

Argh said he had melee all figured out. Maybe he can enlighten ye heathens around 'ere that seeketh it. :)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

He said he uses beamlasers which works somewhat but isn't that good.
Post Reply

Return to “Feature Requests”