I've been playing around with the airboat scripts from halflife2 to see if I can test a submarine, and missile boat model I have been working on. Buoyancy and counter acting buoyancy to get the sub to dive is has me a little stuck. Does anyone have any ideas on how to accomplish something like that in source?
Yeah you can actually change the buoyancy of objects in source directly, think it's in the surface properties or something.
Fun fact: A large boulder with a weight of 1000000 or so and material set to wood can act as a platform for people on the water.
I think the initial code for the boat portion won't be all that difficult, but submerging the the sub then bringing the submarine back to the surface where it acts like the regular boats is what is racking my brain. What if there was some type of depth control, so when clicked the sub's mass would be increased, then when submarine rises to the surface weight is reduced so physics is restored, and the sub acts as any other ship. also as a counter I wanted to test some type of depth charge, which will sink slowly to the ground then explode when it hits the ground, or comes in contact with a submarine. Only the missile boats will have this capability
i already explained how this should work, make it change the buoyancy less means it sinks, more means it comes up, find out some good max and min values then make 2 buttons add and subtract to it within the max and min values you gave (so subs cant jump up like if they are baloons) this is how real subs do it, they pressurise water in there ballast tanks to increase there average weight, and to go up they pump out the water to a lower density then outside so they become lighter and rise up edit: correction they dont compress it, they just take in water to be heavier then the water, or drive out the water with compressed air
As far as I know, Source doesn't change water density with depth. Buoyancy is basically either 'this sinks' or 'this floats' (and sometimes 'this flies into the sky'). There's no in-between. Also, objects use their origin to determine if they are above/below water, rather than calculating the volume of water they displace.
Simple solution: Hardcode submarines to ignore water physics and basically move in 0 gravity. If they exit water they gain standard gravity, preventing them from flying away. ??? SUBMARINES! (it's highly unlikely to happen though)
Hey then it'll be in a map so it has to be easily possible to implement in code. Trust me I know these things. (PS I'm sodaen)
how about we have some pseudo water? have some fake water where u reduce gravity and friction in some parts of the map.
Atm I want to test three types of watercraft Submarine Can go undetected by radar, only missile boats would have the ability to detect it. Also the submarine would have space for five people making it a great tool to sneak a squad undetected into an enemies base. Will be equipped with two missile slots Destroyer These boats act as fast attack craft. Will have the ability to detect submarines and drop depth charges to take out submarines if necessary. The boats would be equipped with heavy artillery, for ship to ship warfare, and bombarding bases from a far distance. Transport/carrier Got the idea from emp_landing, basically a watercraft that can ferry up to two heavies and has a landing pad to heal one aircraft. Will have the capacity to carry eight players like the apc, but will not have the ability to act as a spawn. Already started working on the three models for both NF and BE, and two shipyard models. Just basic models, for the purpose of testing the basic shape of the craft. and if it will float upright in water and not roll or bob unnaturally.
does scaling finally work? if not theres not enough space to build maps that suport ship fights AND tank combat rendering your carrier/landing boat idea useless (duststorm is about max grid size). and turning empires into battleships - idk, kinda sucks ....
I used to use a map with nothing but water , and hide the CV's over the map, then have a little land for testing and building purposes. at issue.but recently I have been having trouble getting hammer not to crash, so I have halted everything to find some way to resolve that issue
Havok handles buoyancy and that stuff but Source doesn't allow maps big enough (at least without scaling) to fit submarines. I hope that everyone remembers buoyancy puzzle from Half Life 2. Every physics object has drag and buoyancy ratio. Every fluid brush has density property. All these properties can be changed from code. These are properties for every fluid brush: Code: struct fluidparams_t { Vector4D surfacePlane; // x,y,z normal, dist (plane constant) fluid surface Vector currentVelocity; // velocity of the current in inches/second float damping; // damping factor for buoyancy (tweak) float torqueFactor; float viscosityFactor; void *pGameData; bool useAerodynamics;// true if this controller should calculate surface pressure int contents; } To find out how they work I'd have to check Havok code which I don't have (or lolol HL2 leak). To play around with that stuff you have to use C++ and be able to write at least basic things in C++. It simply wasn't exposed as entities/airboat props.