Jump to content
The Dark Mod Forums

Recommended Posts

Posted (edited)

EDIT: This maybe should've been in the editors guild instead of here, whoopsie.

I am working on a map and trying to design a breakable wooden object so that my players can bash their way into a junky old wooden hut. So far, I've converted a func_static model into a func_damageable that triggers a func_remove, func_emitter for some sparks, and speaker for a wood smashing noise.
breakabledoorsetup.thumb.jpg.41de8a961957b48a9c7f94924d7e7939.jpg
This solution is working, but I have a couple questions about it:
 1. Right now the effects I've put together are missing a little spice - I'd like the object to spawn some wooden plank giblets when it breaks that go flying generally-up-and-away from the player, and then remain as physics objects on the ground. I saw this sort of thing referred elsewhere on the wiki as "flinder", and I found the junk models I'd like to use, but I'm having trouble finding a generic entity-with-velocity-and-spread multi-spawner? Maybe I've just missed an obvious but weirdly named func somewhere?

 2. Is there an easier built in way to do this with fewer moving parts? I found func_breakable, which had a lot more built in spawnargs (and the whole flinder mechanic), but that seemed to be optimzed for turning brushes into breakable glass panes. When I changed my func_static's class to func_breakable, the model disappeared, so it seems like its not the tool for this job unless I did something wrong.

 3. If the answer to (2) is "not really", is there a good way for me to duplicate this work so that I can make more breakable wooden objects that work basically the same way? Behind this door, I would like to make a makeshift "barricade" of several pieces of furniture and crates and etc that I would also like the player to be able to smash through. I can copy and paste the whole setup and just change the model, but I'm wondering if I can make my own kind of multi-entity prefab definition in DR that only has a few configurable bits that I actually want instead of all possible args for func_emitter, func_remove, speaker, etc.

Edited by chumbucket91
  • Like 1
Posted

After doing a bit more homework and poking around, I've discovered that the answers to (2) and (3) are "make your own prefab", and a prerequisite for doing that is "make a proper project folder for your map, in which you can place a prefabs/ subfolder", which is a thing that I should have done anyways before I spent several hours making a wooden shack for players to break into, and also a long winding forest path up to said shack.

So the only real question I have now is (1) - is there any sort of entity multi-spawner for chunks of physics objects that I can use for wooden flinder.

Posted

I think here is some info about flinders: https://wiki.thedarkmod.com/index.php?title=Breakable_objects#What_happens_when_an_entity_dies?

So I think you replace the door model with different door pieces that fall to the ground. Maybe it's possible to make a custom one for wood pieces. Also maybe it's good to add a quick smoke particle or something that happens when it breaks so (maybe) you can hide the transition.

 

I wonder if you could set:

"def_flinder"               "models/darkmod/junk/door01_broken_piece.lwo"
"flinder_offset"            "0 0 -5"
"def_flinder1"              "models/darkmod/junk/door01_broken_piece1.lwo"
"flinder_offset"            "0 0 5"
"def_flinder2"              "models/darkmod/junk/door01_broken_piece2.lwo"
"flinder_offset"            "0 5 -5"
"def_flinder3"              "models/darkmod/junk/door01_broken_piece3.lwo"
"flinder_offset"            "0 -5 0"

Because I think"flinder_count1" probably makes copies and maybe you don't want same looking door pieces.

 

At least that's my idea currently. But I never tried any of this.

Posted
9 hours ago, datiswous said:

I wonder if you could set:

"def_flinder"               "models/darkmod/junk/door01_broken_piece.lwo"
"flinder_offset"            "0 0 -5"

Gave all of these flinder defs a shot in the door func_damageable entity, and had no luck - if these flinder objects spawned, they didn't spawn near the model or anywhere in the viewport that I could see. I did assume that I wasn't supposed to redefine "flinder_offset" 4 times? and named the subsequent ones "flinder_offset1", "flinder_offset2", etc. and tried a few other variations as well. Nothing seemed to spawn, and there were no interesting console entries either.

