News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

Tutorial requests

Started by Zombie, July 23, 2014, 04:49:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zombie

Hey guys,

Does anyone have any info on the following subjects:

Adding a new weapon?

Spawn physics objects when an AI dies?

Blood decal projection information, where abouts in the source is it?

Feel free to PM me if you have any info you don't feel comfortable sharing on the forums.

Thanks

The Happy Friar

I want to say for spawning the physics objects you just replace the ragdoll defined in the .def file.  If you're looking for an AF type of physics object.  For a simple object (like a table) you should be able to add that to the gib section.  AF's might be spawnable via the gibs too, not 100% sure.  Haven't messed with that in a while.

Adding a 100% new weapon isn't hard, just a little bit tedious.  You need it's script & def, then the def defined the the player.def & script in the doom_main.script.  I normally take a weapon similar to what I want and just rename things in those files as a base.  Do you need more details? 

Zombie

This is a good start.

I'll be looking in to it in about a week or so, just R&D right now

deadite4

Yeah, we use the gib system to spawn our little body parts in hexen after a death. 

What are you looking to do with blood decals?  I know we have decals thrown onto walls/floor any time a monster is hit.

Zombie

Quote from: deadite4 on July 23, 2014, 07:45:48 AM
Yeah, we use the gib system to spawn our little body parts in hexen after a death. 

What are you looking to do with blood decals?  I know we have decals thrown onto walls/floor any time a monster is hit.

Ah neat, good to know.

For the decal system I just want to increase the amount of decals and distance and size (possibly) of the amount of blood that comes from shooting a monster.

And if possibly spawn giblets from the impact point where a weapon hits the monsters.

Going for something a little extra in the gore department.

deadite4

I should be able to take a look tonight at our decals.  I'm pretty sure distance and amount can be controlled.  It's been a little while since I actually looked at how it is set up.

You also should be able to use the FX system for giblets.  I feel like we've done that for things.

Zombie


deadite4

alright, so the decals get thrown on the wall/floor when hitting an enemy using the weapons damage entity_def.  so in our weapon_mace.def, we have:

