Jump to content
The Dark Mod Forums

Recommended Posts

Posted

I put the horse on patrol for the first time.

 

He looks great, but he has problems at path_corners, since he does a simple "spin in place" rotation when he reaches the path_corner.

 

What he needs is some prediction code that lets him walk an arc that will gracefully take him from the current path to the next. I did some work on a shark years ago to fix the same problem.

 

Is anyone planning to do this, or was the horse only meant to stand in one place and look good?

Posted

It's been mentioned, and one work around mentioned was making the path a series of spaced out corners so he followed them in an arc. Don't know if anyone was gonna program that though.

 

If you do work on it, it would be nice to have code that was useable for any AI, if someone implements fish or something they could also use it.

Dark is the sway that mows like a harvest

Posted
What he needs is some prediction code that lets him walk an arc that will gracefully take him from the current path to the next. I did some work on a shark years ago to fix the same problem.

 

Sounds very interesting. Up to now we've had to rely on turning animations (not sure if the horse even has one).

Posted

Something else to consider is to change the horse's bounding box as it travels.

 

The idea is to give the horse a rectangular bounding box that matches his footprint depending on whether he's traveling (mainly) N/S or E/W. In between, when he's roughly at a 45 degree angle in any direction, you give him a square bounding box. These changes keep him from sticking his head into walls and/or having too large a box width-wise.

 

I don't know if TDM can handle non-square bounding boxes, though. The code might make assumptions about the box being square.

 

This would also be good for the Belcher (or whatever we're calling it), since he's also longer than he is wide.

Posted
I don't know if TDM can handle non-square bounding boxes, though. The code might make assumptions about the box being square.

 

Most of our BBs are cylindrical. We don't have the ability to rotate BBs at the moment, so even horses should use cylindrical ones, I think.

Posted

Most of our BBs are cylindrical. We don't have the ability to rotate BBs at the moment, so even horses should use cylindrical ones, I think.

 

A horse is more elliptical, tho, so a sphere bounding box creates almost the same problem than a square one.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Posted
A horse is more elliptical, tho, so a sphere bounding box creates almost the same problem than a square one.

 

Obviously it's not ideal, but it's better than a box with corners. Until we have bounding boxes that don't stay world-aligned, there's no better option.

Posted

Obviously it's not ideal, but it's better than a box with corners. Until we have bounding boxes that don't stay world-aligned, there's no better option.

 

Ah, yes, I forgot that our boxes are actually AABB (Axis-aligned bounding boxes). D3 supports boxes that are rotating, so maybe it is as simply as switching the type? Would need to dive into the code. One problem would still be AAS - it is computed with the AABB I think.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Posted
D3 supports boxes that are rotating, so maybe it is as simply as switching the type?

 

It does? When did this come to light? I remember the original discussion of BBox issues when we switched to cylinders, and rotating boxes was not a known option at that time.

Posted

It does? When did this come to light? I remember the original discussion of BBox issues when we switched to cylinders, and rotating boxes was not a known option at that time.

 

With "support" I mean that there is a "idBox" (or similiar name, in box.cpp) class (compared to the "idBound") which is a rotatable box. I used it in my LODE code and even expanded the class a bit since it was lacking a few things. (The whole class seems "half-finished" as there are unused code parts in it, too).

 

For instance, if you "rotate" an idBound, it just becomes a bigger box. If you rotate an idBox, it stays the same size, but rotates. The usual methods (is point inside, line cuts trough it etc) exist, tho.

 

I am not sure, however, if we can plug this into the code that does the collision stuff for actors, haven't looked into that system that far yet.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Posted

Where is it defined that AI bounding boxes are cylinders?

 

I see a comment in SysCvar.cpp about treating the player's bounding "box" as a cylinder, but nothing about AI bounding boxes.

Posted

For instance, if you "rotate" an idBound, it just becomes a bigger box.

 

 

I believe the game successfully rotates idBounds when it rotates func_statics at spawn time. When I was working with the rat improvements, I was also able to repair some existing debugging drawing boxes to represent a rotated bounding box.

 

 

Posted

Where is it defined that AI bounding boxes are cylinders?

 

I see a comment in SysCvar.cpp about treating the player's bounding "box" as a cylinder, but nothing about AI bounding boxes.

 

I haven't found it either, which is strange.

 

As for func_statics, are you sure about this rotating? The code for idBounds doesn't support this, the only way would be that the code constucts an "idBox" and then rotates this.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Posted
Where is it defined that AI bounding boxes are cylinders?

 

If you mean where in the code, I don't know. But there's a spawnarg for AI entities that sets the BB to a cylinder and even sets the number of sides. Probably in humanoid_base.def but I can't remember for certain.

 

It's just this line in ai_humanoid.def:

 

"cylinder" "10"

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

    • JackFarmer

      Happy Labour Day, my taffing taffers & hard working mapping friends!
      And remember the poor souls who, within the Inventors’ organization, labor under Jonus’s yoke to ensure the success of that very guild! Always remember the hard workers!
      · 2 replies
    • datiswous

      Is there a script command to make a screenshot?
      I just though it could be interesting to be able to create a screenshot at a certain point in time. Then use that screenshot possibly in a debrief.
      I guess the second question is: Can you use a (in-game made) screenshot in a (debrief) gui?
      · 1 reply
    • Bikerdude  »  Display Cement

      So what type, and what ratio of portland to sand 😏
      · 1 reply
    • JackFarmer

      Our esteemed professional mapping predecessors from 20 years ago faced the same challenges we do today!
      · 2 replies
    • snatcher

      TDM Modpack 5.1 is out!
      · 0 replies
×
×
  • Create New...