Any debugging tools I could try to look for these?

Posted

While working on the Fragile Bottles mod (idea / release) I examined the Flinder feature and my conclusion was that it never was fully realized and it is not ready for general / complex use.

Here is the relevant topic:

For the breakable bottles I couldn't figure out safe offsets and I found flinders would often clip with one another or spawn where they shouldn't and I opted for a scripted solution to have full control. I originally intended bottles to break into two pieces but sizes and heights of bottles vary and I ended up using only one piece but that piece along with a particle and the sound sell the effect nicely, imho.

For flinders to work I guess the first step is to work with the original model and split it into pieces while retaining the origin. I think this is the most important aspect to avoid issues. If you then add some dust particles you can probably hide the swap a little and do away with less pieces. Since you can hardly control where the pieces will end and to prevent the player from getting stuck, flinders will have to be frobable or perhaps non-solid and fade out shortly after spawning.

"In Remembrance of Him" by @RPGista can perhaps be a source of inspiration. Go to coordinates 12305 -5900 -185 for a less elaborated but still effective alternative to what you are trying to achieve.

  • Like 2

TDM_Modpack_Thumb_50.png

Posted

I have a working setup of a destroyable 3D objects in the form of the camgoyle, security cameras and the turret. I've extended the flinderize system for these entity types, but the basic components that should work on any static entity type are:

  • A health spawnarg, so that the entity knows when to break. By default it'll be vulnerable to sword attacks, broadheads, fire arrows and fast-moving moveables.
  • A "broken" spawnarg, which defines the model to switch to when the entity is broken.
  • The flinder spawnargs shown above.

The damage detection on a func_static is simple. For example, a fire arrow's splash damage is always 30 as long as the entity was within the splash radius, and you can't disable certain damage types. I don't recall a general-purpose entity type that offers better control atm, but technically you could turn your door into a disabled security camera if you wanted to make use of all of the damage spawnargs described on this wiki page, but you'd need to assign a simple collision mesh to the door.

  • Like 2
Posted (edited)

idTech4 engine has used on Doom 3 already had a destructible entity system for the destructible barrels, was that removed? 

In Doom3 you can create debris entities and they become physics entities, never heard of this "flinder" stuff so I assume is a new TDM entity type.

Don't know if this is useful for TDM, if not ignore, but who knows could give some hints. 

This was how I created a simple destructible wood barrel in Doom 3 engine. 

First I defined the broken debris peace's: (yes they are individual entities and models) 

entityDef debris_woodbarrel_1 {
	"spawnclass"				"idDebris"
	"mins"						"-3 -3 -3"
	"maxs"						"3 3 3"

	"model" 					"models/maps/temple/mapobj/pipo broken/pipo_debri_1.lwo"
	//"skin"						"skins/exp_barrel_red"

	"health"					"0"					// amount of damage projectile can take if damaged (0 means it can't be destroyed)
	"velocity"					"1 1 450"			// how fast the projectile leaves the gun (or distance if fuse is 0)
	"random_velocity"			"1"						
	"angular_velocity"			"105 215 10"	    // how the projectile is rotating when it leaves the gun
	"thrust"					"0"					// the rate of acceleration (always in the direction of the projectiles model)
	"thrust_start"				"0"					// when to start accelerating
	"thrust_end"				"0"					// when to stop accelerating
	"linear_friction"			"1.0"				// "air" friction
	"angular_friction"			"0.1"
	"contact_friction"			"0.9"
	"bounce"					"0.1"				// how much speed a projectile retains when it bounces off of objects (coefficient of restitution).  0 means no bounce.
	"mass"						"50"
	"gravity"					"1066"				// how much gravity affects the trajectory.  gravity direction is same as the entity that fired it.
	"fuse"						"10"					// how long before the projectile is removed or self-detonates.  Use 0 for beam weapons (velocity == distance).

	"detonate_on_fuse"			"1"					// whether projectile should detonate when it's fuse runs out
	"detonate_on_death"			"0"					// whether projectile should detonate when it's "killed" (health runs out)
	"detonate_on_world"			"0"					// whether projectile should detonate when it hits an obstacle
	"detonate_on_actor"			"0"					// whether projectile should detonate when it hits a character in the game

	"smoke_fly"					"debristrail.prt"	// particle effect while in the air
	"snd_bounce"				"tray_impact"

	// parametric particles -- temp
	"model_detonate"			""
	"smoke_detonate"			""					// particle effect when detonates
	"smoke_fuse"				""
	"smoke_bounce"				""
}