entityDef damage_mace {
"damage" "32"
..
..
        ..
"mtr_splat_flesh" "textures/decals/dsplat2"
"mtr_splat_flesh2" "textures/decals/dsplat5"
"mtr_splat_flesh3" "textures/decals/dsplat7"
"mtr_splat_flesh4" "textures/decals/dsplat11"


so maybe distance can't be controlled easily.  We do use the FX system for gibs though, I just looked and confirmed that.  you can also use "smoke_wound_flesh" in the damage entry too, that spawns a particle from the location you hit.  We use it for a little blood drip particle that comes out for a few seconds after a hit.

Zombie

Ah nice one! thanks for the info. Might play around a bit with that tonight.

The Happy Friar

One of the best ways to see what D3 is capable of (I've found) was to look at Prey.  It used a lot of more of D3's capabilities then D3 did.  The game supports so much more stuff then id used, it's crazy.

Mr A

Ah Zombie, you're a man/woman/demon after my own heart =)

Can someone explain how the gibs and FX stuff works please.  I've been making monsters drop physical objects when they're fragged, and replaced monster's "def_dropgibitem"s with "def_dropdeathitem"s.  This means the gibs stay as they're counted as normal objects and not gib objects, but they're dropped regardless if the monster is gibbed or not. 

Here's an example of my code for zsec shotgun guy drops:
"def_dropDeathItem1"
"moveable_item_rup_leg_pork"
"dropDeathItem1Joint" "Waist"
"dropDeathItem1Offset" "0 14 0"

"def_dropDeathItem2" "moveable_item_rup_leg_pork"
"dropDeathItem2Joint" "Waist"
"dropDeathItem2Offset" "6 0 19"

"def_dropDeathItem3" "moveable_item_lup_leg_pork"
"dropDeathItem3Joint" "Waist"
"dropDeathItem3Offset" "21 0 0"

"def_dropDeathItem4" "moveable_item_rup_arm_pork"
"dropDeathItem4Joint" "Waist"
"dropDeathItem4Offset" "11 0 20"

"def_dropDeathItem5" "moveable_item_left_waist_pork"
"dropDeathItem5Joint" "Waist"
"dropDeathItem5Offset" "0 12 0"

"def_dropDeathItem6" "moveable_item_lup_leg_pork"
"dropDeathItem6Joint" "Waist"
"dropDeathItem6Offset" "20 15 0"

"def_dropDeathItem7" "env_gibs_ruparmstub"
"dropDeathItem7Joint" "Waist"
"dropDeathItem7Offset" "20 0 20"

"def_dropDeathItem8" "moveable_item_pelvis_pork"
"dropDeathItem8Joint" "Waist"
"dropDeathItem8Offset" "0 20 8"

"def_dropDeathItem9" "env_gibs_rtuplegstump"
"dropDeathItem9Joint" "Waist"
"dropDeathItem9Offset" "0 4 0"

"def_dropDeathItem10" "moveable_item_left_waist_pork"
"dropDeathItem10Joint" "Waist"
"dropDeathItem10Offset" "10 25 0"

"def_dropDeathItem11" "moveable_item_lup_leg_pork"
"dropDeathItem11Joint" "Waist"
"dropDeathItem11Offset" "0 13 0"

"def_dropDeathItem12" "moveable_item_rup_leg_pork"
"dropDeathItem12Joint" "Waist"
"dropDeathItem12Offset" "15 0 7"

"def_dropDeathItem13" "env_gibs_spine"
"dropDeathItem13Joint" "Waist"
"dropDeathItem13Offset" "15 33 0"

//this last one is the monsters weapon
"def_dropDeathItem99" "moveable_item_shotgun"
"dropDeathItem99Joint" "shotgun"


It's a very crude method, but it's also lovely and messy.
Here's some pics just to demonstrate:
https://www.dropbox.com/sh/n09gtm59ei52una/AAD4yWuT-XOO5KZAM2-hJ6P6a

I don't really know much about how blood decals are generated, but I know a way to prevent all decals from fading.  I'm currently trying to figure out how to make a monster 'drop' a blood decal when it dies, but so far have had no luck.
I've got guts and meat all over the place, but no blood pooling around corpses  =/

I can probably help a little with adding a new weapon too, let me make a new post though, this one is getting a little busy.

Mr A

Okay adding weapons requires you to have a number of things.  I don't know how to create 3D objects or anmations, but id Tech 4 uses .dds, .md5 files for that sort of thing.  You'll also need a skin(.tga) and then numerous code files (.def, .script, .skin, .mtr) including editing player.def, and potentially if you're adding new sounds, some .wav and .sndshd files. 

You may even want to create your own ammo for it =P

Yeah this one is a little complex.  I can probably explain the some coding though (y)
Right! Well I recommend you use a pre-existing .def file as a starting point for your new weapon.  Try and use one that is similar to the type of weapon you wish to create.  There's all sorts of crazy stuff you can do with the projectiles, and a lot of the effects and values ("clipSize", "thrust", "damage", "health") are pretty self explanitory.  (Also note a "clipSize" of "0" means you don't have to reload.)

Now once you've made a weapon, to add it to the game, you need to add it to the player.def

Start by adding the animation files e.g.
anim newgun_raise models/md5/characters/npcs/playermoves/raisewep.md5anim
anim newgun_idle models/md5/characters/npcs/playermoves/shotgun_idle_down.md5anim, models/md5/characters/npcs/playermoves/shotgun_idle.md5anim, models/md5/characters/npcs/playermoves/shotgun_idle_up.md5anim
anim newgun_aim models/md5/characters/npcs/playermoves/shotgun_aim_down.md5anim, models/md5/characters/npcs/playermoves/shotgun_aim.md5anim, models/md5/characters/npcs/playermoves/shotgun_aim_up.md5anim
anim newgun_fire1 models/md5/characters/npcs/playermoves/shotgun_fire_down.md5anim, models/md5/characters/npcs/playermoves/shotgun_fire1.md5anim, models/md5/characters/npcs/playermoves/shotgun_fire_up.md5anim
anim newgun_reload models/md5/characters/npcs/playermoves/dbreload.md5anim
anim newgun_lower models/md5/characters/npcs/playermoves/lowerwep.md5anim

This should be added near the other weapon animation files just before the player_base section. 

As you can see, it's pretty easy to use existing animations for a new weapon. 

Then you need to add the new weapon to the weapon slots:
"def_weapon13" "weapon_shotgun_double"
"weapon13_best" "1"
"weapon13_cycle" "1"
"weapon13_toggle" "0"
"weapon13_allowempty" "1"



That's pretty much all I know.  It really helps to look at other weapon mods and see what other's have done and how good their weapons are.  I use Notepad ++ to open the same files from the mod and the game's base folder, and then use the compare feature to compare them =)

Hopefully I helped you out a little. I don't really know much about this.   

deadite4

QuoteI don't really know much about how blood decals are generated, but I know a way to prevent all decals from fading.

Be careful with that.  Id tech 4 has an entity limit per map and each decal counts as an entity. If they don't fade/get removed after a period of time then you will be constantly growing your entity count for any given map as you play.  If you reach the predefined entity limit of the engine, you're map will crash out.

I can write up an explanation on FX/Gib system in the next day or so.  At least the specifics on how we utilize it in Hexen.

Zombie

Thanks for all the info, this is good stuff :)

Mr A

Quote from: deadite4 on July 28, 2014, 08:04:42 AM

Be careful with that.  Id tech 4 has an entity limit per map
I've been doing a fair bit of testing and I've only had Doom 3 crash while playing testmap/lotsaimps
I'll keep it in mind though, in case I get some weird crash. 

QuoteI can write up an explanation on FX/Gib system in the next day or so.  At least the specifics on how we utilize it in Hexen.
That would be awesome, thanks in advance =)

Quote from: Zombie on July 28, 2014, 09:02:31 AM
Thanks for all the info, this is good stuff :)
No worries man.  I'm interested in what you're doing =P