Weapon polygons that would do damage by collision

Post your Feature Requests here...
Veleran
Posts: 891
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Weapon polygons that would do damage by collision

Post by Veleran » Thu Jul 24, 2008 4:32 pm

Could we have in the future melee weapons for the standard default player,
that will do damage by the collision of the weapon polygons?

Specially in hack n slash games where you re often surrounded by hordes of monsters,
a 180 degrees swing animation of a large two handed sword,could hit many targets at once,as far as the weapon can reach.

And,the attack animation would stop if the sword collided with non destructible world geometry.

I personaly could use this much,since i work in something in which
the player is often blocked from all directions by monsters.

Any luck,to get this in the todo list?

Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Re: Weapon polygons that would do damage by collision

Post by Danimita92 » Thu Jul 24, 2008 5:31 pm

I think it's already been done. Simply in weapon.ini you put
weapontype (i think) = melee

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Weapon polygons that would do damage by collision

Post by Jay » Fri Jul 25, 2008 12:18 pm

I know what he means but it is going to need many hacks in the rf source code.

Richt now, weapons have their collision turned off because otherwise they would collide with their main actor. So lets say i would enable the collision one or more of three thinghs could happen:

1. The player/pawn would be stuck in its place because they are colliding with the actor of the
2. The player/pawn can walk, but will leave the weapon behind
3. The player/pawn would loose its health because it's colliding with the weapon

It's a very good idea though. It could be possible to make a similar thingh, a DamageActorsDir(...) command that has the following options:

DamageActorsDir(char* attribute, char* damage, float range, float direction, float AoE);

direction is the direction (seen from the pawns point of view) in radians and the AoE would be the area of effect in degrees.
Everyone can see the difficult, but only the wise can see the simple.
-----

User avatar
Sph!nx
Posts: 297
Joined: Thu Feb 22, 2007 7:26 pm

Re: Weapon polygons that would do damage by collision

Post by Sph!nx » Fri Jul 25, 2008 3:38 pm

Excuse me, I'm a big n00b at this.

But, wouldn't it be possible to have two or three separate entities that move with the two or three bones of the sword in game?

Just my two cents...
Regards Sph!nx

Sven Co-op, DevEd: Development & Editing

User avatar
Sorington
Posts: 77
Joined: Tue Jun 17, 2008 3:42 pm
Contact:

Re: Weapon polygons that would do damage by collision

Post by Sorington » Fri Jul 25, 2008 4:11 pm

this could work... I think :?
Greetings, Sorington

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Weapon polygons that would do damage by collision

Post by Jay » Fri Jul 25, 2008 7:26 pm

Hm well yes this might work.... but it will be very very difficult. I don't think it would be worth the insane amount of work you had to put into it to get it work right.
Everyone can see the difficult, but only the wise can see the simple.
-----

User avatar
Graywolf
Posts: 75
Joined: Mon Apr 14, 2008 8:36 pm
Location: Anchorage, Alaska
Contact:

Re: Weapon polygons that would do damage by collision

Post by Graywolf » Sat Jul 26, 2008 9:42 am

Just an idea...

With a combination of the Simkin user object types I'm working on, and integrated physics, this might be really easy to implement. Create a Simkin object type that represents a physics object created from some sort of geometry data, and utilize the physics engine to do the work..?
"So, what's the life of a programmer like?" "...Huh? What life?!"

RF System X:
http://www.realityfactory.info/forum/vi ... f=9&t=3599

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Weapon polygons that would do damage by collision

Post by Jay » Sat Jul 26, 2008 10:30 am

Yes, but still the problem remains. The weapon collision was deactivated to let the weapons be attached to the player/pawns. Otherwise they would collide with the player too, and so they could not be attached to the player/pawns.

Well, i now have a different idea which can be used to do this. We use a bone or more than one bones which represent the tip of the sword / blade of an axe / edges of a two handed staff. And when this bone collides with a bounding box of an actor, this actor gets damaged. The bones will be optional and to get them to work, they have to be activated. This also has the advantage of lesser collision detection, as point / bounding box collisions are much less costy than polygon / bounding box collisions.

