Page 1 of 1

Custom Hitsphere Testing - Help Required

Posted: 05 Sep 2010, 04:16
by TheFatController
I'm looking to create a mutator with tighter hitspheres for all units to see how it plays and it's a fairly laborious process so I'm posting to see if:
a) anyone wants to help
b) anyone can think of a faster method to what i'm doing

Essentially the result will be that instead of having massive spheres units would have hitboxes proportional to their model, eg:
Image

My current process for this is:

1) Paste this code into the bottom of the units fbi file:

Code: Select all

  collisionVolumeOffsets=0.0 0.0 0.0;
  collisionVolumeScales=20.0 25.0 15.0;
  collisionVolumeType=box;
2) Tweak the sizes based on guesswork
3) Load spring, /cheat, /give unit
4) Hit Alt-B to see the hitbox
5) Note how much it needs adjusting and return to step 2 until the hitbox looks okay

So if anyone wants to help do a few units (I've already done t1 kbots) please post the unitdef names and the code for the hitbox here, otherwise as I said above if anyone can enlighten me as to a faster way of doing this i'd be grateful :)

Note: this is not a change going straight into BA so please keep rage to a minimum

Re: Custom Hitsphere Testing - Help Required

Posted: 05 Sep 2010, 06:04
by REVENGE
Sounds like a great idea, but do you want this done and handed back to you, or directly hosted and played as a mutator?

Re: Custom Hitsphere Testing - Help Required

Posted: 05 Sep 2010, 11:25
by TheFatController
REVENGE wrote:Sounds like a great idea, but do you want this done and handed back to you, or directly hosted and played as a mutator?
Well, the codes will be publicly available and free for anyone to use. I would be interested in releasing a mutator and will give this an officialish name and would hope people give it a go to see how it plays.

Re: Custom Hitsphere Testing - Help Required

Posted: 05 Sep 2010, 14:52
by hoijui
side-note:
i do not know how much of an influence this would have in practice, but collision detection is cheapest with spheres. so maybe it would be good if you have a test game with lots of T1 units (the ones you already converted) shooting at each other, to see if there is a noticeable performance loss.

Re: Custom Hitsphere Testing - Help Required

Posted: 05 Sep 2010, 15:27
by Gota
You can take many from XTA.
It has adjusted almost all the hit-boxes for all the units.
Not really sure though how heavy it is on the proc cause XTA usually has less units and it also uses tons and tons more particles so I was never sure Why the bigger games slowed down.

Re: Custom Hitsphere Testing - Help Required

Posted: 05 Sep 2010, 15:38
by Beherith
Do Collisionvolumescales mean the length of the edges of the box?
Where does offset start? at 0,0,0?
if it starts at 0,0,0, why does a Y scale of 20 cause box to end at ground level?

Please elaborate on this so i can help you. (cause i already have 3do loading done)

Re: Custom Hitsphere Testing - Help Required

Posted: 06 Sep 2010, 00:12
by TheFatController
hoijui wrote:side-note:
i do not know how much of an influence this would have in practice, but collision detection is cheapest with spheres. so maybe it would be good if you have a test game with lots of T1 units (the ones you already converted) shooting at each other, to see if there is a noticeable performance loss.
That's interesting I knew there'd be a difference but had figured rectangles would also pretty cheap, is there any way of comparing the difference other than live testing like that?

BA Chicken defense chickens do use custom rectangle hitboxes and they seem to be okay lagwise.

Re: Custom Hitsphere Testing - Help Required

Posted: 06 Sep 2010, 02:37
by Hobo Joe
hoijui wrote:side-note:
i do not know how much of an influence this would have in practice, but collision detection is cheapest with spheres. so maybe it would be good if you have a test game with lots of T1 units (the ones you already converted) shooting at each other, to see if there is a noticeable performance loss.
How do they run faster? It seems to me that they would be more expensive simply due to more faces and thus more calculations(or so it would seem)

Re: Custom Hitsphere Testing - Help Required

Posted: 06 Sep 2010, 03:59
by thesleepless
Hobo Joe wrote:How do they run faster? It seems to me that they would be more expensive simply due to more faces and thus more calculations(or so it would seem)
With a sphere you just have to calculate the distance from the origin.

With a box you need to test 6 planes.

Re: Custom Hitsphere Testing - Help Required

Posted: 06 Sep 2010, 05:18
by Hobo Joe
thesleepless wrote:
Hobo Joe wrote:How do they run faster? It seems to me that they would be more expensive simply due to more faces and thus more calculations(or so it would seem)
With a sphere you just have to calculate the distance from the origin.

With a box you need to test 6 planes.
That makes sense. I was thinking of it in terms of the way it shows up in debug mode, as polygons.

Re: Custom Hitsphere Testing - Help Required

Posted: 06 Sep 2010, 19:08
by TradeMark
Great, ive wanted to change the HLT hitsphere into a cylinder for a long time. There is a cylinder hitbox, right?

What kind of list of possible hitboxes we have now? A list of most efficient to slowest would be great. Heres what i think: Sphere, Cylinder, Box.

Sphere should be used in most cases though, basically for ALL small units. and not for big units like krogs which are tall.

Cylinder would be great for most defense units like LLT, HLT etc.

Box only if you have wide but thin objects where sphere or cylindre would leave a lot of empty space. I dont think we need box hitbox in BA... maybe for labs only, aircraft plant, shipyard, etc.

Re: Custom Hitsphere Testing - Help Required

Posted: 07 Sep 2010, 12:10
by JohannesH
Also if someone wants to rage about hitsphere changes affecting balance, rage at engine devs rather than this, they changed the way they are calculated for some reason - if you like the old hitspheres this is very probably an improvement to what the engine has in that regard.

Atm llts cant shoot over core solars for example, jeffy can come and hide behind a mex from llt much easier, probably easier to hit with dgun, stumpies cant shoot over each other like they used to, etc.

So unless someone can convince an engine dev to fix it back, imo this should be included to BA asap.