Jump to content

Creating an AABB matching the orientation of an entity' own AABB (OBB)


Recommended Posts

Good morning,

For the Tramfight! map, I wondered if disabling the combat movement/bot push around the Tram would help bots boarding it
A first thing has been to lower the boarding offset, so that the RIDE goal does not make bots jump to try to board, and it seems to have helped (erratic jumping gone, and compared to Railgun where boarding and seating positions are aligned, well, just walking from boarding to seat, being not aligned but at same level for Tramfight!, looks logic)

First, to see/make sure if disabling these behaviours would help, I've simply disabled that feature through the omni-bot.cfg ([CombatMovement] moveskill = 0), and it looked better

There's an automatic combat movement/bot push disable effect on bot once a bot reaches the boarding position in the RIDE goal logic, but here I want the same when bots approach the vehicle, potentially going for that boarding position

Since the tracks have some long and wide turns, I cannot put non-overlapping non-too-large static region triggers along tracks, plus I'd like to disable these features only when the Tram is "nearby" (I could script an array of AABBs and get the closest one to use to create a region trigger, but that sounds look too much hassle)

Thus, I'd like to have a DisableBotPush region trigger "attached" to the Tram entity (e. g. upon Tram movement, delete current one and recreate a new one, since if you keep a pointer to the AABB you've passed to OnTriggerRegion, modifying that AABB does not update the related region trigger, or perhaps it's a drawtrigger issue?)

What I currently have is an AABB I create from the entity CenterPoint, but that's not good enough while the Tram is in a turn, and that's the situation where the boarding is the most difficult

I've also scripted the boarding positions to have a different offset while the Tram is moving, so that bots target a position ahead of the Tram movement

(If you want my current waypoints for some reason, let me know; since I'm asking on a general principle that I'm going to use for that map, I somehow expect giving them might negatively impact the investigation)

There's a function to directly draw the entity AABB with the right orientation (DrawEntityOBB), but I don't see one to directly retrieve that AABB

I see there's a function GetEntRotationMatrix that perhaps could help "orienting" that fixed AABB, Matrix3 type is used in MapGoal and in C++ for something that looks like it, but dunno how to use in GM ^^" Plus I don't know about the maths behind

I would then expand it on its local Y axis with a great value (so further front/back of the Tram), and on its local X value (to be large enough to touch the sidewalks)

---

So, after all that reading, questions;

Is what I'm going for a good approach?

If yes, how can this be achieved, with lowest CPU usage (I'm always afraid of the CPU usage of my GM threads and entity movement tracking, though never took the time to see how I can measure it, thinking of server admins sometimes paying depending on that usage)?

If no, what's the direction? Something in OB itself, some different implementation, something totally different?

I hope that I've explained myself clearly enough ^^"

Thank you in advance

Edited by Mateos
Removed a doubled-word
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.

×
×
  • Create New...