grayman Posted February 22, 2020 Report Share Posted February 22, 2020 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. 1 Quote Link to comment Share on other sites More sharing options...
grayman Posted February 23, 2020 Report Share Posted February 23, 2020 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? Quote Link to comment Share on other sites More sharing options...
duzenko Posted February 23, 2020 Report Share Posted February 23, 2020 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? Quote Link to comment Share on other sites More sharing options...
grayman Posted February 23, 2020 Report Share Posted February 23, 2020 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. Quote Link to comment Share on other sites More sharing options...
grayman Posted February 23, 2020 Report Share Posted February 23, 2020 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. Quote Link to comment Share on other sites More sharing options...
duzenko Posted February 24, 2020 Report Share Posted February 24, 2020 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? Quote Link to comment Share on other sites More sharing options...
kingsal Posted February 24, 2020 Report Share Posted February 24, 2020 6 hours ago, duzenko said: Can you test the @grayman changes? Awesome guys! I will run through this tonight. Quote Volta Missions: Volta and the Stone, Volta II: Cauldron of the Gods Standalones: Snowed Inn, Hazard Pay Moongate Ruckus Link to comment Share on other sites More sharing options...
kingsal Posted February 25, 2020 Report Share Posted February 25, 2020 @duzenko - So I downloaded the latest source code of the SVN and will try to compile it. Do you know where I can grab all the newest content? Do I need any of that for this latest build to work? Quote Volta Missions: Volta and the Stone, Volta II: Cauldron of the Gods Standalones: Snowed Inn, Hazard Pay Moongate Ruckus Link to comment Share on other sites More sharing options...
kingsal Posted February 25, 2020 Report Share Posted February 25, 2020 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. Quote Volta Missions: Volta and the Stone, Volta II: Cauldron of the Gods Standalones: Snowed Inn, Hazard Pay Moongate Ruckus Link to comment Share on other sites More sharing options...
grayman Posted February 25, 2020 Report Share Posted February 25, 2020 Adding impulse/damage should be doable. Quote Link to comment Share on other sites More sharing options...
VanishedOne Posted February 25, 2020 Author Report Share Posted February 25, 2020 (edited) 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 February 25, 2020 by VanishedOne Quote Some things I'm repeatedly thinking about... - louder scream when you're dying Link to comment Share on other sites More sharing options...
kingsal Posted February 26, 2020 Report Share Posted February 26, 2020 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. Quote Volta Missions: Volta and the Stone, Volta II: Cauldron of the Gods Standalones: Snowed Inn, Hazard Pay Moongate Ruckus Link to comment Share on other sites More sharing options...
VanishedOne Posted February 26, 2020 Author Report Share Posted February 26, 2020 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. Quote Some things I'm repeatedly thinking about... - louder scream when you're dying Link to comment Share on other sites More sharing options...
kingsal Posted February 26, 2020 Report Share Posted February 26, 2020 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. Quote Volta Missions: Volta and the Stone, Volta II: Cauldron of the Gods Standalones: Snowed Inn, Hazard Pay Moongate Ruckus Link to comment Share on other sites More sharing options...
VanishedOne Posted February 26, 2020 Author Report Share Posted February 26, 2020 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. Quote Some things I'm repeatedly thinking about... - louder scream when you're dying Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.