Page 1 of 1
Baots: Collision mesh affects boat's movement in water?
Posted: Thu Mar 10, 2011 8:00 am
by Swaffy
I looked at the Elco 80 torpedo boat, and one of the collision meshes have a hull that stretches, vertically, about twice the height of the actual boat mesh.
I believe that was collision mesh two, as collision mesh one might be for all other collisions such as land and objects.
Does a boat need a large Collision mesh 2 to float properly in the water?
[In other words, does the collision mesh need to stretch down lower than the visible mesh?]
[What I did that caused me to ask this question:]
I edited my copy of the Elco 80, my speedboat, and got rid of the weapons and made the hull thinner.
I made the hull thinner for both collision meshes and the visible mesh.
When I played the game, the boat kept "bouncing" out of the water and flipping over multiple times.
Re: Baots: Collision mesh affects boat's movement in water?
Posted: Thu Mar 10, 2011 7:35 pm
by Apache Thunder
The way the boat floats is effected by the shape/size of the LOD mesh, the submarine settings if any, and how the floater objects are set up on the boat. I don't think the game factors the collision meshes in for float physics as water drag is calculated much in the same way as air drag. In which case it uses the LOD to determine the physics of that. Actually from what I can tell, as soon as you disable damage from water (which all boats are set up like this), then drag from water is non existent. Try turning off damage from water on a jeep. From what I can remember, you could then drive it nearly full speed underwater.
But what you have is most likely incorrect floater settings. Check the floater objects and make sure they are positioned correctly and that they have the correct settings. The vertical position of the floaters and their "hull height" setting will have the greatest impact.
Example code of a floater used in my BFH mod:
Code: Select all
ObjectTemplate.create FloatingBundle JeepFloater
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.setHullHeight 0.7
ObjectTemplate.setFloatMaxLift 5
ObjectTemplate.setFloatMinLift 5
ObjectTemplate.setSinkingSpeedMod 1
ObjectTemplate.setDragModifier 4
HullHeight I believe effects how far it allows the floater to sink before "floating". Float Max Lift/Min Lift should be self expanetory. Those effect how much bouncy they have. Set this too high and you may get the effect your getting now (combined with incorrect floater vertical position/hullheight setting).
Sinking Speed mod I believe allows the boat to sink when it dies and drag modifier adds drag to the floater. (thereby allowing drag in the water. Any vehicle without this would have no drag in the water if their damage from water physics is off)
Floaters is one area I don't have extensive work on. So even I have to do a lot of ingame tests to make sure any vehicles I add these too behave correctly. It took me a good 2 or so hours to get my BFH jeeps/tanks to behave in the water. (the most common issue I had with them was that they bobbled around in the water. Though I did not have them flip around like you have)
Oh and typically boats have at least four floaters. One on each corner of the object. Though a few small projectiles that I add these too only have one floater as I want them to rotate around in the water. Like the Keg and Soccer ball from my BFH mod. They spin freely in the water as they should in real life. (though the Keg not so much)
Re: Baots: Collision mesh affects boat's movement in water?
Posted: Fri Mar 11, 2011 4:56 am
by Swaffy
Alright, thanks.
Re: Baots: Collision mesh affects boat's movement in water?
Posted: Fri Mar 11, 2011 7:17 pm
by Dennis|8749236
i think Hullheight is effect the attitute that the floater will have effect to push the object upward...
i remember i add a floater on a rocket, to make it bounce when it have low angle to hit the water..
but, i set the Hullheight to 12, and when i test it, i fired my rocket in Omaha_Beach's USS Destoryer, the rocket just fly into the air..
ever i didn't fire it into water..
so, i think the Hullheight is telling BF1942: how big the floater it is..
Re: Baots: Collision mesh affects boat's movement in water?
Posted: Sun Mar 13, 2011 5:49 am
by Swaffy
I'll poke at it a few times and see what I can come up with.