This way we can also have dual blades - one actor with two 'tip bones' or two actor weapons with one 'tip bone' each. The possibilites are endless.

EDIT: Now i see that this is suboptimal. As pawn weapons skeletons have to be the same as the ones of the actors they are attached to, this would need a large amount of work... I will see if i can fake it without useing bones.
Everyone can see the difficult, but only the wise can see the simple.
-----

Veleran
Posts: 891
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Re: Weapon polygons that would do damage by collision

Post by Veleran » Sat Jul 26, 2008 11:37 am

Colission with the player-you mean the player polygons i hope,
otherwise if you mean the player bounding box,i know-you cant get the sword far enough to avoid collision,

1.Now....if the problem is the collision of the sword polys,with the Player polygons,
well,simply the player sword should not hit the player himself-as in real life ..heheh....

So you just have to be carefull while making the animations for each weapon so the player is not hitting himself.
And,make sure that the Player hand that holds the sword,is not really touching the sword grip.
You could leave very little space between the hand and the sword so that the space is not visible.

In this case of course,this tip should be at the "adding weapons to the player" tutorials and FAQ,so everybody should know this and be carefull before making melee weapons for the player.
This is a trick,and i do not know if the engine should use such tricks.

If polygon collision detection is costly,maybe it could it be set to on/off for the standard player in his Weapon.ini

and for the Pawns you would set their Melee Weapons polygon colision detection on/off in the Pawn.ini for each Pawn
(i would preffer the pawn.ini than doing it manually using script commands in each Pawn script-and i am not a programmer).

-------------

2.As for the possibility that the sword will be left behind when the player walks through a narrow passage,,,
I hope that the animation can just stop.
Example:The walking animation stops when the sword hits the wall.
Or if you attack the wall and its is not destroyable,the player again stops the attack animation.

I do not know if you mean that when the sword collides a pawn bounding box
again,it would be separated from the player.
Maybe in this case the animation would stop without the sword being left behind.


3.If the player sword could make colision detection with the Pawn mesh polygons instead of their b.box,
I imagine that when the player hits pawns that have their weapon solid with their rest body,
you would often see the player destroying a monster by hitting the monster's weapon -or sheild.
But,for many this may be an unsignificant detail.
I expect that this colission detail is used in games where you dont have many pawns colliding at the same time,like one vs one fighting games.

-------------

4.One thing might happen-if not for sure,is the collision detection to fail when the 3D card is not big enough.

I remember that when i have many pawns on screen and it gets tough for the 3D card,the pawns lose many frames and the collision detection gets worse.
Last edited by Veleran on Sat Jul 26, 2008 12:35 pm, edited 2 times in total.

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Weapon polygons that would do damage by collision

Post by Jay » Sat Jul 26, 2008 12:03 pm

well actually, i just implemented the foundation of 'Damage Points' which every actor can have, they are bound to the skeleton and move with it, they work like bones just that you don't have to add them to the skeleton (you specify an offset and it moves with its parent bone), and they will do damage to actors and world models they hit.

And for the polygon collision, unfortunately all collision detection besides the StaticMesh collision detection is bounding box based, all the actor collision is bounding box based (This is why weapon collisions were deactivated in the first place)
Everyone can see the difficult, but only the wise can see the simple.
-----

Veleran
Posts: 891
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Re: Weapon polygons that would do damage by collision

Post by Veleran » Sat Jul 26, 2008 12:38 pm

Do you mean the player skeleton to have bones for optional weapons?
Of course in the pic,i have placed too many bones,but the damage area radius is shown.
Anyway,i expect that what you discribe is meant for the scripted player,while i still use the standard player.
Attachments
Weapon-bones-damage-area.jpg
Weapon-bones-damage-area.jpg (13.58 KiB) Viewed 2225 times

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Weapon polygons that would do damage by collision

Post by Jay » Sat Jul 26, 2008 5:41 pm

Nono i mean you can keep your original skeleton, of course you can also make additional bones, but it is not neccesary. For example you can add them at the hand bone with an offset so that it is placed at the tip of the sword or the middle (as you want it), or you can make new bones and add them at the new bones' places. This way you can keep your old skeletons and don't have to make them all new.

