News | Forum | People | FAQ | Links | Search | Register | Log in
Moving Water And Negative Brush Or How To Make A Moving Boat
I've been looking everywhere for a solution, not just in id tech games, but other engines too. Essentially what I want, is to make a boat or submarine that can arbitrarily move. Naturally, a water brush passes right through, drowning the bottom decks of the boat and flooding the submarine.

I know that in Quake the liquid brushes are presumed to be unmoving, and are therefore baked in position so that even if you have a moving water brush (which can't be transparent due to portals?) then the brush stays, even though physically it appears somewhere else.

In Quake 2 you have func_water, but it still can't be transparent. Yet no negative water brush.

I presume that most games will have some sort of negative water brush, which moves with the boat. Could I make a special func_air and tell Quake (via to treat the player as if he's in air/void? If not in standard Quake, can it be done in Darkplaces/Fteqw?

I don't mind breaking Quake compatiblity to get this done.
The closest to the Quake engine I could even possibly see this happening in is Source and using portals.

Basically you'd just have a single staircase on the deck or something, and that is where the portal is. The water plane still clips through the boat, but your interior that the portal takes you to is just built somewhere else in the .bsp.


Or just fake it with teleporting. Make the door to the interior of the ship teleport the player to an interior built somewhere else, much like how the portal above works but much more low-tech. Maybe you'd want some kind of cutscene or screen fading to black to cover this teleport. That's how a lot of older games would've handled this.


Doing proper liquid and boats you can go inside and out of is a huge tech challenge, and would be something you would base the design of an entire game's engine around. Not something any off the shelf engine is going to do AFAIK. 
it can probably be done in quake using similar tricks to Pox's moving water in the "pox extras" mod. That mod forces the player into the "in water" state using quakec. Presumably you could do the reverse by forcing them out of that state using quakec, when in your func_air entity. 
Good question. The Source engine portal method suggested by Scampie seems to be the most sane one. I'm not aware of any Quake engine that supports such a thing. 
As Metl says has the func_watertrain, which is a trigger volume that behaves like a liquid one.

Even if you don't refactor that into a func_air, you could make a very big water train which has a hole in the middle. To steal scampie's example:




You don't just move the boat, but also the water volume.

This would work pretty much seamlessly, as long as you have enough space outside the level to hide the massive fake water volume not being used currently. I never got it working properly with fish, although it does in the original.

Fish are the most broken enemy in the game though, so maybe just replace them with zombies/spawn for your water enemies. Unless you're adding new stuff of course. 
That would make the water texture move along with the boat, breaking the illusion. At best, it would give the impression that the boat is stuck in a giant pudding that moves around. 
Would a custom animated texture help there ? 
Thanks for the reference, Pox R4 looks really nice. I'm more amazed by the gravity well that sucks in the wall-trap nails. The way the nails move into it is really smooth and mesmerising. Sadly his ladders don't work in Darkplaces, but do in Quakespasm. Anyway, on topic, yes it looks like it could be rigged to work for my purposes. Quakespasm with transparent water gives un-vised-like graphical glitches. But I'm making an entirely new game, so that doesn't matter for this project. I'll look into the quakec code tonight or tomorrow, and upload it here if it works.

I actually tried a few variations of this, and it can't be done. As mankrip said, the water moves with the boat and causes vis problems. The other problem is, that it can only reasonably be done with one boat. I want arbitrary numbers of boats and arbitrary movement between upper and lower decks, and possibly windows :D 
On A Slightly Different Topic.. 
What would be an elegant way to group things together. E.g. in quake/quake 2 you can use func_group, but that means you can't then set it to func_wall or func_plat or whatever. I've never mapped beyond id tech 3, so I'm not sure how Doom 3/Quake 4 will do it. For example, you can't have a moving switch on an elevator, because it will become func_plat or func_train and lose the func_button. I think the simplest way is to have a new entity property called group, which could be a list of integers which represent the groups (so that you can have multiple groups).

Does anyone know how it's done in Half Life 2? 
I Think 
Trenchbroom 2 allows for grouping of different things. 
Such grouping requires extra QC code to support it. There's no such thing in vanilla Quake. 
DarkPlaces and similar engines can use movetype_follow to have entities stay together at all times. 
0.� I forgot about that. 
Ahhh Nice, thanks for that. Looks like the source engine also uses it. That's a very simple and elegant solution.
I've looked at pox's code, and it's just a hack. It essentially mimics being under water. The motion isn't right and there's no underwater waves. It doesn't properly support transparency or drawing the inside textures. With messing around and thin water slices it can be done - but it's just an awful hack imho.

I think it will have to be written in the engine. I'll get around to it when I really need it. 
TrenchBroom 2 allows you to have entities and even brush entities in groups, but you can't have a group inside a brush entity. However in the map file it all gets mapped to special entities and entity keys that are ignored by the compiler and game. 
You must be logged in to post in this thread.
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.