Jump to content
The Dark Mod Forums
VanishedOne

Powder kegs

Recommended Posts

Hmmm, ok. I know some flinders are script-spawned. I assumed these were also.  
 

Hints on what C++ you were reviewing? (Save me some time.)

 

Edit: Fixed. Will clean up and commit tomorrow.

  • Like 1

Share this post


Link to post
Share on other sites

When a firearrow hits an exploding crate, it imparts its linear and angular velocities to the flinders.

For the case of the firearrow, this works ok: the flinders fly off, ending up scattered around on the floor.

For the case of holding a torch next to the crate, however, the torch has no velocities, so the crate simply breaks (no explosion) and the flinders fall down to the floor.

I suggest giving random velocities to the flinders rather than taking them from the object that triggered the explosion. This should fling flinders in all directions, regardless of what the activating object was.

Things to check: how do other breakables (fractures, etc.) deal with their flinders. Breaking a window with an arrow might look better if the flinders don't fly away.

Comments?

Share this post


Link to post
Share on other sites
1 hour ago, grayman said:

When a firearrow hits an exploding crate, it imparts its linear and angular velocities to the flinders.

For the case of the firearrow, this works ok: the flinders fly off, ending up scattered around on the floor.

For the case of holding a torch next to the crate, however, the torch has no velocities, so the crate simply breaks (no explosion) and the flinders fall down to the floor.

I suggest giving random velocities to the flinders rather than taking them from the object that triggered the explosion. This should fling flinders in all directions, regardless of what the activating object was.

Things to check: how do other breakables (fractures, etc.) deal with their flinders. Breaking a window with an arrow might look better if the flinders don't fly away.

Comments?

I tested this with a sword strike but anyway

The `external` entity in idEntity::SpawnFlinder seems to be fixed to `gameLocal.world` by idPhysics_RigidBody::ApplyImpulse

So not sure how you end up with fire arrow impulse

In any case, idEntity::SpawnFlinder assigns random velocity and impulse but it's not respected per my description above

Did you commit your fix to svn yet?

 


Amnesty for Bikerdude!

Share this post


Link to post
Share on other sites

I have more testing to do.

there’s no impulse per se, but the fire arrow’s linear and angular velocities are assigned to the flinders. There's also some random adjustment applied.

Share this post


Link to post
Share on other sites

Changes committed in rev 8606.

I decided not to fiddle with the velocities. A firearrow will impart more velocity than a sword strike, for example.

Breaking does not mean exploding.

Share this post


Link to post
Share on other sites
On 2/21/2020 at 12:39 AM, kingsal said:

Would like to have script support for a better breakable crate, rather than hacking it together with stims and responses and firing invisible explosions to make it flinder.

 

Edit: The basic destructable crate does not send and impulse to the flinders. They just spawn and float mid-air which obviously isnt how that should work. 

Can you test the @grayman changes?


Amnesty for Bikerdude!

Share this post


Link to post
Share on other sites

Scratch that- I was able to get it working without needing the new content. 

 

@duzenko @grayman - This looks great! Needs a lot of testing but this is a good start I think. Is it still possible to add an impulse to these flinders? Im thinking it would be beneficial in some cases where a mapper might want to give the illusion of an explosion without having to spawn an explosion and then trigger it. 

Also- Will we be able to add velocity / fall damage to the crate and bottles? So in the case a player throws a bottle or crate hard enough it shatters. 

Share this post


Link to post
Share on other sites
4 hours ago, kingsal said:

Is it still possible to add an impulse to these flinders? Im thinking it would be beneficial in some cases where a mapper might want to give the illusion of an explosion without having to spawn an explosion and then trigger it. 

Also- Will we be able to add velocity / fall damage to the crate and bottles? So in the case a player throws a bottle or crate hard enough it shatters. 

Have you looked at idDebris, like I mentioned on the tracker? The powder keg (not your urn, the w.i.p. idExplodingBarrel keg) spawns some as def_debris. Edit: however, just spawning one from the console doesn't 'launch' it. I just had a look for a way to do that at will, and didn't find one.

(Edit2: by the way, my suggestion for creating 'the illusion of an explosion' would be the FX system: you can tie together sound, lights and particles, and there's even a 'launch' command that's supposed to launch projectiles, though it was unused in D3 and I haven't tested it. Maybe launching debris could be added to that.)

https://wiki.thedarkmod.com/index.php?title=Breakable_objects#Todo claims that wine bottles break under force, but I've been throwing one around and it didn't break even after I added "max_stress" and "max_torque" spawnargs.

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

Ill have a look at the def_flinder stuff. Can you send me the .def of the idExplodingbarrel you are talking about?

How in depth mappers want to go with custom explosions is up to them I suppose, but basic flinder chunks with impulse will better sell the illusion. Its hard to do that without custom texture work and fiddling with the fx editor.  

 

Share this post


Link to post
Share on other sites

The def in the OP should still be current. There's a test map to go with it here.

One detail: idDebris is intended to have a 'fuse' like a grenade and be removed from the game world when it runs out (optionally with particle effects, and there seems to be shaderparm support for 'burnaway' effects like D3's dead monsters' too). Whereas flinders like those used by the wine bottles are standard moveables, so they persist and can be grabbed.

While getting the links to my previous posts I found this one too, which may be of interest re. mappers' control of collision effects.


Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

I checked out the powder keg. Thats pretty interesting and seems like a good start. 

I personally like the moveable flinder object method as you get more realistic physics and can  attach more properties to those  ( AI suspicion , or sound prop alerts, ect).  However, maybe idDebris are safer since this is their intended use.  Can idDebris  fly in a random vector when spawned?  Right now they just slide across the floor. This might be because they spawn at the barrels origin. 

 

Either way both solutions  can serve different purposes in my opinion. Maybe for exploding barrels it makes sense to use idDebris, but for breakable crates and bottles its better to leave behind moveable flinders. 

Share this post


Link to post
Share on other sites

It might be worth fiddling with the spawnargs, which are possibly just D3 values carried over. If "velocity" "100 100 00" uses the world axis then it's 0 in global z. (Then "random_velocity" is turned on, which apparently semi-randomises the values in all three axes.) Also "gravity" "266" must be pulling them downwards.

Yes, I agree it's good to have both. The flinder system seems to be intended for cases where the direction comes from an external impulse, and spawnargs only determine mass, friction, etc.


Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...