Page 1 of 2
Collision problems
Posted: Thu Nov 17, 2011 4:29 pm
by Dakota
i've found a few topics on this but they either are using mshex or have a bit of a different problem.
i've made a hovership/boat/tank/thingy in XSI (4.2 foundation) i put collision the way i usually do, just selecting all objects, going to surface mesh, then merge, and it puts the collision there and i named it collision. i got the boat thing into the game and found out that the collision is way way off. you can bump into it from about as far away from it as it is long from the back but not from the sides or front. you can also land on the top of it from about twice as high has it goes. this is a big problem not only because of just it being bad to stand around but i made an interior to it and need people to be able to walk around and fire from it and also i set it up as a commandhover so you can spawn in it. i just need some help. i need to also know what a collision primative is and what it does and if i need it and also i need to know how to get this fixed. i'm close to releasing another beta of my map, all i need to do is get this fixed, and get a teleport offset problem, and a few weapons and unit naming done.
if someone could help me out it would be greatly appreciated.
i kind needed the vehecal as another way to get across the river in my map, having the bridges help but yet i want a less conventional way to get across.
Re: collision problems
Posted: Thu Nov 17, 2011 5:12 pm
by DarthD.U.C.K.
if battlefront has problems with your collision, you need to make a collisionmodel that is more primitive (pun intended). ususally its the best to build it out of cubes. then you can either use the cubes a primitives naming them "p_whatever" (only if you export with the pandemictool) or you can merge them nad name them "collision_whatever".
Re: collision problems
Posted: Thu Nov 17, 2011 5:15 pm
by Dakota
DarthD.U.C.K. wrote:if battlefront has problems with your collision, you need to make a collisionmodel that is more primitive (pun intended). ususally its the best to build it out of cubes. then you can either use the cubes a primitives naming them "p_whatever" (only if you export with the pandemictool) or you can merge them nad name them "collision_whatever".
so i make a collision primative just like i do other objects? just renaming them to something else. do i need to hide them or keep them unhiden or does it matter?
Re: Collision problems
Posted: Thu Nov 17, 2011 5:51 pm
by DarthD.U.C.K.
you dont have to, but its beter if you hide them. if you want to use collisionprimitives you are not allowed to freeze them (not freeze transofrms and not frezze modeling).
Re: Collision problems
Posted: Thu Nov 17, 2011 8:30 pm
by minilogoguy18
Collision primitives are very restrictive and only need to be used on animated objects. With primitives you can only scale/rotate/translate to get the desired shape BUT with cylinders you must control the size using the pop up menu. Another important thing is that you CAN NOT modify any components of a primitive, pretty much anything that will add to the modeling modifier stack in the explorer, it will all be undone on export. Example, moving vertex's, edges or polygons.
If a collision mesh on an non animated object isn't working right then you are doing something wrong since you can make those as detailed as you want (though it is best for performance to keep it lowrez) and it will work. Need to make sure the transforms are frozen as well as the object and place it as child to DummyRoot.
https://sites.google.com/site/swbf2modt ... /art_guide
All info is there minus the fact that you cannot modify a collision primitve other than it's general size.
Re: Collision problems
Posted: Fri Nov 18, 2011 10:03 pm
by Dakota
DarthD.U.C.K. wrote:you dont have to, but its beter if you hide them. if you want to use collisionprimitives you are not allowed to freeze them (not freeze transofrms and not frezze modeling).
i'll look into this, but also if i added these would it even help me with my problem since the collision is much bigger than the vehecal, would i also need to remove my other collision?
minilogoguy18 wrote:Collision primitives are very restrictive and only need to be used on animated objects. With primitives you can only scale/rotate/translate to get the desired shape BUT with cylinders you must control the size using the pop up menu. Another important thing is that you CAN NOT modify any components of a primitive, pretty much anything that will add to the modeling modifier stack in the explorer, it will all be undone on export. Example, moving vertex's, edges or polygons.
If a collision mesh on an non animated object isn't working right then you are doing something wrong since you can make those as detailed as you want (though it is best for performance to keep it lowrez) and it will work. Need to make sure the transforms are frozen as well as the object and place it as child to DummyRoot.
https://sites.google.com/site/swbf2modt ... /art_guide
All info is there minus the fact that you cannot modify a collision primitve other than it's general size.
my model isn't animated, its a simple hovering platform that i put two turrets on and a little box like building on the top in the middle for protection. would the turrets make my model count as an "animated object"? or would a collision mesh still work? should i just make a new collision mesh and this time not include the turrets?
Re: Collision problems
Posted: Fri Nov 18, 2011 11:14 pm
by FragMe!
Is you model a Vehicle, if it is then it requires collision primitives regardless whether or not there are animated parts.
If you want to see what your collision currently look like in game run BF2_modtools, go into fake console and toggle on the Render Collision (there are various types to turn on) then go into free camera mode and you will see all the in game collision objects.
Re: Collision problems
Posted: Fri Nov 18, 2011 11:27 pm
by minilogoguy18
^I've used collision meshes on my models on the non animated parts like the main body then used primitives on the animated parts like the wings. Everything worked fine, even checked by using the ship as a jungle gym in the hangar.
Re: Collision problems
Posted: Fri Nov 18, 2011 11:53 pm
by FragMe!
Okay we'll go with this instead

