Jump to content
The Dark Mod Forums

Recommended Posts

Posted

Horse has a different orientation of joints. It has x axis forward but NPCs in Darkmod have y forward. Different software have different conventions.

1*IWv0KVHPnf_xxL05Vh7oVQ.png

I re-exported the mesh, af.md5anim and walk_01.md5anim with y forward and x up orientations on head bone:

Zrzutekranu2026-04-18160338.jpg.d78b3512c0ecdcb48387f41d0d5d03dd.jpg

Vision cone is tied to it.

darkmod(2026-04-1816-43-51)(350.42414.57-2.75).jpg.0ac83e85e1f80f3123ad6003b1bfbc2e.jpg

So I wonder if there's a way to correct cone's rotation independently from the head bone. Herbivores have close to 360 field of view, btw. Realistically there probably should be two cones.

Anyway, that doesn't change the erroneous behavior at 300 FPS.

In 2018 I also changed "tun_rate" from 150 to 41. Looks good for walking horse, and matches the turning animations, but it's too slow for running one. So when galloping, horses bump into walls and lose track of path nodes. Changing it back to 150 will fix that, but that's unrelated to super high frame rate bug.

darkmod (2026-04-18 15-31-41) (230.59 -537.14 -2.75).jpg

  • Like 3

It's only a model...

Posted

I suppose AI sets FOV from these spawnargs:

  • "fov" --- default 150
  • "fov_vert" --- default -1, meaning "same as normal fov"

The first one is called "horizontal", the second is called "vertical".

Apparently, we consider the coordinate system of the head joint.
It looks like X is "forward" and Y is "up", but this of course can be more convoluted.

FOV area is built around "forward" direction as follows:

  1. we can deviate from the horizontal plane by up to "vertical fov / 2"
  2. we can deviate to left/right (in projection onto the horizontal plane) by up to "horizontal fov / 2".

It is possible to customize this "fov coordinate system", i.e. make it different from the head joint system.
This is done using the following spawnargs:

  • "fov_rotation" --- rotation as 3 Euler angles
  • "ko_spot_offset" --- this provides offset from head joint origin (judging from the name, it also affects blackjack mechanics)

So you can probably tweak fov_rotation to fix orientation, then set something like "fov" = 300 and "fov_vert" = 120.
If I understood correctly the math of FOV area, it should give almost all-around vision, except for blind spots at the back, up and down.

Perhaps I should improve debug visualization, so that it render the actual FOV instead of some virtual cones.

  • Like 1
Posted
15 hours ago, stgatilov said:

cauldron_v2_2(2026-04-1820-49-18)(47.59-274.11-2.75).thumb.jpg.ef7a5e43bfdb91c39ec1f713beaa3230.jpg

I fixed the bug, hopefully without breaking other AI logic.
The horse goes along its path fine even with 1000 FPS.

I think you fixed more than this bug. The AI no longer seem to walk through each other and produce weird clusters of overlapping attackers in "The Golden Skull". This has been a problem since 2.04 ( pre-uncapped FPS ).

  • Like 2

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Posted
17 minutes ago, nbohr1more said:

I think you fixed more than this bug. The AI no longer seem to walk through each other and produce weird clusters of overlapping attackers in "The Golden Skull". This has been a problem since 2.04 ( pre-uncapped FPS ).

Is there an issue about it in the tracker?
I believe my changes should not affect behavior with ~60 FPS.

I won't be surprised if there are other bugs like this still remaining in the AI code...

  • Like 1
Posted

Will keep looking but here are the 2 closest related trackers:

https://bugs.thedarkmod.com/view.php?id=2688

https://bugs.thedarkmod.com/view.php?id=4326

I'll check out Awaiting the Storm but I am not expecting any big improvements there.

I normally use Golden Skull as a test mission anytime any path related changes are made in Dev since 2.03 search type looks good and 2.04 ( modern ) search type shows these AI anomalies.

  • Like 1

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Posted
18 hours ago, stgatilov said:

cauldron_v2_2(2026-04-1820-49-18)(47.59-274.11-2.75).thumb.jpg.ef7a5e43bfdb91c39ec1f713beaa3230.jpg

I fixed the bug, hopefully without breaking other AI logic.
The horse goes along its path fine even with 1000 FPS.

The horse pathfinding bug is indeed fixed. But the bug where walk cycle animations reset at every turn remains:

On 4/12/2026 at 5:25 PM, Arcturus said:

With vertical sync off, uncap FPS on and high max FPS values (around 100 and above), the character animations get restarted (walking, running) when AI makes a turn. It looks bad and causes NPCs to stop a lot, too:

I uploaded map/turn.map to repository.

Apart from twitching, you can see that at 300 FPS they also stop more often and play idle animations.

It's only a model...

Posted

Meanwhile, I have improved FOV visualization in svn rev 11285.
Now you can set "tdm_ai_showfov 2" and get close, then you'll see the whole visible area.
Also there is FOV coordinate system, with the typical RGB axes convention.

It is hard to capture it properly on a screenshot:

oldhabits2(2026-04-1916-14-28)(-40.58150_2234.72).thumb.jpg.c38d9d102f3bd931ef418ff7813a8d1b.jpg

  • Thanks 1
Posted

As for weird fast movements, I'm pretty sure it is because the AI animation script uses wait(16 ms) instead of a proper waitFrame.

I'll need to understand how exactly waitFrame works now (it also has 16 ms inside, but I'm not yet sure what is "manual control"). Then I'll have to adjust the animation loops, and probably it will fix the issue.

Posted

Here's a version of the "banking" script in a separate file.

These go into the tdm_ai_base.script:

Spoiler

    // member variables
    float    m_bankingLastYaw;
    float    m_bankingCurrentValue;
    float    m_bankingJointOrigin;
    float    m_bankingJointSpine;
    float    m_bankingJointNeck;
    float    m_bankingArmL;
    float    m_bankingArmR;
    float    m_bankingJointHandle;
    float    m_bankingJointHandle1;
    float    m_bankingJointHandle2;
    float    m_bankingIntensity;
    boolean    m_bankingActive;

    // Function Prototypes
    void    initBanking();
    void    updateBankingLoop();
    void    applyProceduralBanking(float val);

    // --- Procedural Banking State ---
    float    m_bankingLastYaw;
    float    m_bankingCurrentValue;
    boolean    m_bankingActive;

Spoiler

void ai_darkmod_base::init() 
{

    initBanking();

}

In the tdm_main.script:

Spoiler

#include "script/tdm_ai_banking_humanoid.script"

In the tdm_ai_humanoid.def

Spoiler

    "can_bank"                    "1"    //    Will tilt on turning
    "banking_intensity"       "1"

This way it will only apply to humanoids, and mappers will be able to disable it or change strength for individual NPCs by overwriting those values in Darkradiant.

The rest goes to tdm_ai_banking_humanoid.script

tdm_main.script tdm_ai_humanoid.def

tdm_ai_base.script

tdm_ai_banking_humanoid.script

  • Like 2

It's only a model...

  • 2 weeks later...
Posted
On 4/19/2026 at 6:11 PM, stgatilov said:

As for weird fast movements, I'm pretty sure it is because the AI animation script uses wait(16 ms) instead of a proper waitFrame.

I'll need to understand how exactly waitFrame works now (it also has 16 ms inside, but I'm not yet sure what is "manual control"). Then I'll have to adjust the animation loops, and probably it will fix the issue.

At higher FPS, random movements (e.g. head rotation) are also too fast:

 

  • Like 1
  • Thanks 1
  • Sad 1

It's only a model...

Posted
On 5/2/2026 at 11:17 PM, Arcturus said:

At higher FPS, random movements (e.g. head rotation) are also too fast:

I think the head movement anim's have always been too fast at any FPS...

bhm_banner.jpg

Posted
On 5/4/2026 at 12:28 PM, Bikerdude said:

I think the head movement anim's have always been too fast at any FPS...

The "ease out" part of the animation feels a little unnatural to me.

It's only a model...

Posted
1 hour ago, Arcturus said:

The "ease out" part of the animation feels a little unnatural to me.

Your the animator, so I defer to you in this matter 🙂

bhm_banner.jpg

Posted
On 4/18/2026 at 11:00 PM, stgatilov said:

"fov_rotation" --- rotation as 3 Euler angles

I rotated horse fov by -90 so they now look forward. Also increased the overall fov.

  • Like 1
  • Thanks 2

It's only a model...

Posted
56 minutes ago, stgatilov said:

As a matter of fact, I have fixed the issue with animation stutter/jump in the latest SVN.

You mean this issue?

I still see animation restarting at each loop and idle anims playing too often... I uploaded test/turn.map to the repository.

  • Like 1

It's only a model...

Posted
44 minutes ago, Arcturus said:

You mean this issue?

Yes.

Quote

I still see animation restarting at each loop and idle anims playing too often... I uploaded test/turn.map to the repository.

Do you use executable from assets SVN or an executable built locally from source code?
I usually don't commit newly built executables between dev builds.

Quote

I forgot I already uploaded that map to main 'maps' folder before...

I'd say test maps look better inside "test" subdirectory, maybe delete the first one.

  • Like 1
Posted

Ok, I'll wait for the exe then.

13 minutes ago, stgatilov said:

I'd say test maps look better inside "test" subdirectory, maybe delete the first one.

Done.

  • Like 1

It's only a model...

  • 2 weeks later...
  • 3 months later...
Posted

So I had a conversation with Gemini and it told me that in order to get rid of the code from tdm_ai_base.script I can use "scriptobject" inside tdm_ai_humanoid.def. The problem is there can only be one script object, so if I want both banking script and head tracking script, then one will have to inherit from another. So banking now inherits from head_tracking. That seems like a hack. But it prevents this crash:

But now that I think of it, people probably already use "scriptobject" for other things. So it will cause conflicts.

It's only a model...

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

      So on a regular basis I try to start building something in Darkradiant but very quickly I loose interest and give up.
      I tend to
      create a room, position an ai in it (or first ai, then room, probably better) put a light in it Put some stuff in it test the room in tdm Now I had this new idea:
      Start of with a gigantic room. To skip the importance of sealing for the time being and to think broader than one room. Then just use ground without wall, just to visualise the structure of the level.  Then just use prefab walls and other elements (arches, etc.). Just building area's that aren't enclosed. I can always close them at a later point. Maybe this is all very logical from a mappers perspective, but tdm is the first game where I have done any kind of real mapping and I always stop at the start. It just takes too long to make something exciting.
      I want to build something at some point, because over time I accumulated lots of ideas.
      · 13 replies
    • MayheM

      It would be nice to have a link to the forum thread of a mission in download section, rather than having to search for it manually, like on Thief Guild.
      · 1 reply
    • taffernicus

      Anaglypta , floral and damask wallpaper look great in older homes 
      It’s rare to see anyone using “shader not found” wallpaper in their house

       
      · 0 replies
    • Ansome

      Terribly difficult juggling map designing with work, but I'm still alive and chipping away at something very special. I'm actually making a collaboration of sorts with a friend, I make the map itself and he acts as my "Chief Scope Creep Consultant" that checks in every so often to make sure this project isn't getting out of hand. It's a good system!
      · 1 reply
    • JackFarmer

      We don't need artificial intelligence; we need artistic intelligence. 
      Ralf Hütter, Kraftwerk
      · 6 replies
×
×
  • Create New...