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

How can I make custom enemies?

Started by Arl, March 18, 2016, 01:50:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Arl

Hi there, I hope this is the right place to ask this.

I have played maps that have custom monsters, or zombies with different bodies already in Doom 3 like the body of marines, etc...  ... I always wonder about making custom content like that, but trying to learn by looking at the files (like .def and such) has not lead me to anything in all this years.

Sadly, as far as I know, there is no tutorial for making custom monsters. I once looked at some videos of Brian Trepaning but it wasn't clear in how to implement the monster in the actual game once modeled, rigged and animated.


Is there anyone who could share any kind of information on the subject? anything that can lead me in the right way to learn about it would be very good.


Thank you, Saludos.

VGames

It's all in the defs man.

What kind of monster are u adding?

I'd take a def from a similar monster and make changes to it to use my custom work.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

Arl

Something able to walk toward the player and hurting him with melee attacks is all I need to do, I guess a zombie has pretty much this behavior. But still, I don't know what to do with it, don't know how does it works.

VGames

You're gonna need a def and a script for sure. The def will point to sounds, particle effects, models, skins, the script, etc. The script will make the monster do what it needs to do AI wise.

Just take an existing monster def that fits your needs and change the name of the model and animations to use your work. Trial and error.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

MrC

#4
https://www.iddevnet.com/doom3/script_ai.php

As mentioned here, Bernie sounds like a place you may want to start. It's a very simple AI that does what is sounds like you're looking for, run towards the player and attack. So in /defs start by making a copy of monster_zombie_bernie.def and call it monster_[your cool new name without spaces].def
Next, modify your new def as needed, and as mentioned, most of the key/val pairs are pretty self explanatory.

If you want to give it new behavior, the brains of the monster is found under:
"scriptobject" "monster_zombie_bernie"

That file is found under scripts/ai_monster_zombie_bernie.script, again make a copy and call it something like: ai_monster_[your cool new name without spaces].script

Start off by modifying:

object monster_zombie_bernie : monster_zombie_base

The first object is the name of your new monster's brain, the next is what it's inheriting from. Check out 'OOP inheritance' for a better understanding of what this is doing.

So make it look like this:

object monster_[your cool new name without spaces] : monster_zombie_base

Be sure to modify your new monster_[your cool new name without spaces].def file with this new object name:
"scriptobject" "monster_[your cool new name without spaces]"

And also be sure to find/replace every instance within the script of:
monster_zombie_bernie with monster_[your cool new name without spaces]
like void monster_zombie_bernie::Torso_Idle to void monster_[your cool new name without spaces]::Torso_Idle etc...

After you save your new script object, you can add it to doom_main.script
#include "script/ai_monster_[your cool new name without spaces].script", well that's where I've been throwing things, maybe there's a better spot to include this? Anyway, hopefully that should get you started.

Arl

I see, how about having my own armature? because the Bernie .def already has references to a skeleton.


MrC

Quote from: Phobos Anomaly on March 18, 2016, 11:09:03 PM
I see, how about having my own armature? because the Bernie .def already has references to a skeleton.

Yes, you can have your own rig and animations, just create and export the appropriate md5mesh and anims and replace the Bernie references in your custom .def. Just remember you'll want the root bone of your skeleton to be called "origin" when doing movement animation, that is physically move the rig - no running on the spot, as the engine derives movement from this particular bone. And in max it's forward direction is facing down the X axis (facing right in front viewport iirc). Not sure about Maya or Blender so you'll want to make sure for those, and make sure you get the scale right as well ~70 units tall or so, there's no scaling option unless you do the Maya import method (I think). That's a good video tutorial btw.

The Happy Friar

I import a character model for reference most of the time to get my characters the correct height.

The Brian Youtube tut's are how I learned, and if you start simple like he does, you learn all the basics you'll need to do more complex stuff.  So, yeah, start with a stick figure type character.  I almost always use a def/script of an existing character that's similar to what I want to put in.  Most times you can just modify the def & leave the script alone as most things people want changed are based on animation's.

Arl

#9
Thank you all, I think I'm heading to something.

Right now I managed to make the game stop crashing, but my creature turned out to be just an inmovil evil black box emitting zombie sounds.

I rigged my creature to a hellknight to see if it was a problem on my mesh or material, but it showed in game just fine. (I'm using Blender, by the way).


Trepanier's tutorial was good but as I said he doesn't go into details about putting your own skeleton in the game, he made his skeleton considering thing about the game that he doesn't explain (or I didn't understand maybe), and even putting omition marks in the .def saying that that is going to be in another tutorial, that sadly never happened.

Arl

#10
Sorry for double posting.

I'm slowly learning about this and I'm achieving more and more things, my monster is now moving, attacking, dying, etc...

I would like it to burn away after you kill it, as normal demons do. How is this controlled in the game? I copied the material section referring to the burn effect into my monster's material but I haven't touched the .def or the "scriptobject" line file whatsoever, and I'm using zombie's .def and script as a base, and zombies doesn't burn, they gib).

Anything you could tell me about it?



Phrozo

Hello,

In your monsters entityDef, add these two fields.

"burnaway" ".5"
"smoke_burnParticleSystem" "burn_imp.prt-chest"


"burnaway" is a time delay in seconds to start burning effect.

"smoke_burnParticleSystem" specifies the burn particle ( burn_imp.prt ) and the joint where the smoke particle is bound to ( chest ).

However, this won't work unless burn is called in script, usually when during state_Dead(). Here is an example:

/*
=====================
monster_base::state_Dead
=====================
*/
void monster_base::state_Dead() {

float burnDelay = getFloatKey( "burnaway" );
if ( burnDelay != 0 ) {
preBurn();
sys.wait( burnDelay );
burn();
startSound( "snd_burn", SND_CHANNEL_BODY, false );
}

sys.wait( 3 );

if ( resurrect ) {
hide();
stopRagdoll();
restorePosition();

// wait until we're resurrected
waitUntil( 0 );
}
remove();
}


This might already work since monster_zombie_base inherits from monster_base but if are using a modified state_Dead you will need to have that content included.

Arl

Yes! It worked.

This is great, thank you very much for your help Phrozo.