from the art guide doc.
Code: Select all
3. Collision meshes can NOT be used on moving parts (turrets, bones etc). When the vehicle is munged, all collision mesh nodes are merged into a single non-articulated collision mesh. If a moving part on a vehicle requires collision, it will have to be specified with a primitive.
4. If a vehicle has a collision mesh, it will automatically be used when colliding with soldiers and ordnance. Collision meshes (on vehicles) are not used for any other type of collision. Primitives must be used when vehicles collide with terrain, buildings, and other vehicles. Collision Primitives
--- Collision Primitives are a cheaper and faster way of computing collision for the game engine. It is also the only way to have collision on moving parts such as turrets or bones. Collision primitives can be either cubes, cylinders, or spheres. Cubes can be scaled in x,y, and/or z to better fit the geometry they are conforming to. It is best to leave the original size of 8 units as is and scale the cube from there. On the other hand, cylinders and spheres CANNOT be scaled. Instead, use the polygon properties such as radius and length to control the size of those 2 primitives. Also very important, primitive collision pieces CANNOT be frozen or lose their primitive properties. This information is taken directly into the game engine and if it is lost, the engine will most likely ignore the primitive collision. Lastly, DO NOT move the center of primitive collision either or else the proper information will be lost as well.
Re: Collision problems
Posted: Sat Nov 19, 2011 8:48 pm
by Dakota
FragMe! wrote:Okay we'll go with this instead