entityDef debris_woodbarrel_2 {
...
}

etc,

then I define the main entity:

entityDef moveable_woodbarrel {
	"editor_color"				"0 .5 .8"
	"editor_mins"				"-16 -16 0"
	"editor_maxs"				"16 16 48"
	"editor_rotatable"			"1"
	

	"editor_usage"					"Moveable woodbarrel. Works just like a func_moveable. However the barrel"
	"editor_usage1"					"has special handling to make it appear more round. This version also explodes when damaged enough."
	"editor_usage2"					"Only add model, model_detonate or model_burn or health to override defaults"
	"editor_var burn"				"number of seconds to burn before exploding."
	"editor_model model_damage"		"model to leave as damaged base"
	"editor_model model_detonate"	"ips model to switch to for explosion."
	"editor_model model_burn"		"ips model to show when on fire."
	"editor_var def_debris"			"add as many as you like, debris1, debris2, etc.. "
	"editor_var health"				"how much health the barrel has, default is 5. If burn is set to 1, the health is effectively doubled so you have to kill it twice to get the explosion"
	"editor_var respawn"			"if non zero the number of seconds to respawn after killed"
	"editor_var respawn_range"		"no player in distance range to actually respawn - default 256"
	"editor_var respawn_again"		"try again in seconds if player in range - default 10"
	"editor_var triggerTargets"		"if set to 1 will trigger targets after being killed"
	"editor_mat mtr_lightExplode"	"light shader to use for explosion"
	"editor_mat mtr_lightBurn"		"light shader to use for burning"
	
	"spawnclass"				"idExplodingBarrel"

	"density"					"0.02"
	"friction"					"0.2"
	"bouncyness"				"0.4"
	"def_splash_damage"			"damage_moverCrush"
	"ignore_player"	            "1" 
	"model"						"models/maps/temple/mapobj/pipo.lwo"
	"def_debris"				"debris_woodbarrel_1"
	"def_debris1"				"debris_woodbarrel_2"
	"def_debris2"				"debris_woodbarrel_3"
	"def_debris3"				"debris_woodbarrel_4"
	"def_debris4"				"debris_woodbarrel_5"
	"def_debris5"				"debris_woodbarrel_6"
	"def_debris6"				"debris_woodbarrel_7"
	"def_debris7"				"debris_woodbarrel_8"
	"def_debris8"				"debris_woodbarrel_9"
	"health"					"35"
	"snd_explode"				"wood_barrel_breaking"
	"snd_bounce"				"woodimpact"
	
}

This was the effect:

https://drive.google.com/file/d/1lsXwNssxp-QO3MZKOmUiBd1DWhd0V7HY/view?usp=sharing

Hope this helps. 

Edited by HMart
Posted (edited)
13 hours ago, Dragofer said:

A "broken" spawnarg, which defines the model to switch to when the entity is broken.

Ah, this might be the piece I'm missing.
What would I set this to if I still want to spawn the flinderize pieces but I want the model to effectively disappear? The point of attacking the door is so that you can proceed to walk through it, so I don't want to leave an even-more-broken mesh behind, if that makes sense. Currently I'm removing the door with a func_remove when it reaches a health value of <= 0, but if I could instead replace it with some empty mesh maybe the flinder bits will stick around.

Edited by chumbucket91
Posted
9 hours ago, chumbucket91 said:

