Jump to content
The Dark Mod Forums

Horse patrolling


grayman

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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

    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 0 replies
    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
×
×
  • Create New...