from the art guide doc.
Code: Select all
3. Collision meshes can NOT be used on moving parts (turrets, bones etc). When the vehicle is munged, all collision mesh nodes are merged into a single non-articulated collision mesh. If a moving part on a vehicle requires collision, it will have to be specified with a primitive.
4. If a vehicle has a collision mesh, it will automatically be used when colliding with soldiers and ordnance. Collision meshes (on vehicles) are not used for any other type of collision. Primitives must be used when vehicles collide with terrain, buildings, and other vehicles. Collision Primitives
--- Collision Primitives are a cheaper and faster way of computing collision for the game engine. It is also the only way to have collision on moving parts such as turrets or bones. Collision primitives can be either cubes, cylinders, or spheres. Cubes can be scaled in x,y, and/or z to better fit the geometry they are conforming to. It is best to leave the original size of 8 units as is and scale the cube from there. On the other hand, cylinders and spheres CANNOT be scaled. Instead, use the polygon properties such as radius and length to control the size of those 2 primitives. Also very important, primitive collision pieces CANNOT be frozen or lose their primitive properties. This information is taken directly into the game engine and if it is lost, the engine will most likely ignore the primitive collision. Lastly, DO NOT move the center of primitive collision either or else the proper information will be lost as well.
after reading that last part there i don't think i would be able to use a collision primative that could help me much.
what i really need is to know why the game isn't reading my original collisionmesh. i have it set up just like all the other ones i did and they work fine, vehecals too. but for this one it seems to be twice the size that it needs to be at least on the back. so if i am standing behind the tank i will run into it from a few feet away.
off topic: its really messing with me, just like my teleporter that i made that teleports you up but won't get me through the platform bottom that i need to get onto...... i wonder why that is too. (i'll probably have to move the nodes up)
Re: Collision problems
Posted: Sat Nov 19, 2011 9:10 pm
by FragMe!
As mentioned have a look at the collisions in game using BF2modtool it will show you what you are running into. Also do you have any kind of .option file for the msh and if so what is in it.
Next is are there any collision statements in you vehicles odf file?
Re: Collision problems
Posted: Sat Nov 19, 2011 9:29 pm
by minilogoguy18
Yeah, they cannot be used on a moving part but I'm not enveloping any models unless they're soldiers or something that needs envelope deformers. If it didn't bother me to have people get their hands on my source XSI scene files I would release them and show you that you CAN have a mix of meshes and primitives. It's all about how you set them up in the hierarchy, meshes are child to the root node where primitives are child to the bone that moves them.
If the model is simple enough to get away with primitives then they should be used but for something like the star viper which had a odd shape for the fuselage I used a collision mesh then primitives for the wings and guns that were animated.
You could easily do a collision mesh for the main part of the model and use primitives for the turrets and I will guarantee it will work. The proof is in the pudding, any of you can download this model for yourself and see...
Re: Collision problems
Posted: Sat Nov 19, 2011 9:38 pm
by Dakota
FragMe! wrote:As mentioned have a look at the collisions in game using BF2modtool it will show you what you are running into. Also do you have any kind of .option file for the msh and if so what is in it.
Next is are there any collision statements in you vehicles odf file?
wow i can't beleive i haven't posted my odfs and stuff yet...
heres my vehecle odf.
my msh.option file only has the keep aimer things for my two turrets on my vehecal (they are auto turrets)
here it is
Code: Select all
-keep aimer_y aimer_x aimer_y1 aimer_x1
EDIT: i uploaded the msh file if you need to see that too
http://www.gamefront.com/files/21004960/hoverboat.zip
Re: Collision problems
Posted: Sat Nov 19, 2011 11:24 pm
by FragMe!
two things:
add -donotmergecollision to your .option file
also looking at the model (and testing it) the little entrance door needs to be wider the unit collision is wider than the door opening so it can't get through.
@mini if you actually read what I posted I was reafirming what you said not refuting it.
Re: Collision problems
Posted: Sun Nov 20, 2011 1:07 am
by AceMastermind
minilogoguy18 wrote:...I would release them and show you that you CAN have a mix of meshes and primitives...
No one is disputing the mix of collision primitives and collision meshes, the docs even tell you this is OK and preferred.
@Dakota
If the intended use of your model will potentially use any of the vehicle classlabels(walker, hover, flyer etc) then you will need terrain, building and vehicle collision to be made using primitives since this is what the game engine expects. A collision mesh is only used for soldier and ordnance collision when using vehicle classlabels. Moving parts will always require collision primitives if you want conforming collision.
This isn't a big deal when creating static props since a collision mesh will be used for all collision types and is usually generated accurately by the game if none exist, like most objects converted to msh with MshEx.
I thought the docs were pretty clear about this but as always if you want to see working examples then open a vehicle msh in Unwrap3d to examine the scene objects.
I also recall psych0fred stating building collision is converted to spheres anyway by the game engine, so if you used a cube in XSI for building collision then it will be spherical ingame. I'll search for the source later though it may have been deleted by psych0fred himself when he removed the majority of his posts from Gametoast.
Re: Collision problems
Posted: Sun Nov 20, 2011 1:40 am
by Dakota
FragMe! wrote:two things:
add -donotmergecollision to your .option file
also looking at the model (and testing it) the little entrance door needs to be wider the unit collision is wider than the door opening so it can't get through.
@mini if you actually read what I posted I was reafirming what you said not refuting it.
ok i'll add that, also i was planning on doing something with the door, it looked a bit small but i never got to test it to see if i could get in.
EDIT: ok i added it and nothing changed.
Re: Collision problems
Posted: Sun Nov 20, 2011 5:43 am
by DarthD.U.C.K.
do you still try to use a collisionmesh?
sometimes it just doesnt work, you cant do anything about that. then you have to use primitives.
Re: Collision problems
Posted: Sun Nov 20, 2011 12:37 pm
by Dakota
DarthD.U.C.K. wrote:do you still try to use a collisionmesh?
sometimes it just doesnt work, you cant do anything about that. then you have to use primitives.
ok i replaced the collisionmesh with 15 collision primatives and now my collision is still messed up, it seems to be half sized. i can walk though the tank about a quarter of the way then it stops me and i can stand on the top of the tank about half way through the roof.
(at least i made a backup copy)
Re: Collision problems
Posted: Sun Nov 20, 2011 1:01 pm
by minilogoguy18
Are you modifying components like vertex's, polygons or edges? Because you can only strictly scale, rotate and move the objects and cylinders can only be scaled by using the length and radius options in the pop up box on creation.
Re: Collision problems
Posted: Sun Nov 20, 2011 1:27 pm
by FragMe!
try doing the render collision thing I mentioned earlier, while looking at it press
Print Screen (PRT SCR) exit your map but not the game, minimize the game open a paint program of your choice and paste the clipboard. You have to do it this way because the in game screen shot thing doesn't save the collision renders this other way does.
Then post it here.