Crater Creator wrote:Holy, moley, great balls of fire! That's probably the first time I've thought flames looked good in this engine, and it seems all you're using tech-wise is transparency and bloom. Most impressive.
Thanks.
Crater Creator wrote:If you want to do better using 'CS-y' tricks, I would suggest detecting when the collision should happen in Lua (look for the height check), and then dynamically spawning an invisible scenery object off of which the player can bounce (or more accurately, slide). If you can tolerate one frame of getting inside the bridge, the amount of calculation should compare favorably.
Basically that's the only way. Of course the manner in which the player interacts with scenery is no picnic either. Sliding is just one possibility. Working with so much scenery has shown me that many times you'll just get bound up and stopped in your tracks if the angle is off. That and the dimensions of the cylinder are set in place, so you'd need a very general object yet one that suits most possibilities and also moves with the player. Moving objects seems to make them less than entirely solid while in transit, judging by my swinging doors, although I'll need to test that rigorously to make sure.
Anyway, I started thinking about your script, and that helped me to script some better swimming behavior. The player can dive and such, and then when they want to surface they can keep their head above water entirely while holding down the swim key. I had to disable "swimming" in MML to pull it off, but I also disable weapons while doing what I call swimming since it's more like actually swimming in water than "swimming" when you have a gun in your hand and are basically moving upright (walking) through the water like it's thick air. The result being that right now the alternate fire key does what the run key used to do, more or less. You can't surface by default, just like before.
But, while the run or now alt fire key is
not being held down, you can swim up or down depending on aim and forward movement, even down to the floor (although when the player's z is under the floor (though we never let them go far enough to start clipping the floor), a difference of 0.3 WU will make it impossible to pass into polygons where there's a z difference in either the ceiling or floor on the side you want to cross. I forget what affects player step height.)
The only caveat is that unless you hold the alt fire/swim key, you won't surface.
The issue is that in order to move forwards or perpendicular when the player's head is above water (where the camera won't breach the surface of the media and spoil the faders and fog that make the water look good underwater but won't render unless the player's head is under water), the player has to have its feet on the ground or have its head under water. These are both impossible, unless you reposition the player and back between physics and rendering.
Ah, but then that's basically what your script does to pull off movement on 3d scenery, right? Now the only problem is that the faders for the liquid still show up after all. So, we just remove the liquid, move the player's z to the polygon's floor z, then in postidle reposition the player back to where they were, and replace the liquid. Again, trying to push stuff between physics and render. Still some bugs with it, but in general it works really great.