AvoidNeutral, CollideNeutral, Hitspheres / Boxes

AvoidNeutral, CollideNeutral, Hitspheres / Boxes

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

AvoidNeutral, CollideNeutral, Hitspheres / Boxes

Post by Argh »

Two relatively easy things, one not so much.

I'd like to have weapon tags, defaulting to TRUE, that avoidNeutral and collideNeutral, for dealing with Neutral Units.

Secondly... I'd like to see multiple hitspheres, hitboxes, what-have-you. I don't personally care if it's multiple hitspheres, which is probably the easiest solution in terms of code. I'll try to figure out a relatively simple proxy solution for the immediate future.

The cities I'm doing for World Builder have shown me very clearly that these two things are probably necessary for Spring to handle these issues in a way that looks professional. I know that the hitbox / sphere stuff must be a royal pain, or Kloot would've committed what he worked on months ago, but I think we're going to want it, and fairly soon.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: AvoidNeutral, CollideNeutral, Hitspheres / Boxes

Post by Pxtl »

Honestly, when you think about the nightmare complexity of getting the melee weapons to work with hitspheres, Kloot's patch sounds like it will just make things worse for bizarro Spring-bugs.

Multiple hitspheres sound like the way to go, but it also creates some complexities.

When attacking, which hitsphere is targetted? The closest? The largest? The largest that is within range? Attack command would become bizarre, because the unit would probably use the closest hitsphere for "how close do I need to get to my target" so that melee weapons would behave well... but once the unit moves closer, it would target the largest one (so that inaccurate weapons wouldn't be stuck shooting a small-but-close hitsphere).

How do you do aircraft-avoidance for multiple hitspheres? Unit considers itself to be a single aggregate sphere, but avoids all the hitspheres? That would allow fighters to fly through sphere-gaps in multisphere capships, but capships would maintain a full hitsphere-radius apart from each other.

Messy, any way you slice it.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: AvoidNeutral, CollideNeutral, Hitspheres / Boxes

Post by Argh »

When attacking, which hitsphere is targetted? The closest? The largest? The largest that is within range? Attack command would become bizarre, because the unit would probably use the closest hitsphere for "how close do I need to get to my target" so that melee weapons would behave well... but once the unit moves closer, it would target the largest one (so that inaccurate weapons wouldn't be stuck shooting a small-but-close hitsphere).
Units should just aim at the centroid of targets with multiple hitspheres- wherever XYZ the centroid is. Solves a lot of that mess. The hitspheres should just evaluate whether a hit has occurred.
How do you do aircraft-avoidance for multiple hitspheres? Unit considers itself to be a single aggregate sphere, but avoids all the hitspheres? That would allow fighters to fly through sphere-gaps in multisphere capships, but capships would maintain a full hitsphere-radius apart from each other.
There probably needs to be a special sphere that is just for this purpose- that's how Freelancer did it, anyhow. It was generally bigger than the object's hitspheres by quite a bit, to make avoidance / collision occur in a natural fashion. Of course, too big, and aircraft can't fly over your fleet of battleships, but it's the cheapest way to do this, I think.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: AvoidNeutral, CollideNeutral, Hitspheres / Boxes

Post by Pxtl »

Heheh, do you remember Smoth's screenshot of fighters flying around a Whitebase in a perfect spherical avoidance pattern? That's why I suggested taking the spheres into account with avoidance.

Centroid might be nice, but it means no units where the centroid is open space. Perhaps the "Sweet Spot" should be revived? A "shoot me here" tag? And either way, I worry about multiple hitspheres with melee (or otherwise very-short-ranged) weapons.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: AvoidNeutral, CollideNeutral, Hitspheres / Boxes

Post by Argh »

The HTH issue's a tough one. However, this is not something you'd want to do with anything that isn't really, really huge, anyhow. Most things work just fine with a single sphere- it's stuff on the Gaw's scale, or my to-scale 16-floor buildings, that are a problem.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: AvoidNeutral, CollideNeutral, Hitspheres / Boxes

Post by KDR_11k »

Melee is simple, a melee weapon is just a weapon with all the fancy shooting, collision, etc stuff cut out. It fires and BAM the target takes damage.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: AvoidNeutral, CollideNeutral, Hitspheres / Boxes

Post by Argh »

AvoidNeutral / CollideNeutral have been added to SVN, by Kloot. Yay! I'll finally see street-fighting that looks right, among other things :o

Testing now...
Post Reply

Return to “Feature Requests”