One Minute Game Review by The Happy Friar:
Also on Rumble:

idTech 4 (aka Doom 3 tech) Discord Server!

Main Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Radegast

I watched this video with my mouth literally hanging open. Amazing. Really amazing stuff. I can't even imagine how much work had to go into making this happen. Seriously, how much time per week did you spend on this?

Will there be a linux port? Will you release the source code?
id Tech 4 Scripting / Re: Disabling fall damage
January 04, 2016, 04:42:54 AM
You can disable the fall damage in the base/def/damage.def file:

entityDef damage_softfall {
"damage" "0"

entityDef damage_hardfall {
"damage" "0"

entityDef damage_fatalfall {
"damage" "0"
I found a hidden gem while browsing the ModWiki which describes a way to extend the AAS system for the AI. We are able to script Doom III bots to fare well enough in close encounters at predefined places, but imagine how much fun it would be if they were able to roam free on the map. Right now they don't know how to climb ladders, use elevators, portals, crouch to move in confined spaces, etc. The wiki article and the included code are obviously outdated, but if an engine coder could take a look at it and adapt it, it would make AI scripting much more fun for scripters.
id Tech 4 Scripting / Re: AI Teams/Relationships
January 03, 2016, 02:58:15 PM
Quote from: The Happy Friar on January 03, 2016, 01:27:34 PMEntity is already spawned, that's why.  Those are spawn variables.  I'd imagine someone could make a "read real time" variable for use in something like this.
You were right. I figured out the value is stored in the member variable of the AI class on creation and the "team" cvar is never used again (maybe only for reading). I guess it's because they never needed to change teams in the game, but I don't see why trebor or the OpenTechEngine guys would not change it in the engine since it is only a one line patch:

Code (cpp) Select
-       if( actor->team != team )
+       if( actor->team != spawnArgs.GetInt( "team", "1" ) )

Edit: ok, turns out it's not a one line patch since there are checks for team in other places besides idAI::ReactionTo, but still... I think it would be a worthwhile change for scripters
id Tech 4 Scripting / Re: AI Teams/Relationships
January 03, 2016, 12:20:16 PM
Quote from: MrC on August 22, 2015, 01:02:51 AMI'm not sure if this amounts to a scripting question or a C++ issue but I'm wondering if anyone could help point me in the right direction in terms of assigning AI default like/hate/neutral relationships towards other AI?

I did play around with Teams/Ranks key/val but so far have only managed to get AI that either does or doesn't just attack the player but seems to ignore other AI, unless I've misunderstood what Teams and Ranks are (probably).

Changing teams in scripts through setKey("team", 3) has no effect. It would appear that the value actually changed when you retrieve it again with getKey("team"), but the engine function idAI::ReactionTo which decides if the opposite entity is a friend or foe still sees the original spawn value of "team". However, changing other stuff such as npc's name through setKey("npc_name", "Leeroy Jenkins") works and is immediately visible in game. I am trying to figure out why.

If you change the "team" value directly in defs, you can have multiple factions which fight each other. Team management in Doom 3 is very simplistic, but I think it does suffice. Let's say you are team 0 and you spawn a soldier whose team is also 0, a soldier who is in team 1 and has rank 1, a soldier who is in team 1 and has rank 2 and two soldiers who are in team 3. Teams fight other teams, but if a soldier from team 1 with rank 2 is damaged by his teammate who is rank 1, he will be pissed off and kill him too.

Hell, but I would really like to know why changing team value in script after spawning an entity has no effect.
How it looks like:
Simple allied AI [using RBDOOM-3-BFG or one its forks]

This will show you how to spawn a marine NPC holding a machine gun who will attack any approaching enemies.

Step 1: unpack game data

Open the in-game console and execute: exec extract_resources

Step 2: create script basedev/scripts/ai_ally.script with the following content

Code (cpp) Select
* Inherit from monster_zombie_security_pistol object which includes all the necessary
* animations and behaviours like crouching and changing positions.
object ai_ally : monster_zombie_security_pistol
boolean checkForEnemy( float use_fov );

// States
void state_Begin();

* Override parent checkForEnemy and adapt it to target monsters instead of the player
* My enemy is your enemy.
boolean ai_ally::checkForEnemy( float use_fov ) {
entity enemy;

enemy = closestReachableEnemyOfEntity($player1);

if(enemy.isHidden() || !canSee(enemy))
enemy = $null_entity;
return true;

return false;

* Copy state_Begin of the parent class but remove a call to monster initialization
void ai_ally::state_Begin() {
fire = false;
crouch_fire = false;
animState( ANIMCHANNEL_TORSO, "Torso_Idle", 0 );
animState( ANIMCHANNEL_LEGS, "Legs_Idle", 0 );

setMoveType( MOVETYPE_ANIM );
setState( "state_Idle" );

Step 3: open basedev/def/character_soldiers.def and change scriptobject of character_soldier_machinegun to ai_ally, so it looks like this:

entityDef character_soldier_machinegun {
"scriptobject" "ai_ally"

Step 4: Open basedev/scripts/doom_main.script and add  #include "script/ai_ally.script" at the bottom of the AI section

Step 5: launch the game with our new basedev mod: "RBDoom3BFG +set fs_game basedev +set fs_resourceLoadPriority 0 "

Finally, load a map and execute command "spawn character_soldier_machinegun" and if there are no enemies nearby, you can spawn a target for him too:  spawn monster_zombie_hazmat

When I return from my vacation I could write more basic AI tutorials like this one if there is interest for it, e.g. make the marine follow you and give him orders.

EDIT: to simplify this even more and make it work not only in the campaign, but also in custom maps, change the content of the checkForEnemy function to this:

Code (cpp) Select
boolean ai_ally::checkForEnemy( float use_fov ) {
entity enemy;

enemy = findEnemyAI(use_fov);

return true;

return false;

findEnemyAI function already has a check for hidden enemies, so there is no need for one inside the script
I just realised my screenshot in the first post wasn't showing for other people so here it is:

I've managed to clean up the source a lot and now I am replacing GLUT with GLM. 
id Tech 4 Scripting / Re: Doom 3 AI from scratch
May 20, 2015, 09:02:18 AM
No, I originally got the idea from Allied Marine Squadmates mod which does exactly what I am working on, but I wanted to do it myself to learn from the experience. I am simultaneously writing a simple tutorial on this subject for beginners like me, which I am going to post on this forum when I am done.

The AI is quite simplistic in Doom 3, but I think there is a potential to improve it even without touching C++. It's already possible to teach AI how to retreat, find cover, react to sound, visibility and damage. It's all we need for semi-intelligent bots.

Btw, I am looking forward to see results from your work on Blender->Doom project.
id Tech 4 Scripting / Re: Doom 3 AI from scratch
May 20, 2015, 06:18:19 AM
Yea, Modwiki could use a section about AI life cycle and a lot of code snippets dealing with the basic NPC stuff.

I am too afraid to complete the main storyline in Doom by myself alone, so I am programming an AI buddy to help me fight the demons. Currently, he is mentally challenged so only thing he knows how to do is to follow me and stop when I tell him to.
As my learning project to get started with D3/OpenGL I decided to write a model viewer for the MD5 format used by Doom III. There are several examples of rendering MD5. However, they are either too basic (no textures and animations), don't compile or don't display the models properly. Writing one from scratch by studying the unofficial reference documentation turned out to be way over my capabilities. The single working model viewer with source code available I found was written by the legend himself, Fabien Sanglard (I bet you thought I was going to say Trebor).

So far I ported it to SDL 2 and removed dependency on SDL_image by switching to header-only stb library.


Phase I

  • remove GLUT and use GLM for OpenGL mathematics
  • add CMake build script (Windows/linux/OS X)
  • use GLEW
  • move project to Github
Phase II

  • port from OpenGL 2.1 -> OpenGL 3.3+
Phase III

  • import/export binary MD5 models used by DOOM 3: BFG (bmd5mesh)
  • add optional GUI for opening models, changing shaders and animations, etc.
  • add optional PhysFS support for opening models directly from pk4 packages
id Tech 4 Scripting / Re: getButtons
February 19, 2015, 05:38:35 AM
These buttons are available in the BFG edition:

Code (cpp) Select
// usercmd_t->button bits
const int BUTTON_ATTACK = BIT( 0 ); // <-- 1
const int BUTTON_RUN = BIT( 1 ); // <-- 2
const int BUTTON_ZOOM = BIT( 2 ); // <-- 4
const int BUTTON_SCORES = BIT( 3 ); // <-- 8
const int BUTTON_USE = BIT( 4 ); // <-- 16
const int BUTTON_JUMP = BIT( 5 ); // <-- 32
const int BUTTON_CROUCH = BIT( 6 ); // <-- 64
const int BUTTON_CHATTING = BIT( 7 ); // <-- 128
DarkRadiant won't work with these textures out of the box. I tried converting them back to tga using crunch and opening them in Gimp with DDS plugin, but it always fails due to "unrecognized file format". Oh well, I'll just to find some similar textures at or someplace else.
I decided I'll give modding BFG another try, so I unpacked all the .resources files using Robert's extract_resources.cfg script and realised there is one important thing missing besides sounds - textures. In which .resources files are they stored in and why aren't they extracted?

_common.preload def             generated       maps            models          newpdas         renderprogs     skins
af              fx              guis            materials       newfonts        particles       script          sound

As you can see there is not textures directory among the extracted files in /basedev.
According to the feature list at IndieDB you are using a proprietary physics engine for this. Is there a reason why you didn't use one of the open-source physics engines like Newton or Bullet? I know nothing about them, I am just curious.