Per piece collision volumes issues

Per piece collision volumes issues

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Per piece collision volumes issues

Post by Forboding Angel »

So, I have this factory, and every thing should be just fine. However, I noticed that the boxes for the per piece collision volumes, which the right size, were well off to one side.

Looked in upspring, and I had set the model center to the big tower thing. I moved it back to 0 and the boxes lined up... Ok weird...

So I take another look in game...

WTF? There is this big red box around everything (and shots impact this box and do no damage to the unit), and then if you look lower there is a short purple box around... nothing.

What the hell is going on?

What am I doing so massively wrong that none of this makes sense?

Image

Image

Unitdef:
https://code.google.com/p/evolutionrts/ ... actory.lua

http://www.imagebam.com/image/cd6d9e174861084
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: Per piece collision volumes issues

Post by Rafal99 »

Forboding Angel wrote:So, I have this factory, and every thing should be just fine. However, I noticed that the boxes for the per piece collision volumes, which the right size, were well off to one side.

Looked in upspring, and I had set the model center to the big tower thing. I moved it back to 0 and the boxes lined up... Ok weird...
I run into the same issue some time ago. To fix this you need to set modelCenterOffset in the unitDef to the same value as model center in UpSpring. Don't ask me why...
Or alternatively set the model center to 0 like you did.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Per piece collision volumes issues

Post by Forboding Angel »

No, you are completely missing the issue. Red box, purple box. There are no pieces that cover that area.

Look at the model in upspring and compare it to the hitboxes. Notice 2 boxes that shouldn't be there?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Per piece collision volumes issues

Post by Forboding Angel »

Ok, found the solution,

Basically, rafal was right about the issue he thought I was talking about.

I had face edited that model to delete half of it. Apparently you need to recalculate the normals in upspring otherwise it still thinks that the parts of the model you deleted are still there. That fixed the boxes issue.

Now the other issue was when I moved the hitsphere around, it moved the collision boxes around. Setting same values in unitdef as in upspring like rafal said fixed that.
User avatar
Deadnight Warrior
Posts: 183
Joined: 08 Jun 2009, 17:59

Re: Per piece collision volumes issues

Post by Deadnight Warrior »

Usually you don't need collision volumes for each and every piece, as many overlap.
A good tutorail about collision volumes is on the spring wiki, and a simple but effective way to customize collision volumes is with the Dynamic Collision Volume gadget (don't forget the CV config file).
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Per piece collision volumes issues

Post by Forboding Angel »

In evo, the models are very highly optimized. That factory that you see only has about 5 actual pieces.

The vast majority of evo models (including mobile units except the all terrains) have 3 pieces or less. Even the All terrain tanks usually only have 11 pieces (or less).

I have gleaned a lot of data about collision volumes and how they + spring work. I'm not going to go into detail right now though as it's an exhaustive list of results and frankly at this very moment, I cba.
Post Reply

Return to “Game Development”