Any tips regarding water Created 7 years ago2017-11-08 16:10:50 UTC by User#6970 User#6970

Created 7 years ago2017-11-08 16:10:50 UTC by User#6970 User#6970

Posted 7 years ago2017-11-08 16:10:50 UTC Post #337999
Hi, I'm building an undertow-like map where water rises, but I want to make it rise for the entire map. The map is big.

So what I did is that I created a brush that I tied to a func_water that is the size of the map and is located under it.

Any tips regarding performance. It's making the map lag a litle. Is there another way to do it. I heard using VHLT instead of ZHLT helps, but any other tips is appreciated.

If I make it invisible (Render Mode: Solid, FX Amount: 0) will it drain less juice?
Posted 7 years ago2017-11-08 18:38:38 UTC Post #338000
Try splitting it up into separate entities, that should cut down on the number of visible polygons from any one location, provided your map isn't one large open area.
Posted 7 years ago2017-11-08 19:26:15 UTC Post #338001
Brushes tied to func_water are always rendered wherever you are, no matter if you can see them or not. I think that's the problem.
GS wasn't really designed for big maps.

Try what Solokiller suggested. If it doesn't help, try tying the water brush(es) to world. Yeah, you'll have to sacrifice water's transparency and ability to rise but it can help you improve the performance.
Posted 7 years ago2017-11-09 12:51:46 UTC Post #338006
Its been a while, but wasn't there a trick of making the water entity not visible so it does not lag (say, render mode additive amount 0) and then representing the water visually with a non-solid brush entity(s) like a func_door or func_button that looks like water and moves at the same speed as the actual invisible water entity?

I.e. Treat the visual water differently than what the player actually can swim in.

-cAyle
Posted 7 years ago2017-11-09 13:00:50 UTC Post #338007
If you can set the EF_NODRAW flag then it won't network the entity's data: https://github.com/ValveSoftware/halflife/blob/master/dlls/client.cpp#L1100

You can manually set that by adding a keyvalue "effects" with value 128.
I've never tried it myself though, so use with caution. It may break client side water physics prediction.
Posted 7 years ago2017-11-09 21:04:59 UTC Post #338009
Windawz, what do you mean by "tying the water brush(es) to world"?
Do you mean to tick the to World CheckBox in the Texture panel? "you'll have to sacrifice water's transparency and ability to rise" How does that sacrifice water's transparency and ability to rise it?

Dallas, I just wonder if the player will be able to swim in the water if I use a func_door. I'll be trying that tonight. Also do you imply using an env_render to make the water visible again?

SoloKiller, what's to "network one's entity's data"?. I will try the switch you mention and come back with the results.
Posted 7 years ago2017-11-09 23:14:51 UTC Post #338010
Brushes with water textures on them are automatically considered as water volumes. You just can't set render modes or anything on them, you can do this by removing the entity that they're attached to using Tools->Move to world.

You can make doors non-solid with the passable flag.

Entity data is networked so the client can deal with entities locally, it will simulate physics on the client to help counteract lag. Entities aren't networked if they're set not to draw, so you need to be careful.
Posted 7 years ago2017-11-10 10:31:05 UTC Post #338011
What i was suggesting is that you have 2 entities.

1st entity is the func_water entity you already have. BUT, change the render properties on it so it is invisible. Render mode additive, amount 255. Set the wave height to 0. (have this entity move up and down like you wanted, just now, the player won't be able to see it and iirc it will not have performance problems)

2nd entity is a non solid func_door. Have it cover the exact same space as the water, and script it to move up and down at the same time and rate as the water. BUT, make this door visible, and make it look like water. For example, render mode texture, amount 60.

iirc thats how you make cheaper water.
Posted 7 years ago2017-11-10 16:53:18 UTC Post #338013
Nice. I had to remake my map from scratch because of noobism. But as soon as I'm at a more advanced stage I will try that.

Edit: How do you make func_door non-solid? By giving it a water texture on top and something like BEVEL on the other sides?
Posted 7 years ago2017-11-10 17:18:22 UTC Post #338014
Set the passable spawnflag, it turns off collisions for it.
Posted 7 years ago2017-11-10 17:28:52 UTC Post #338015
That's a revelation. So far I only knew func_illusionary which shows similar behavior.

Edit: Thanks guys!
Posted 7 years ago2017-11-18 04:14:35 UTC Post #338096
OK, I tried creating water the size of the map, but I get the brush outside world error. I tried moving my map up using the move tool and I get this undescriptive error:

Warning: === LEAK in hull 0 ===
Entity func_wall @ ( 0, 0, 0)

Help!
Posted 7 years ago2017-11-18 04:32:33 UTC Post #338097
Nevermind. I did the move using VH instead of JackHammer and it worked. Thanks guys.
Posted 7 years ago2017-11-18 05:15:30 UTC Post #338098
I tested the cheap water and it worked like a charm. I used render mode texture and fx amount 0 for transparency. Additive with 255 wasn't hiding the shape completely.

I tested with gl_wireframe 2 and the polygons really aren't drawn when the shape is invisible.
You must be logged in to post a response.