You can add a DamagePoint on any actor (player/sep/pawn/attribute/static mesh, i will also allow it for pawn weapons and player weapons when i have time) and it will move with the skeleton bone it is attached to. If any actor collides with it, it will get damaged.

I also plan to make a system so that their damage can be adjusted to allow random damage.
Everyone can see the difficult, but only the wise can see the simple.
-----

Veleran
Posts: 891
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Re: Weapon polygons that would do damage by collision

Post by Veleran » Tue Jul 29, 2008 4:30 pm

I use the generic monster scripts and dont have time to learn scripting,so i can add the damage points to these scripts,
when we have this new command.

Could you add the damage point to the genericmoster.s in the future whenever you find the time?

And,i wanted to ask if there is any possibility the damagepoints to be used in the weapon skeleton,instead of the master pawn.

I am not greedy,but i was wondering if i could have a pawn that uses a flail as a weapon,
with the damage point attached to the flail's ball bone.

This flail is a spiked ball attached to a chain,and it can swing.
The chain can extend forwards too.
If someone of you could remember an old arcade coin op game called Black Tiger,you will know.

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Weapon polygons that would do damage by collision

Post by Jay » Tue Jul 29, 2008 5:41 pm

Veleran wrote:I use the generic monster scripts and dont have time to learn scripting,so i can add the damage points to these scripts,
when we have this new command.

Could you add the damage point to the genericmoster.s in the future whenever you find the time?

And,i wanted to ask if there is any possibility the damagepoints to be used in the weapon skeleton,instead of the master pawn.

I am not greedy,but i was wondering if i could have a pawn that uses a flail as a weapon,
with the damage point attached to the flail's ball bone.

This flail is a spiked ball attached to a chain,and it can swing.
The chain can extend forwards too.
If someone of you could remember an old arcade coin op game called Black Tiger,you will know.

The problem is that weapons must ALWAYS have the same skeleton as the pawn/player they are attached to (or they don't work), so this won't do anything.
Everyone can see the difficult, but only the wise can see the simple.
-----

Veleran
Posts: 891
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Re: Weapon polygons that would do damage by collision

Post by Veleran » Tue Jul 29, 2008 8:30 pm

Yes-you re right - i forgot.
So,the Pawn player skeleton must have from the begining all the appropriate weapon bones,
and bone animations for the weapons he may use and require different animation.

I assume in the case of the ball in chain Weapon,
the flail bones will swing during the attack animations even if some other weapon is used,but will do damage only when you switch to the flail as active weapon.
All this,as long as each weapon has its own damagepoint bones,and the damage works only whenever you use the flail.

Nice feature would it be:a large boss could do damage by having damage points attached to bones close to some spikes in his head (and bash towards the player).
I wanted to ask if,

1.some of the damagepoints will be permanent-like body parts which always do damage,and

2.Other Weapon damage points will do damage only as long as the pawn has a specific weapon attached?

The script will turn on/off the damagepoint when you use each weeapon?
I mean i hope you can have different damagepoints for each weapon,and do damage only with the active weapon bones damagepoints.

3.And,could it be a collision detection for some of the pawn bones?

I mean if you have a dragon Boss Pawn,that has an attack animation in which he extends the Tail forward to hit the player.
If the tail's tip has a bone that is used to attach the damagepoint,
could that tail bone also do collision test,so the Dragon's tail wont move through walls and non-dectructible objects?

Another example:Skeleton Warriors pawns carry long spears and as the skeletons move,you can see the spears going through walls.
Of course,i would nt set the skeleton bounding box to fit the spear lenght,because the b.box would get so big you would hit the skeletons too easily.

I know that the projectiles can hit bones,yet i dont know about bone/bone collision - or bone/world polys.
If bone/world polys collision could be used for some of the pawns,
it could be used to end any animation when a "weapon" bone collides with world geometry.
Do you know if using existing commands,the "weapon" bones can have a collision test?

When projectiles hit in bonelevel = true,the whole mass of the spine bipeds?
If that is so,and the bone mass could be counted in your feature as an area of damage,
i would create large enough bones to be used by weapons for damagepoints,
and fit each weapon surface.

Post Reply