Ah, this might be the piece I'm missing.
What would I set this to if I still want to spawn the flinderize pieces but I want the model to effectively disappear? The point of attacking the door is so that you can proceed to walk through it, so I don't want to leave an even-more-broken mesh behind, if that makes sense. Currently I'm removing the door with a func_remove when it reaches a health value of <= 0, but if I could instead replace it with some empty mesh maybe the flinder bits will stick around.

You could use the spawnarg hideModelOnBreak 1 to hide the entity completely. You may still need to set the broken spawnarg, even if its the same as the model spawnarg.

A suitable broken model if it were still visible could be something that just has the hinges and one board left, but probably not that easy to tweak models when youre still new to mapping.

Posted (edited)
Quote

basic components that should work on any static entity type

It seems that this isn't as much of the case as one would hope, unless I'm still doing something else wrong. I added the broken and hideModelOnBreak spawnargs to my current setup, but the model isn't hidden on destruction and the flinders still don't spawn.

I then took a slightly different track and tried to rig the security camera to actually be a door. This approach seems like the correct-er one, although the sound effect when striking it with a sword seems a bit off. Like its repeating every frame that the sword is in contact with the model, maybe? Also, setting the clipmodel correctly is giving me trouble, so you have to swing at some air on the left side of the door to destroy it - I'd like TDM to derive the clip from whatever is set in the model arg, but setting a clipmodel to 0 or "" or some other obviously invalid value doesn't seem to trigger that behavior like the documentation strings claim it does - instead, it throws an error when I attempt to map (dmap completes just fine either way).

