[DISCUSSION] Megaliths and Collision Avoidance!

I’ve been working out concepts for custom maps and one of them includes a rather large object (such as a large space station, megalith, etc.). Are there any restrictions regarding large objects and the collision avoidance paths of ships? Would it be possible for ships to be able to fly through a large object?

Through? No. It’s all defined by the object’s collision box.

I figured as much. Now lets say the Megalith in question has “tunnels” or something resembling a hole or opening in its mesh/collision mesh. In theory, could fighters/smaller ships fly through these “tunnels”?

No I really meant collision box. The box shaped collision envelope that automatically calculates based on yourr objects dimmensions, not the collision mesh.

Put Balcora Gate into your map and see.

But basically, sadly no.

Hmmm, a single object? Doubtful, HW2 has never had great collission avoidance and uses a shpere, or is it a box now? To calculate avoidance. However, you might be able to fake it if you break the single mesh into multiple smaller objects. Even then larger ships might have trouble depending on the size of the tunnel.

EDIT: Damn, beat me to it. :slight_smile:

Ahhhh damn, my mistake. Thanks @Pouk

While ships probably wont be able to fly through the tunnel you could always have them ‘teleport’ to the end via a script and a couple of sob groups. Maybe even add a delay before appearing at the end to give the appearance of travel.

It might be a sphere, but I’m convinced it’s a box now.

One other problem is that ships will attempt shoot through like it is not there, even though they can’t:

I think PrivateHix’s point is just a simple fly-through object, not a gate. Just a corridor.

1 Like

Well I’m working on a megalith map, so I know a bit about how you can make stuff work and mostly what doesn’t work.

You can sort of build a “tunnel” from multiple objects. But they cannot overlap, or you’ll get stuck ships that you’ll be forced to scuttle, because they’ll never get out.

So you can do this:

image

But you cannot do this, because it’s simply not far enough apart and the ships will get stuck:

image

Basically from my tests it seems as if the ship was blind to everything other than the obstacle it’s currently avoiding. It only has that one obstacle “in mind” and it runs straight into the one next to it. It either starts dancing or wedges itself between two collision boxes and you’ll never use it again.

And from what I said, this would obviously not work at all:

image

Anyway, I’m very interested in your maps. :slight_smile: Megalith maps are what I’m pursuing and working on, so I’d love to see what you’ll come up with.

That makes sense. Nice explanation to, I haven’t even looked in the direction of megaliths for a while. :slight_smile:

I’m curious how the changes made to the collision system have/will affect(ed) those kind of situations ? (I’m referring to the recent post by @thisquietreverie in the Update and a bit of a tease! )
@jkent : hi B5 buddy ! You can also see the collision box in the post above :wink:

Aren’t we running these already though? The asteroid avoidance was fixed. I thought the thisquietreverie’s post was simply presenting how.
Because the map I’m working on doesn’t work as bad as shown it would in his first screenshot.

oh yes, sorry, you are probably right !
I remembered the discussion and though it was in the works, my bad !

See here for some megalith maps:

http://steamcommunity.com/sharedfiles/filedetails/?id=399477672

And, yes, the AI is pretty ■■■■■■■■ when it comes to collision avoidance.

1 Like

I was going to refer to your maze levels, but I didn’t find it on Relicnews Forums.

I’m subscribed to your map pack, but I was too preoccupied to notice your maze levels are there, even though it’s my favorite map pack from the old days. I didn’t know you did make the hex maze at the end, I really have to try it.
How does it behave though? I suspect it can be a real pain to navigate around within the Homeworld engine.

…One day in the future we should join forces. Us two together can advance map making to a whole new level. This is a megalith map I’ve made. Don’t pay too much attention to the yet vastly missing textures (its first public appearence BTW):

image

image

A map like this works pretty well with AI.

8 Likes

None of the maze levels work well in skirmish. The AI always gets stuck in the corners. The 2D hex maze is still fun though because sometimes you misjudge the direction you’re going to get attacked from, and then you have to make a mad dash back to an earlier point in the maze. More micromanagement is needed, which means added pressure not to screw up.

The 3D maze is pretty much unplayable, though, mainly because of the camera always bumping into the walls or trying to move around them. Homeworld 1 was much better about this: if you bumped into an object with the camera in HW1, the game would simply not render the polygons of the object and leave the camera position alone.

1 Like

As for collision spheres vs collision boxes, the answer is that each ship has both.

I think that ship A uses its collision sphere to determine how far away it is from ship B’s collision box, and vise versa.

A few really quick points:

  • Generally speaking trying to arrange objects to create walls/mazes is a bad idea. It can work. But it is a mess. It screws you every which way, burns CPU, and will really, really nuke formations/strikegroups.

  • Objects over ~10k units radius are not going to draw or collide correct. The rendering engine has quite a few updates in the next patch, and some sanity caps for these were important - it lets some of the setup/rejection math go smoother, things just run cleaner.

  • Making maps with ‘big stuff in the background’ is great - do that. The background engine is flexible. Our own maps even have stuff with really subtle parallax in the backgrounds (too subtle? Did anyone notice?!)…

  • Making maps with ‘big stuff in the scene’ to play around is not a great idea - it’s a gimmick that compromises your FPS/CPU/etc. Somebody is going to do it anyway, or complain because they can’t go as big as they used to, but hey - I can only advise.

1 Like