In case it helps, I've attached a sample .map with a player start, an inventory full of smashing gear, a light, and my two breakable-ish doors. The one on the left is the doorified-camera, which sounds weird and clips weird (and crashes the game when I try to correct the latter by setting the clipmodel spawnarg to ""), and the one on the right is my model-turned-damageable and doesn't flinder or disappear. I'd be happy if I could get the left one to clip like its visual model (I would like to reuse this as a prefab, and swap out different models like half-broken crates or barrels - so just creating my own clipmodel isn't great (although it looks like a ~30s task based on https://wiki.thedarkmod.com/index.php?title=Moveables so maybe thats the way to go)), or the right one to flinderize and disappear. Is there something I'm still missing or misunderstanding about either setup?

EDIT: Making sure I've uploaded the right version of the testmap I've made

breakable_door_flinder.map

Edited by chumbucket91

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.

  • Recent Status Updates

    • datiswous

      I moved from Manjaro Linux (rolling release) to Linux Mint (LTS). One of the reasons was that I found the updates a bit too often and long. But now on Mint I get updates every day, although they're usually small updates.
      · 3 replies
    • JackFarmer

      "Hidden Hands: Vitalic Fever" - new update available including subtitles & compressed briefing video (thanks to @datiswous) and several fixes.
      · 0 replies
    • Wolfmond

      🇬🇧

      2025-04-20
      I'd like to track my level design progress a bit more often now, so I'm using the feed in my profile here.
      I've been working intensively on Springheel's YouTube course over the past few days. I'm currently up to lesson 8. There is so much information that needs to be processed and practiced. 
      I have started to create my own house. As I don't have the imagination to create a good floor plan, I grabbed a floor plan generator from Watabou and experimented with it. I chose a floor plan that I will modify slightly, but at least I now have an initial idea. 
      I used two guards as a measuring tape: The rooms are two guards high. It turned out that I can simply double the number of boxes in DarkRadiant in grid size 8 that are drawn in the floor plan. 
      I practiced the simplest things on the floor plan first. Drawing walls, cutting walls, inserting doors, cutting out frames, creating VisPortals, furnishing rooms.
      I have had my first success in creating a book. Creating a book was easier than I thought. I have a few ideas with books. The level I'm creating will be more or less a chill level, just for me, where I'll try out a few things. I don't have an idea for my own mission yet. I want to start small first.
      For the cellar, I wanted to have a second entrance, which should be on the outside. I'm fascinated by these basement doors from the USA, I think they're called Bilco basement doors. They are very unusual in Germany, but this type of access is sometimes used for deliveries to restaurants etc., where barrels can be rolled or lifted into the cellar. 
      I used two Hatch Doors, but they got completely disoriented after turning. I have since got them reasonably tamed. It's not perfect, but it's acceptable. 
      In the cellar today I experimented with a trap door that leads to a shaft system. The rooms aren't practically finished yet, but I want to continue working on the floor plan for now. I'll be starting on the upper floor very soon.

      __________________________________________________________________________________
      🇩🇪

      2025-04-20

      Ich möchte nun mal öfters ein bisschen meinen Werdegang beim Leveldesign tracken, dazu nutze ich hier den Feed in meinem Profil.
      Ich habe mich in den vergangenen Tagen intensiv mit dem Youtube-Kurs von Springheel beschäftigt. Aktuell bin ich bis zu Lektion 8 gekommen. Das sind so viele Informationen, die erstmal verarbeitet werden wollen und trainiert werden wollen. 

      Ich habe mich daran gemacht, ein eigenes Haus zu erstellen. Da mir die Fantasie fehlt, einen guten Raumplan zu erstellen, habe ich mir einen Grundrissgenerator von Watabou geschnappt und damit experimentiert. Ich habe mich für einen Grundriss entschieden, den ich noch leicht abwandeln werde, aber zumindest habe ich nun eine erste Idee. 

      Als Maßband habe ich zwei Wächter genommen: Die Räume sind zwei Wächter hoch. Es hat sich herausgestellt, dass ich in DarkRadiant in Gittergröße 8 einfach die doppelte Anzahl an Kästchen übernehmen kann, die im Grundriss eingezeichnet sind. 

      Ich habe bei dem Grundriss erstmal die einfachsten Sachen geübt. Wände ziehen, Wände zerschneiden, Türen einsetzen, Zargen herausschneiden, VisPortals erstellen, Räume einrichten.

      Ich habe erste Erfolge mit einem Buch gehabt. Das Erstellen eines Buchs ging leichter als gedacht. Ich habe ein paar Ideen mit Bücher. Das Level, das ich gerade erstelle, wird mehr oder weniger ein Chill-Level, einfach nur für mich, bei dem ich ein paar Sachen ausprobieren werde. Ich habe noch keine Idee für eine eigene Mission. Ich möchte erst einmal klein anfangen.

      Beim Keller wollte ich gerne einen zweiten Zugang haben, der sich außen befinden soll. Mich faszinieren diese Kellertüren aus den USA, Bilco basement doors heißen die, glaube ich. Diese sind in Deutschland sehr unüblich, diese Art von Zugängen gibt es aber manchmal zur Anlieferung bei Restaurants etc., wo Fässer dann in den Keller gerollt oder gehoben werden können. 
      Ich habe zwei Hatch Doors verwendet, die allerdings nach dem Drehen vollkommen aus dem Ruder liefen. Inzwischen habe ich sie einigermaßen gebändigt bekommen. Es ist nicht perfekt, aber annehmbar. 
      Im Keller habe ich heute mit einer Falltür experimentiert, die zu einem Schachtsystem führt. Die Räume sind noch quasi nicht eingerichtet, aber ich möchte erstmal am Grundriss weiterarbeiten. In Kürze fange ich das Obergeschoss an.



      · 2 replies
    • JackFarmer

      On a lighter note, thanks to my cat-like reflexes, my superior puzzle skills and my perfect memory, I was able to beat the remastered version of "Tomb Raider: The Last Revelation" in a new superhuman record time of 23 h : 35 m, worship me!
      · 5 replies
    • Goblin of Akenash

      My mapping discord if anyone is interested, its more of a general modding thing rather than just for TDM 
      https://discord.gg/T4Jt4DdmUb

       
      · 0 replies
×
×
  • Create New...